/* 
    Dashboard Centralized Styles 
    Readify Premium Ecommerce Dashboard
*/

:root {
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --primary-color: #6366f1;
    --secondary-color: #a855f7;
    --bg-body: #f8f9fb;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-radius: 20px;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 30px rgba(0,0,0,0.06);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --sidebar-width: 280px;
    --header-height: 90px;
}

body {
    background-color: var(--bg-body);
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
}

/* --- DASHBOARD LAYOUT --- */
.dash-container {
    max-width: 1280px; /* Exact match with global layout */
    margin: 0 auto;
    padding: 0 15px;
}

.dashboard-layout {
    display: flex;
    gap: 30px; /* Gap between sidebar and content */
    padding: 40px 0 100px;
    animation: fadeIn 0.8s ease-out;
}

/* --- SIDEBAR --- */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    position: sticky;
    top: 100px; /* Aligned with 80px header + 20px gap */
    height: fit-content;
    background: #fff;
    border: 1px solid rgba(226, 232, 240, 0.6);
    border-radius: var(--border-radius);
    padding: 20px;
    z-index: 40; /* Lower than header (50) to prevent overlap */
    box-shadow: var(--shadow-md);
}

.sidebar-user {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 20px;
}

.user-avatar-wrapper {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    padding: 3px;
    background: var(--primary-gradient);
    margin: 0 auto 12px;
    position: relative;
}

.user-avatar-wrapper img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid #fff;
    object-fit: cover;
}

.user-avatar-wrapper .status-dot {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 14px;
    height: 14px;
    background: #22c55e;
    border: 2px solid #fff;
    border-radius: 50%;
}

.sidebar-user h5 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}

.sidebar-user p {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 0;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
}

.sidebar-menu::-webkit-scrollbar {
    width: 4px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 12px;
    margin-bottom: 5px;
    transition: var(--transition);
}

.menu-item i {
    width: 18px;
    height: 18px;
}

.menu-item:hover {
    background: #f1f5f9;
    color: var(--text-main);
    transform: translateX(5px);
}

.menu-item.active {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.2);
}

.logout-item {
    color: #ef4444;
    margin-top: auto;
    border-top: 1px solid #f1f5f9;
    padding-top: 15px;
}

.logout-item:hover {
    background: #fef2f2;
    color: #ef4444;
}

/* --- MAIN CONTENT --- */
.main-content {
    flex: 1;
    padding: 0; /* Padding handled by container and gap */
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- PREMIUM CARDS --- */
.premium-card {
    background: var(--card-bg);
    border: 1px solid rgba(226, 232, 240, 0.6);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: 30px;
}

/* --- ORDER CARDS (Specific for order.html) --- */
.order-card {
    padding: 25px;
    transition: var(--transition);
}

.order-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 20px;
}

.order-id {
    font-weight: 700;
    font-size: 15px;
}

.order-date {
    font-size: 13px;
    color: var(--text-muted);
}

.order-body {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

.order-product-img {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
    background: #f8fafc;
}

.order-product-info h5 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
}

.order-product-info p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 0;
}

.order-status-badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-delivered { background: #dcfce7; color: #15803d; }
.status-pending { background: #fef9c3; color: #854d0e; }
.status-cancelled { background: #fee2e2; color: #b91c1c; }

.order-timeline {
    margin-top: 20px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 12px;
}

/* --- BUTTONS --- */
.btn-premium {
    background: var(--primary-gradient);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
    color: #fff;
}

.btn-outline-premium {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
    padding: 8px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
}

.btn-outline-premium:hover {
    background: var(--primary-gradient);
    color: #fff;
    border-color: transparent;
}

/* --- RESPONSIVE --- */
@media (max-width: 992px) {
    .dashboard-layout {
        flex-direction: column;
        gap: 20px;
        padding: 20px 0 60px;
    }
    
    .sidebar {
        position: static;
        width: 100%;
        margin-bottom: 0;
        padding: 12px 16px;
        border-radius: 16px;
        box-shadow: var(--shadow-sm);
    }
    
    /* Hide the avatar card block on mobile to keep focus on tabs and content */
    .sidebar-user {
        display: none;
    }
    
    /* Make the menu items horizontal and scrollable! */
    .sidebar-menu {
        display: flex;
        flex-direction: row;
        gap: 8px;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Hide the scrollbar but keep scroll functionality */
    .sidebar-menu::-webkit-scrollbar {
        height: 4px;
    }
    .sidebar-menu::-webkit-scrollbar-thumb {
        background: #e2e8f0;
        border-radius: 4px;
    }
    
    .menu-item {
        display: inline-flex;
        margin-bottom: 0;
        padding: 8px 16px;
        font-size: 13px;
        border-radius: 100px;
        flex-shrink: 0;
    }
    
    .menu-item:hover {
        transform: none;
    }
    
    .logout-item {
        border-top: none;
        padding-top: 8px;
        margin-top: 0;
    }
    
    /* Stats Grid spacing */
    .stats-grid {
        padding: 16px;
        gap: 12px;
    }
    
    .stat-item {
        padding: 12px;
        gap: 10px;
    }
    
    .stat-icon {
        width: 36px;
        height: 36px;
    }
    
    .stat-content h4 {
        font-size: 15px;
    }
    
    /* General card padding spacing */
    .premium-card {
        margin-bottom: 20px;
    }
    
    .premium-card.p-4.p-lg-5 {
        padding: 16px !important;
    }
    
    .section-divider {
        margin: 24px 0 16px;
    }
    
    .section-divider h4 {
        font-size: 16px;
    }
}
