/* Import premium Google Font */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-primary: #0a0b10;
    --bg-secondary: #12131a;
    --bg-card: rgba(30, 32, 45, 0.6);
    --bg-sidebar: #0f1017;
    --accent: #7c3aed;
    --accent-hover: #6d28d9;
    --accent-glow: rgba(124, 58, 237, 0.3);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #8b929f;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(124, 58, 237, 0.5);
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --transition-speed: 0.3s;
    --font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.glass-card:hover {
    box-shadow: 0 12px 40px 0 rgba(124, 58, 237, 0.15);
}

/* Forms & Inputs */
.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-control-premium {
    background: rgba(15, 16, 23, 0.7) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: 10px !important;
    padding: 0.75rem 1rem !important;
    transition: all var(--transition-speed) ease !important;
}

.form-control-premium:focus {
    background: rgba(15, 16, 23, 0.9) !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px var(--accent-glow) !important;
    outline: none;
}

.form-control-premium::placeholder {
    color: var(--text-muted) !important;
}

.form-control-premium option {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

/* Input Group Text (Password Toggle Icon) */
.input-group-text-premium {
    background: rgba(15, 16, 23, 0.7) !important;
    border: 1px solid var(--border-color) !important;
    border-left: none !important;
    color: var(--text-secondary) !important;
    border-top-right-radius: 10px !important;
    border-bottom-right-radius: 10px !important;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.form-control-premium + .input-group-text-premium {
    border-left: none !important;
}

.form-control-premium:focus + .input-group-text-premium {
    border-color: var(--accent) !important;
    color: var(--accent) !important;
}

/* Buttons */
.btn-premium {
    background: linear-gradient(135deg, var(--accent) 0%, #a78bfa 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all var(--transition-speed) ease;
    box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5);
    background: linear-gradient(135deg, #8b5cf6 0%, #c084fc 100%);
    color: #ffffff;
}

.btn-premium:active {
    transform: translateY(1px);
}

.btn-premium-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1.5px solid var(--accent);
    border-radius: 10px;
    padding: 0.725rem 1.5rem;
    font-weight: 600;
    transition: all var(--transition-speed) ease;
}

.btn-premium-outline:hover {
    background: var(--accent);
    box-shadow: 0 4px 14px var(--accent-glow);
    transform: translateY(-2px);
    color: #ffffff;
}

/* Alerts */
.alert-premium {
    background: rgba(30, 32, 45, 0.8);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 12px;
    backdrop-filter: blur(8px);
}

.alert-premium-danger {
    border-left: 4px solid var(--danger);
}

.alert-premium-success {
    border-left: 4px solid var(--success);
}

.alert-premium-warning {
    border-left: 4px solid var(--warning);
}

/* Dashboard Layout Structure */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.admin-sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
    transition: all var(--transition-speed) ease;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-brand {
    padding: 1.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, #a78bfa 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    list-style: none;
    padding: 1.5rem 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-item a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    border-left: 4px solid transparent;
    transition: all var(--transition-speed) ease;
}

.sidebar-item a:hover {
    color: var(--text-primary);
    background: rgba(124, 58, 237, 0.05);
    border-left-color: rgba(124, 58, 237, 0.4);
}

.sidebar-item.active a {
    color: var(--text-primary);
    background: rgba(124, 58, 237, 0.1);
    border-left-color: var(--accent);
    font-weight: 600;
}

.sidebar-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    margin-top: auto;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Main Content Area */
.admin-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Navbar Styling */
.admin-navbar {
    background-color: rgba(18, 19, 26, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 90;
}

.navbar-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.navbar-user-avatar {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--accent) 0%, #a78bfa 100%);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* Content Container */
.admin-content {
    padding: 2rem;
    flex-grow: 1;
    overflow-y: auto;
}

/* Stat Cards */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-focus);
    box-shadow: 0 8px 30px rgba(124, 58, 237, 0.1);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(124, 58, 237, 0.1);
    color: var(--accent);
}

.stat-info h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
}

.stat-info p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Footer info */
.admin-footer-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 3rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animated-fade-in {
    animation: fadeIn 0.4s ease forwards;
}

/* Mobile Sidebar Toggle styling (placeholder fallback) */
@media (max-width: 767.98px) {
    .admin-wrapper {
        flex-direction: column;
        min-height: 100vh;
    }
    
    .admin-sidebar {
        position: fixed;
        top: 0;
        left: -260px;
        width: 260px;
        height: 100vh;
        height: 100dvh;
        z-index: 1050;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.5);
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    
    .admin-sidebar .sidebar-brand {
        flex-shrink: 0;
    }
    
    .admin-sidebar .sidebar-menu {
        flex-grow: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 1.5rem 0;
        margin: 0;
    }
    
    .admin-sidebar .sidebar-footer {
        flex-shrink: 0;
        margin-top: auto;
    }
    
    .admin-sidebar.show-sidebar {
        transform: translateX(260px);
    }
    
    .admin-navbar {
        padding: 0.75rem 1rem;
    }
    
    .admin-content {
        padding: 1rem;
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(10, 11, 16, 0.6);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 1040;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    
    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }
    
    .stat-card {
        margin-bottom: 1rem;
    }
}

