/* === General Layout === */
body, html {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.container {
    max-width: 90%;
    margin: 0 auto;
}

/* === Login Styles === */
.log_in_outer {
    width: 100%;
}

.log_in_inner {
    width: 464px;
    margin: 0 auto;
    background-color: #faf9f9;
    padding: 0 19px 22px;
    border: 1px solid #ccc;
    border-radius: 5px 5px 4px 4px;
    box-sizing: border-box;
    display: table;
    position: relative;
    top: 50px;
}

h2.heading {
    margin: -1px -20px 8px !important;
    text-align: center;
    background-color: #337ab7;
    color: #fff;
    text-transform: capitalize;
    padding: 13px 10px;
    border-radius: 5px 5px 0 0;
}

h2.heading::before,
h2.heading::after {
    content: "";
    display: table;
    clear: both;
}

.log_in_inner .btn.btn-primary {
    padding: 4px 27px 5px;
    font-size: 17px;
    float: left;
}

.log_in_inner input {
    height: 39px;
}

.log_in_inner label {
    font-size: 17px;
    font-weight: 500;
}

/* === Buttons === */
button.btn.btn-danger.btn-sm,
button.btn.btn-primary.btn-sm.me-2 {
    font-size: 16px;
    text-align: center;
    padding: 10px;
}

button.btn.btn-danger.btn-sm {
    margin: 15px 0;
    width: 100%;
}

button.btn.btn-primary.btn-sm.me-2 {
    margin: 10px 0 0 50%;
    width: 10%;
}

/* === Pagination === */
.pagination .page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: white;
}

.pagination .page-link {
    color: #0d6efd;
}

/* === Loader === */
.loader {
    text-align: center;
    margin: 20px 0;
    transition: opacity 0.3s ease-in-out;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 2s linear infinite;
    display: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fade-out {
    opacity: 0.5;
    pointer-events: none;
}

/* === Badge Styling === */
.badge-store {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    font-size: 0.8rem;
    border-radius: 999px;
    font-weight: 600;
    margin: 2px;
}

.badge-green {
    background-color: #d1f7d1;
    color: #256029;
    border: 1px solid #256029;
}

.badge-red {
    background-color: #fddddd;
    color: #a30000;
    border: 1px solid #a30000;
}

.badge-store i {
    margin-left: 4px;
}

/* === Modal === */
.modal-backdrop {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.4);
    position: fixed;
    inset: 0;
    z-index: 1050;
}

.modal-content-box {
    width: 90%;
    max-width: 1400px;
    height: 80vh;
    background: #fff;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.modal-header,
.modal-footer {
    background-color: #f8f9fa;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header {
    border-bottom: 1px solid #e0e0e0;
}

.modal-header .btn-close {
    border: none;
    font-size: 22px;
    cursor: pointer;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #fff;
}

.modal-footer {
    border-top: 1px solid #e0e0e0;
    flex-wrap: wrap;
}

.modal-footer button {
    border: none;
    color: #fff;
    font-size: 16px;
    padding: 10px 0;
    border-radius: 6px;
    margin: 5px 0;
    cursor: pointer;
    transition: opacity 0.2s ease;
    flex: 1 1 48%;
}

.modal-footer button.full-width {
    flex: 1 1 100%;
}

.modal-footer button:hover {
    opacity: 0.85;
}

#nextTab, #nextBtn { background-color: #007bff; }
#prevTab, #prevBtn { background-color: #6c757d; }
#createProductBtn, #largeCreateBtn { background-color: #28a745; }

/* === Product Details === */
.product-details-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.product-image img {
    width: 100%;
    max-width: 300px;
    object-fit: contain;
    border-radius: 8px;
}

.product-info h1 {
    font-size: 20px;
    margin-bottom: 10px;
}

.form-section {
    margin-top: 20px;
    padding: 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* === Tabs === */
.tabs {
    display: flex;
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 15px;
}

.tab-button {
    padding: 10px 15px;
    background-color: #e9ecef;
    border-radius: 6px 6px 0 0;
    margin-right: 5px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.tab-button.active {
    background-color: #dee2e6;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.section-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 10px;
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
}

/* === Compare Table === */
.table-container {
    width: 90%;
    margin: 50px auto;
    overflow-x: auto;
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.compare-table th,
.compare-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

.compare-table th {
    background-color: #007bff;
    color: #fff;
    position: sticky;
    top: 0;
}

.compare-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.compare-table tr:hover {
    background-color: #f1f1f1;
}

.matched {
    background-color: #d4edda;
    color: #155724;
}

.mismatched {
    background-color: #f8d7da;
    color: #721c24;
}

.update-button {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.update-button:hover {
    background-color: #0056b3;
}

/* === History Popup === */
.history-popup,
.popup-details {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #f9f9f9;
    padding: 20px;
    border: 1px solid #ccc;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    z-index: 1001;
    max-height: 80vh;
    overflow-y: auto;
    width: 80%;
}

.history-popup h2,
.popup-details h3 {
    margin-top: 0;
    margin-bottom: 15px;
}

.history-search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.history-search-form input[type="text"] {
    flex-grow: 1;
}

.history-table,
.popup-details p {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.history-table th,
.history-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.history-table th {
    background-color: #f2f2f2;
}

.history-popup-close,
.popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    cursor: pointer;
    background: none;
    border: none;
    color: #888;
}

.history-popup-close:hover,
.popup-close:hover {
    color: #333;
}

/* === Overlay === */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* === Category Tree === */
.category-tree ul {
    list-style: none;
    padding-left: 20px;
}

.category-tree ul ul {
    display: none;
}

.category-tree li {
    cursor: pointer;
}

.category-tree li:before {
    content: "+ ";
}

.category-tree li.expanded:before {
    content: "- ";
}

.category-tree li.expanded > ul {
    display: block;
}

#selected-categories {
    margin-bottom: 10px;
}

.selected-category {
    background-color: #f0f0f0;
    padding: 5px;
    border-radius: 3px;
    margin-right: 5px;
}

.remove-selected-category {
    background: none;
    border: none;
    color: red;
    cursor: pointer;
    margin-left: 5px;
}
