:root {
    --sedar-black: #000000;
    --sedar-white: #ffffff;
    --text-gray: #666666;
    --border-color: #e0e0e0;
    --accent-red: #d32f2f;
    --hover-gray: #f5f5f5;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--sedar-white);
    color: var(--sedar-black);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

header {
    background-color: #000;
    color: #fff;
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
    width: 220px;
    overflow: hidden;
}

.sedar-logo-img {
    width: 130%;
    /* Zoom in */
    height: auto;
    display: block;
    filter: invert(1);
    /* Inverts black logo on white to white logo on black header */
}

/* Main Content Area */
main {
    padding: 4rem 5%;
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.stock-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.stock-header h3 {
    font-family: 'Playfair Display', serif;
    font-size: 2.4rem;
    font-weight: 400;
    color: var(--sedar-black);
}

/* Interactive Search Bar */
.search-container {
    width: 100%;
    max-width: 450px;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.search-wrapper:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.main-search-input {
    background-color: var(--sedar-white);
    border: 1px solid var(--sedar-black);
    color: var(--sedar-black);
    padding: 16px 60px 16px 20px;
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    width: 100%;
    outline: none;
    transition: border-color 0.2s;
}

.main-search-btn {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 60px;
    background: var(--sedar-black);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.main-search-btn:hover {
    background-color: #333;
}

.search-icon {
    width: 24px;
    height: 24px;
    fill: var(--sedar-white);
}

/* Table Styles */
.table-responsive {
    overflow-x: auto;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.stock-table {
    width: 100%;
    border-collapse: collapse;
}

.stock-table th {
    text-align: left;
    padding: 1.5rem;
    font-weight: 700;
    color: var(--sedar-black);
    border-bottom: 2px solid var(--sedar-black);
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
}

.stock-table td {
    padding: 1.5rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
}

.stock-table tr:hover {
    background-color: var(--hover-gray);
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalScale 0.3s ease-out;
}

@keyframes modalScale {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
}

.close-modal {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #000;
}

.modal-body {
    padding: 1.5rem 2rem;
}

.batch-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.batch-table th,
.batch-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.batch-table th {
    background-color: #f9f9f9;
    font-weight: 600;
    color: #666;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid #eee;
    text-align: right;
}

.refresh-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.2s;
}

.refresh-btn:hover {
    background-color: #f0f0f0;
}

.refresh-icon {
    width: 20px;
    height: 20px;
    fill: #666;
}

.refresh-btn.spinning .refresh-icon {
    animation: rotate 1s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Action Buttons */
.reserve-btn {
    background: #af8d54;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.reserve-btn:hover {
    background: #8e6f42;
    transform: translateY(-1px);
}

/* Tabbed Navigation */
.tabs-nav {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.tab-btn {
    background: none;
    border: none;
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    color: #999;
    cursor: pointer;
    position: relative;
    padding: 0 5px 10px 5px;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--sedar-black);
}

.tab-btn.active {
    color: var(--sedar-black);
    font-weight: 700;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -11px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--sedar-black);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Status Badges */
.badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Reservations Section Styling */
.reservations-section {
    animation: fadeIn 0.5s ease-out;
}

.status-pending {
    background: #e3f2fd;
    color: #1976d2;
    /* Blue */
}

.status-not-reserved {
    background: #eeeeee;
    color: #424242;
    /* Grey */
}

.status-reserved {
    background: #e6f4ea;
    color: #1e7e34;
    /* Green */
}

.status-active {
    background: #e6f4ea;
    color: #1e7e34;
}

.status-expired {
    background: #fce8e6;
    color: #d93025;
}

.status-cancelled {
    background: #f5f5f5;
    color: #757575;
    border: 1px solid #e0e0e0;
}

/* Admin Dropdown Styling */
.status-dropdown {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    outline: none;
}

.status-dropdown option {
    font-weight: 400;
    text-transform: none;
}

.status-dropdown[data-status="pending"] {
    background: #e3f2fd;
    color: #1976d2;
}

.status-dropdown[data-status="reserved"] {
    background: #e6f4ea;
    color: #1e7e34;
}

.status-dropdown[data-status="not reserved"] {
    background: #eeeeee;
    color: #424242;
}

.status-dropdown[data-status="cancelled"] {
    background: #f5f5f5;
    color: #757575;
}

.status-dropdown[data-status="expired"] {
    background: #fce8e6;
    color: #d93025;
}

.reservations-section {
    animation: fadeIn 0.5s ease-out;
}

.btn-close {
    padding: 0.8rem 2rem;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-close:hover {
    background-color: #0056b3;
}

/* Eye Icon Button */
.batch-info-btn {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.batch-info-btn:hover {
    background: #f0f0f0;
    border-color: #999;
}

/* Loading Animation */
.loading-dots::after {
    content: '...';
    display: inline-block;
    width: 1em;
    text-align: left;
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {

    0%,
    20% {
        content: '';
    }

    40% {
        content: '.';
    }

    60% {
        content: '..';
    }

    80%,
    100% {
        content: '...';
    }
}

/* --- Selection & UI Refinements --- */
.res-qty-input {
    width: 60px;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 0.9rem;
    transition: border-color 0.2s;
    background-color: #fff;
    color: #000;
}

.res-qty-input:focus {
    outline: none;
    border-color: #af8d54;
    box-shadow: 0 0 0 2px rgba(175, 141, 84, 0.1);
}

.view-eye-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    color: #af8d54;
    padding: 6px;
}

.view-eye-icon:hover {
    background: rgba(175, 141, 84, 0.1);
    transform: scale(1.1);
}

.view-eye-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.reserve-btn-small {
    background: #000;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
}

.reserve-btn-small:hover {
    background: #af8d54;
}

.stock-value.loading {
    color: #999;
    font-style: italic;
    font-size: 0.9rem;
}

/* Reservations Header Fix */
.stock-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.selectable-row {
    cursor: pointer;
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    header {
        flex-direction: column;
        text-align: center;
        padding: 2rem 5%;
    }

    .divider {
        display: none;
    }

    .brand-name {
        padding-right: 0;
        margin-bottom: 1.5rem;
    }

    .tagline h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    .stock-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }

    .search-container {
        max-width: 100%;
    }

    .stock-header h3 {
        font-size: 1.8rem;
    }

    .stock-table th,
    .stock-table td {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .brand-name h1 {
        font-size: 2.5rem;
    }

    .brand-name .arabic {
        font-size: 2rem;
    }

    .tagline h2 {
        font-size: 1.2rem;
    }
}

/* Admin Stats Styles */
.admin-stats-container {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat-box {
    background: white;
    border: 1px solid #eee;
    padding: 15px 25px;
    min-width: 200px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-label {
    font-size: 0.85rem;
    color: #af8d54;
    /* Sedar Gold */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.4rem;
    color: var(--sedar-black);
    font-weight: 700;
}

@media (max-width: 600px) {
    .admin-stats-container {
        gap: 10px;
    }

    .stat-box {
        flex: 1;
        min-width: 140px;
        padding: 10px 15px;
    }
}