/* Premium Danger and Warning Outline Buttons */
.btn-premium-danger-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1.5px solid var(--danger);
    border-radius: 10px;
    padding: 0.725rem 1.5rem;
    font-weight: 600;
    transition: all var(--transition-speed) ease;
}

.btn-premium-danger-outline:hover {
    background: var(--danger);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
    transform: translateY(-2px);
    color: #ffffff;
}

.btn-premium-warning-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1.5px solid var(--warning);
    border-radius: 10px;
    padding: 0.725rem 1.5rem;
    font-weight: 600;
    transition: all var(--transition-speed) ease;
}

.btn-premium-warning-outline:hover {
    background: var(--warning);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
    transform: translateY(-2px);
    color: #000000;
}

/* Premium Button Small sizing */
.btn-premium-outline.btn-sm, 
.btn-premium-danger-outline.btn-sm, 
.btn-premium-warning-outline.btn-sm {
    padding: 0.25rem 0.75rem !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
}

/* Hover Light Utility Class */
.hover-light:hover {
    color: var(--text-primary) !important;
}

/* Premium Real-time Toast Notifications */
.notification-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    max-width: calc(100vw - 48px);
}

.notification-toast {
    pointer-events: auto;
    display: flex;
    align-items: start;
    gap: 16px;
    background: rgba(18, 19, 26, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: 4px solid var(--success);
    border-radius: 14px;
    padding: 16px 20px;
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
    width: 360px;
    max-width: 100%;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

.notification-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.notification-toast.hide {
    transform: translateX(120%);
    opacity: 0;
}

.toast-icon-wrapper {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.toast-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #ffffff;
    margin: 0 0 3px 0;
    letter-spacing: 0.25px;
}

.toast-msg {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.toast-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0;
    margin-left: 10px;
    transition: color 0.2s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close-btn:hover {
    color: var(--text-primary);
}

/* Dress Variations Table Mobile & Layout Fixes */
#variationsTable, #editVariationsTable, .variations-table {
    min-width: 700px !important;
    table-layout: fixed;
    width: 100%;
}

#variationsTable th, #variationsTable td,
#editVariationsTable th, #editVariationsTable td,
.variations-table th, .variations-table td {
    padding: 8px 6px !important;
    vertical-align: middle;
}

/* Specific column widths */
#variationsTable th:nth-child(1), #variationsTable td:nth-child(1),
#editVariationsTable th:nth-child(1), #editVariationsTable td:nth-child(1),
.variations-table th:nth-child(1), .variations-table td:nth-child(1) {
    width: 130px; /* Color */
}

#variationsTable th:nth-child(2), #variationsTable td:nth-child(2),
#editVariationsTable th:nth-child(2), #editVariationsTable td:nth-child(2),
.variations-table th:nth-child(2), .variations-table td:nth-child(2) {
    width: 90px; /* Size */
}

#variationsTable th:nth-child(3), #variationsTable td:nth-child(3),
#editVariationsTable th:nth-child(3), #editVariationsTable td:nth-child(3),
.variations-table th:nth-child(3), .variations-table td:nth-child(3) {
    width: 110px; /* MRP */
}

#variationsTable th:nth-child(4), #variationsTable td:nth-child(4),
#editVariationsTable th:nth-child(4), #editVariationsTable td:nth-child(4),
.variations-table th:nth-child(4), .variations-table td:nth-child(4) {
    width: 110px; /* Selling Price */
}

#variationsTable th:nth-child(5), #variationsTable td:nth-child(5),
#editVariationsTable th:nth-child(5), #editVariationsTable td:nth-child(5),
.variations-table th:nth-child(5), .variations-table td:nth-child(5) {
    width: 200px; /* Image input */
}

#variationsTable th:nth-child(6), #variationsTable td:nth-child(6),
#editVariationsTable th:nth-child(6), #editVariationsTable td:nth-child(6),
.variations-table th:nth-child(6), .variations-table td:nth-child(6) {
    width: 60px; /* Action */
}

/* Compact form controls for variations table */
#variationsTable .form-control-premium,
#editVariationsTable .form-control-premium,
.variations-table .form-control-premium {
    padding: 0.4rem 0.6rem !important;
    font-size: 0.85rem !important;
    border-radius: 8px !important;
    height: auto !important;
}

/* Optional file input formatting inside table */
#variationsTable input[type="file"],
#editVariationsTable input[type="file"],
.variations-table input[type="file"] {
    font-size: 0.75rem !important;
    padding: 0.3rem 0.5rem !important;
}
/* Responsive polish layer */
@media (max-width: 1199.98px) {
    .admin-content {
        padding: 1.25rem !important;
    }

    .glass-card {
        border-radius: 12px;
    }

    .stat-card {
        min-height: 120px;
    }
}

@media (max-width: 991.98px) {
    .admin-wrapper {
        display: block;
        min-height: 100vh;
    }

    .admin-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(82vw, 300px);
        transform: translateX(-105%);
        z-index: 1050;
        overflow-y: auto;
        box-shadow: 16px 0 34px rgba(0, 0, 0, 0.45);
    }

    .admin-sidebar.show-sidebar {
        transform: translateX(0);
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.55);
        z-index: 1040;
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--transition-speed) ease;
    }

    .sidebar-overlay.show {
        opacity: 1;
        pointer-events: auto;
    }

    .admin-main {
        width: 100%;
        min-width: 0;
    }

    .admin-navbar {
        position: sticky;
        top: 0;
        z-index: 900;
        padding: 0.85rem 1rem !important;
        gap: 0.75rem;
    }

    .navbar-title {
        font-size: 1.1rem !important;
        line-height: 1.25;
    }

    .navbar-user {
        gap: 0.5rem;
    }

    .admin-content {
        padding: 1rem !important;
    }

    .row.g-4 {
        --bs-gutter-x: 1rem;
        --bs-gutter-y: 1rem;
    }

    .table-responsive {
        border-radius: 10px;
        border: 1px solid var(--border-color);
    }
}

