/* === SIDEBAR STYLES === */

.container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Sidebar */
.sidebar {
    width: 200px; /* Reduced from 280px */
    background: linear-gradient(135deg, rgba(255, 248, 220, 0.95), rgba(254, 243, 199, 0.95));
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(251, 191, 36, 0.3);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transition: all 0.3s ease;
    overflow: hidden;
    transform: translateX(0);
    display: flex;
    flex-direction: column;
}

/* Mobile menu toggle button */
.mobile-menu-toggle {
    display: none; /* Hidden by default, shown on mobile */
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-600);
    z-index: 1001;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.sidebar.collapsed {
    width: 50px; /* Reduced from 60px */
    transform: translateX(0);
}

.sidebar.collapsed .sidebar-content {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-20px);
}

.sidebar.collapsed .sidebar-toggle {
    right: 10px;
    transform: translateY(-50%) rotate(180deg);
    min-width: 40px;
    height: 36px;
    padding: 6px 12px;
}

/* Increase touch target size for sidebar links */
.sidebar-link {
    display: flex;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md); /* Reduced padding */
    color: #92400e;
    text-decoration: none;
    transition: var(--transition-fast);
    border-left: 3px solid transparent;
    position: relative;
    font-weight: 500;
    min-height: 40px; /* Reduced from 44px */
}

.sidebar-content {
    transition: var(--transition-normal);
    opacity: 1;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: var(--spacing-md); /* Reduced padding */
    border-bottom: 1px solid rgba(251, 191, 36, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.sidebar-header h2 {
    color: #d97706;
    font-size: 1.3rem; /* Reduced from 1.5rem */
    font-weight: 700;
    margin: 0;
}

.sidebar-toggle {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border: none;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: absolute;
    right: -25px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
    min-width: 50px;
    height: 40px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    transform: translateY(-50%) scale(1.1);
    box-shadow: var(--shadow-md);
}

.sidebar.collapsed .sidebar-toggle {
    right: -20px;
}

/* Sidebar Navigation */
.sidebar-nav {
    padding: var(--spacing-md) 0; /* Reduced padding */
    overflow-y: auto;
    flex: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md); /* Reduced padding */
    color: #92400e;
    text-decoration: none;
    transition: var(--transition-fast);
    border-left: 3px solid transparent;
    position: relative;
    font-weight: 500;
}

.sidebar-link:hover {
    background: rgba(251, 191, 36, 0.15);
    color: #d97706;
    border-left-color: #fbbf24;
}

.sidebar-link.active {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(245, 158, 11, 0.15));
    color: #d97706;
    border-left-color: #f59e0b;
    font-weight: 600;
}

.sidebar-link .icon {
    font-size: 1.2rem;
    margin-right: var(--spacing-sm); /* Reduced margin */
    width: 24px;
    text-align: center;
}

.sidebar-link .text {
    font-weight: 500;
    font-size: 0.9rem; /* Reduced font size */
}

/* Sidebar Actions */
.sidebar-actions {
    padding: var(--spacing-md) var(--spacing-md); /* Reduced padding */
    border-top: 1px solid rgba(251, 191, 36, 0.3);
    border-bottom: 1px solid rgba(251, 191, 36, 0.3);
}

.sidebar-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: var(--spacing-xs) var(--spacing-sm); /* Reduced padding */
    margin-bottom: var(--spacing-xs);
    background: linear-gradient(135deg, rgba(255, 248, 220, 0.8), rgba(254, 243, 199, 0.8));
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: var(--radius-md);
    color: #92400e;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem; /* Reduced font size */
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-sm);
    min-height: 40px; /* Reduced from 44px */
}

.sidebar-btn:hover {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(245, 158, 11, 0.15));
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    color: #d97706;
}



.sidebar-btn .icon {
    font-size: 1.1rem;
    margin-right: var(--spacing-sm); /* Reduced margin */
    width: 20px;
    text-align: center;
}

.sidebar-btn .text {
    font-size: 0.9rem;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: var(--spacing-md); /* Reduced padding */
    margin-top: auto;
    flex-shrink: 0;
}

