/*
 * Admin Panel Luxury Redesign
 * This file centralizes all styles for the admin panel.
 */

/* --- Variable Imports & Overrides ---
We can re-use variables from the main theme.css. Let's define some admin-specific ones.
*/
:root {
    --admin-bg: #111111; /* Deep Dark */
    --admin-surface: #1a1a1a; /* Slightly lighter surface */
    --admin-card-bg: #242424; /* Card background */
    --admin-border: #333333;
    --admin-text: #E0E0E0;
    --admin-text-muted: #888;
    --admin-gold: #e5b56e;
    --admin-blue: #4a90e2;
    --admin-success: #50e3c2;
    --admin-danger: #e35050;
    --admin-warning: #f5a623;
    --admin-info: #4a90e2;
    --sidebar-width: 260px;
    --sidebar-width-collapsed: 80px;
}

body.admin-body {
    background-color: var(--admin-bg);
    color: var(--admin-text);
    font-family: 'Vazirmatn', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

.admin-sidebar {
    width: var(--sidebar-width);
    background-color: var(--admin-surface);
    border-left: 1px solid var(--admin-border);
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
}

.admin-main-content {
    flex-grow: 1;
    padding: 2rem;
    margin-right: var(--sidebar-width);
    transition: margin-right 0.3s ease;
    background-color: var(--admin-bg);
}

/* Sidebar Header */
.sidebar-header {
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--admin-border);
}
.sidebar-header h2 a {
    color: var(--admin-gold);
    font-weight: 700;
    text-decoration: none;
    font-size: 1.8rem;
}
.sidebar-header h2 span {
    color: var(--admin-text);
}

/* Sidebar Navigation */
.admin-nav {
    padding: 1rem 0;
    list-style: none;
    flex-grow: 1;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: var(--admin-text-muted);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    border-right: 4px solid transparent;
}

.admin-nav-link i {
    font-size: 1.2rem;
    width: 30px;
    text-align: center;
    margin-left: 0.8rem;
}

.admin-nav-link:hover {
    background-color: var(--admin-bg);
    color: var(--admin-gold);
}

.admin-nav-link.active {
    color: var(--admin-gold);
    font-weight: 700;
    background-color: var(--admin-bg);
    border-right-color: var(--admin-gold);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--admin-border);
}
.sidebar-footer a {
    display: block;
    color: var(--admin-text-muted);
    text-decoration: none;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}
.sidebar-footer a:hover {
    color: var(--admin-gold);
}

/* --- Header Bar --- */
.admin-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: var(--admin-surface);
    border-bottom: 1px solid var(--admin-border);
    position: sticky;
    top: 0;
    z-index: 999;
    margin-bottom: 2rem;
}

#sidebar-toggle {
    background: none;
    border: none;
    color: var(--admin-text);
    font-size: 1.5rem;
    cursor: pointer;
}

.admin-header-title h1 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--admin-text);
}


/* --- Main Content Styling --- */

/* Cards */
.card {
    background-color: var(--admin-card-bg);
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.card-header {
    background-color: rgba(0,0,0,0.2);
    border-bottom: 1px solid var(--admin-border);
    font-weight: 600;
    color: var(--admin-text);
}

/* Stat Cards on Dashboard */
.stat-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    background-color: var(--admin-card-bg);
    border-radius: 12px;
    border: 1px solid var(--admin-border);
    transition: transform 0.3s, box-shadow 0.3s;
}
.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

.stat-card .icon {
    font-size: 2rem;
    padding: 1rem;
    border-radius: 50%;
    margin-left: 1rem;
    color: #fff;
}
.stat-card .icon.bg-primary { background-color: var(--admin-blue); }
.stat-card .icon.bg-warning { background-color: var(--admin-warning); }
.stat-card .icon.bg-success { background-color: var(--admin-success); }
.stat-card .icon.bg-danger { background-color: var(--admin-danger); }


.stat-card .stat-info p {
    margin: 0;
    color: var(--admin-text-muted);
}
.stat-card .stat-info h3 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: var(--admin-text);
}

/* Tables */
.table {
    border-color: var(--admin-border);
}
.table th {
    color: var(--admin-gold);
    font-weight: 600;
    border-bottom-width: 2px;
    border-color: var(--admin-border) !important;
}
.table td {
    color: var(--admin-text);
    vertical-align: middle;
}
.table-hover tbody tr:hover {
    background-color: var(--admin-surface);
    color: var(--admin-text);
}

/* Status Badges */
.status-badge {
    padding: 0.4em 0.8em;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #111;
}
.status-processing, .status-badge.bg-info { background-color: var(--admin-info); }
.status-shipped, .status-badge.bg-warning { background-color: var(--admin-warning); }
.status-completed, .status-badge.bg-success { background-color: var(--admin-success); }
.status-cancelled, .status-badge.bg-danger { background-color: var(--admin-danger); }
.status-pending, .status-badge.bg-secondary { background-color: var(--admin-text-muted); color: #fff; }


/* Forms */
.form-control, .form-select {
    background-color: var(--admin-surface);
    border-color: var(--admin-border);
    color: var(--admin-text);
    border-radius: 8px;
}
.form-control:focus, .form-select:focus {
    background-color: var(--admin-surface);
    border-color: var(--admin-gold);
    color: var(--admin-text);
    box-shadow: 0 0 0 0.2rem rgba(229, 181, 110, 0.2);
}

.btn-primary {
    background-color: var(--admin-gold);
    border-color: var(--admin-gold);
    color: #111;
    font-weight: 600;
}
.btn-primary:hover {
    background-color: #d4a55a;
    border-color: #d4a55a;
}

/* --- Responsive & Collapsed State --- */

@media (max-width: 992px) {
    .admin-sidebar {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        z-index: 1050; /* Above bootstrap backdrop */
        transition: right 0.4s ease;
    }
    .admin-sidebar.open {
        right: 0;
    }
    .admin-main-content {
        margin-right: 0;
    }
    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 1040;
        display: none;
    }
     .sidebar-backdrop.show {
        display: block;
    }
}

@media (min-width: 993px) {
    .admin-wrapper.sidebar-collapsed .admin-sidebar {
        width: var(--sidebar-width-collapsed);
    }
    .admin-wrapper.sidebar-collapsed .admin-main-content {
        margin-right: var(--sidebar-width-collapsed);
    }
    .admin-wrapper.sidebar-collapsed .admin-sidebar .sidebar-header h2 a {
        font-size: 1.5rem;
    }
     .admin-wrapper.sidebar-collapsed .admin-sidebar .sidebar-header h2 span,
     .admin-wrapper.sidebar-collapsed .admin-sidebar .admin-nav-link span,
     .admin-wrapper.sidebar-collapsed .admin-sidebar .sidebar-footer {
        display: none;
    }
    .admin-wrapper.sidebar-collapsed .admin-sidebar .admin-nav-link {
        justify-content: center;
    }
}