@media (max-width: 767.98px) {
    body {
        font-size: 0.95rem;
    }

    .admin-navbar {
        flex-wrap: nowrap;
    }

    .navbar-user-avatar {
        width: 36px !important;
        height: 36px !important;
        flex: 0 0 36px;
    }

    .glass-card,
    .stat-card {
        padding: 1rem !important;
    }

    .stat-card {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 104px;
    }

    .stat-card h3,
    .stat-info h3 {
        font-size: 1.25rem !important;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    .stat-card p,
    .stat-info p {
        font-size: 0.78rem !important;
        margin-bottom: 0;
    }

    .stat-icon,
    .card-icon-btn {
        width: 42px !important;
        height: 42px !important;
        min-width: 42px;
        font-size: 1rem !important;
    }

    h1, .h1 {
        font-size: 1.45rem !important;
    }

    h2, .h2 {
        font-size: 1.25rem !important;
    }

    h3, .h3 {
        font-size: 1.15rem !important;
    }

    h4, .h4 {
        font-size: 1.05rem !important;
    }

    .btn,
    .form-control,
    .form-select,
    .input-group-text {
        min-height: 40px;
    }

    .btn-sm {
        min-height: 34px;
    }

    .d-flex.gap-2,
    .d-flex.gap-3 {
        flex-wrap: wrap;
    }

    form.d-flex,
    .input-group {
        min-width: 0;
    }

    .table {
        font-size: 0.84rem;
        white-space: nowrap;
    }

    .table td,
    .table th {
        padding: 0.7rem 0.75rem;
        vertical-align: middle;
    }

    .modal-dialog {
        margin: 0.75rem;
    }

    .modal-body {
        padding: 1rem !important;
    }

    .accordion-button {
        align-items: flex-start;
    }

    .list-group-item {
        gap: 0.75rem;
    }
}

@media (max-width: 575.98px) {
    .admin-content {
        padding: 0.75rem !important;
    }

    .admin-navbar {
        padding: 0.75rem !important;
    }

    .navbar-title {
        font-size: 1rem !important;
        max-width: 58vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .sidebar-brand {
        padding: 1.1rem 1rem;
    }

    .sidebar-item a {
        padding: 0.78rem 1rem;
    }

    .glass-card,
    .stat-card {
        border-radius: 10px;
    }

    .btn,
    .btn-premium,
    .btn-premium-outline {
        width: auto;
        max-width: 100%;
        white-space: normal;
        line-height: 1.2;
    }

    .w-100.btn,
    button.w-100,
    a.w-100 {
        width: 100% !important;
    }

    .form-control,
    .form-select {
        font-size: 16px !important;
    }

    .table-responsive {
        margin-left: -0.25rem;
        margin-right: -0.25rem;
    }

    .badge {
        white-space: normal;
        text-align: center;
        line-height: 1.25;
    }
}