.ad-sidebar {
    background: linear-gradient(45deg, #fff8dc, #ffe4e1);
    border: 1px solid #ffd1dc;
    padding: var(--spacing-sm); /* Reduced padding */
    border-radius: var(--radius-lg);
    text-align: center;
    font-weight: 600;
    color: #d35400;
    font-size: 0.9rem; /* Reduced font size */
    box-shadow: var(--shadow-sm);
    animation: gentle-glow 2s ease-in-out infinite alternate;
}

/* Main Layout */
.main-layout {
    flex: 1;
    margin-left: 200px; /* Updated to match new sidebar width */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-layout .header {
    background: linear-gradient(135deg, rgba(255, 248, 220, 0.95), rgba(254, 243, 199, 0.95));
    backdrop-filter: blur(10px);
    padding: var(--spacing-md); /* Reduced padding */
    border-bottom: 1px solid rgba(251, 191, 36, 0.3);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.main-layout .header h1 {
    font-size: 2.2rem; /* Reduced from 2.5rem */
    font-weight: 700;
    color: var(--gray-800); /* Changed from gradient to solid color */
    margin-bottom: var(--spacing-md); /* Reduced margin */
}

.main-layout .main-content {
    flex: 1;
    padding: var(--spacing-md); /* Reduced padding */
    background: transparent;
    backdrop-filter: none;
    border-radius: 0;
    box-shadow: none;
    border: none;
    position: relative;
    z-index: 1;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, rgba(255, 248, 220, 0.95), rgba(254, 243, 199, 0.95));
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(251, 191, 36, 0.3);
    padding: var(--spacing-md); /* Reduced padding */
    text-align: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.footer-content {
    margin-top: var(--spacing-md); /* Reduced margin */
}

.footer-content p {
    color: var(--gray-600);
    font-size: 0.9rem; /* Reduced font size */
    margin: 0;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 180px; /* Reduced from 250px */
    }
    
    .main-layout {
        margin-left: 180px; /* Updated to match new sidebar width */
    }
    
    .main-layout .header h1 {
        font-size: 2rem; /* Reduced from 2.2rem */
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 200px; /* Reduced from 280px */
        box-shadow: 2px 0 15px rgba(0, 0, 0, 0.2);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-toggle {
        display: none;
    }
    
    .main-layout {
        margin-left: 0;
    }
    
    .main-layout .header {
        padding: var(--spacing-md);
        position: relative;
        padding-left: 60px; /* Space for hamburger menu */
    }
    
    .mobile-menu-toggle {
        display: block !important;
        position: absolute;
        left: var(--spacing-md);
        top: 50%;
        transform: translateY(-50%);
        font-size: 1.5rem;
        cursor: pointer;
        color: var(--gray-600);
        z-index: 1001;
        background: linear-gradient(135deg, #fbbf24, #f59e0b);
        border: none;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        transition: all 0.3s ease;
    }
    
    .mobile-menu-toggle:hover {
        background: linear-gradient(135deg, #f59e0b, #d97706);
        transform: translateY(-50%) scale(1.1);
    }
    
    .main-layout .header h1 {
        font-size: 1.8rem;
        text-align: center;
        margin-left: 0;
    }
    
    .main-layout .main-content {
        padding: var(--spacing-md);
    }
    
    .footer {
        padding: var(--spacing-md);
    }
    
    /* Fix for sidebar overlay */
    .sidebar-overlay {
        display: block;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    
    .sidebar-overlay.active {
        opacity: 1;
        pointer-events: all;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 100%;
    }
    
    .main-layout .header h1 {
        font-size: 1.5rem;
        margin-left: 0;
    }
    
    .main-layout .main-content {
        padding: var(--spacing-sm); /* Reduced padding */
    }
    
    .sidebar-header {
        padding: var(--spacing-sm); /* Reduced padding */
    }
    
    .sidebar-nav {
        padding: var(--spacing-sm) 0; /* Reduced padding */
    }
    
    .sidebar-link {
        padding: 15px var(--spacing-md); /* Reduced padding */
        font-size: 1rem; /* Reduced from 1.1rem */
        min-height: 40px; /* Reduced from 44px */
    }
    
    .sidebar-link .icon {
        font-size: 1.2rem; /* Reduced from 1.4rem */
        width: 25px;
    }
    
    .sidebar-actions {
        padding: var(--spacing-sm) var(--spacing-sm); /* Reduced padding */
    }
    
    .sidebar-btn {
        padding: 12px var(--spacing-sm); /* Reduced padding */
        font-size: 0.9rem; /* Reduced font size */
        margin-bottom: var(--spacing-xs);
        min-height: 40px; /* Reduced from 44px */
    }
    
    .sidebar-footer {
        padding: var(--spacing-sm) var(--spacing-sm); /* Reduced padding */
    }
}

/* Overlay for mobile */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
    pointer-events: all;
}

/* Animation for sidebar toggle */
@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-100%);
    }
}

.sidebar.slide-in {
    animation: slideIn 0.3s ease-out;
}

.sidebar.slide-out {
    animation: slideOut 0.3s ease-out;
}