/* ===================================
   Modern Layout Styles - Classroom System
   Created: Oct 2025
   Purpose: Beautiful sidebar & header design
   =================================== */

/* ============================================
   HEADER STYLES
   ============================================ */

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    height: 64px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}
.active {display: block;}
/* Header Left - Mobile Menu */
.header-left {
    display: flex;
    align-items: center;
    min-width: 60px;
}

.mobile-menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

.mobile-menu-toggle i {
    font-size: 1.25rem;
}

/* Header Center - Brand Logo */
.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.brand-logo:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.logo-container, .classroom-logo-container {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.logo-favicon, .classroom-favicon {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.brand-separator {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    margin: 0;
    line-height: 1;
    letter-spacing: -0.5px;
}

.page-title {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Header Right - Actions */
.header-right {
    display: flex;
    align-items: center;
    min-width: 250px;
    justify-content: flex-end;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn {
    position: relative;
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn i {
    font-size: 1.125rem;
}

.action-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid #667eea;
    box-shadow: 0 2px 8px rgba(245, 87, 108, 0.4);
    animation: pulse-badge 2s ease-in-out infinite;
}

.action-btn .badge:empty,
.action-btn .badge[data-count="0"] {
    display: none;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* User Dropdown */
.user-dropdown {
    position: relative;
    margin-left: 12px;
}

.user-dropdown.hidden {
    display: none;
}

.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px 6px 6px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.user-dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.user-dropdown-toggle .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid white;
    object-fit: cover;
}

.user-dropdown-toggle span {
    font-weight: 600;
    font-size: 0.9rem;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
}

.user-dropdown-menu[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #1f2937;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    background: transparent;
    border: none;
    width: 100%;
    cursor: pointer;
    text-align: left;
}

.dropdown-item:hover {
    background: #f3f4f6;
    color: #667eea;
}

.dropdown-item i {
    width: 18px;
    font-size: 1rem;
    color: #6b7280;
}

.dropdown-item:hover i {
    color: #667eea;
}

.dropdown-item.danger {
    color: #dc2626;
}

.dropdown-item.danger:hover {
    background: #fee2e2;
    color: #dc2626;
}

.dropdown-item.danger i {
    color: #dc2626;
}

.dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 8px 0;
}

/* ============================================
   SIDEBAR STYLES
   ============================================ */

.sidebar {
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 999;
    transition: all 0.3s ease;
}

.mobile-sidebar {
    transform: translateX(-100%);
}

/* Sidebar Header */
.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-dual-logos {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo, .sidebar-classroom-logo {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.sidebar-logo:hover, .sidebar-classroom-logo:hover {
    transform: scale(1.05) rotate(5deg);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.sidebar-logo img, .sidebar-classroom-logo img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.logo-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.sidebar-separator {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.875rem;
}

.sidebar-brand-text h1 {
    font-size: 1.375rem;
    font-weight: 700;
    color: white;
    margin: 0;
    line-height: 1.2;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-brand-text p {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 2px 0 0 0;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

.sidebar-close-btn {
    display: none;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: auto;
}

.sidebar-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 12px;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sidebar-nav-section {
    margin-bottom: 24px;
}

.sidebar-nav-header {
    padding: 0 12px 12px;
}

.sidebar-nav-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 0;
}

.sidebar-nav-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: transparent;
    border: none;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    width: 100%;
    text-align: left;
}

.sidebar-nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.sidebar-nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    transform: translateX(4px);
}

.sidebar-nav-item:hover::before {
    transform: scaleY(1);
}

.sidebar-nav-item.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.sidebar-nav-item.active::before {
    transform: scaleY(1);
}

.nav-item-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.sidebar-nav-item:hover .nav-item-icon,
.sidebar-nav-item.active .nav-item-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.nav-item-icon i {
    font-size: 1.125rem;
}

.nav-item-content {
    flex: 1;
}

.nav-item-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
}

.nav-item-desc {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
}

.sidebar-nav-item:hover .nav-item-desc,
.sidebar-nav-item.active .nav-item-desc {
    color: rgba(255, 255, 255, 0.7);
}

.nav-item-arrow {
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.sidebar-nav-item:hover .nav-item-arrow,
.sidebar-nav-item.active .nav-item-arrow {
    opacity: 1;
    transform: translateX(0);
}

.nav-item-arrow i {
    font-size: 0.875rem;
}

/* Sidebar Social Actions */
.sidebar-social-actions {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    gap: 8px;
    justify-content: space-around;
}

.social-btn {
    position: relative;
    width: 48px;
    height: 48px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.social-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.social-btn:active {
    transform: translateY(-2px);
}

.social-btn i {
    font-size: 1.125rem;
}

.social-btn .notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid #0f172a;
    box-shadow: 0 2px 8px rgba(245, 87, 108, 0.4);
}

.social-btn .notification-badge:empty,
.social-btn .notification-badge[data-count="0"] {
    display: none;
}

/* ============================================
   LANGUAGE SELECTOR
   ============================================ */

.language-selector {
    position: relative;
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.lang-toggle i {
    font-size: 1rem;
    animation: rotate-globe 3s linear infinite;
}

@keyframes rotate-globe {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.lang-toggle:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4),
                0 4px 15px rgba(118, 75, 162, 0.3);
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.lang-toggle:hover i {
    transform: scale(1.1) rotate(15deg);
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

@keyframes spin-globe {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#currentLang {
    font-weight: 700;
    text-transform: uppercase;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.mobile-sidebar {
        transform: translateX(-100%);
    }
    
    .brand-text {
        display: none;
    }
    
    .header-center {
        justify-content: flex-start;
        margin-left: 12px;
    }
    
    .brand-logo {
        padding: 8px 12px;
    }
}
    }
    
    .brand-name {
        font-size: 1.125rem;
    }
    
    .page-title {
        font-size: 0.7rem;
    }
@media (max-width: 768px) {
    .header-container {
        padding: 0 1rem;
        height: 56px;
    }
    
    .brand-name {
        font-size: 1.125rem;
    }
    
    .page-title {
        font-size: 0.7rem;
    }
    
    .logo-container,
    .classroom-logo-container {
        width: 32px;
        height: 32px;
    }
    
    .logo-favicon,
    .classroom-favicon {
        width: 24px;
        height: 24px;
    }
    
    .action-btn {
        width: 40px;
        height: 40px;
    }
    
    .action-btn i {
        font-size: 1rem;
    }
    
    .user-dropdown-toggle span {
        max-width: 80px;
        font-size: 0.85rem;
    }
    
    .brand-separator,
    .classroom-logo-container {
        display: none;
    }
    
    .header-actions {
        gap: 4px;
    }
    
    .action-btn {
        width: 36px;
        height: 36px;
    }
    
    .user-dropdown-toggle {
        padding: 4px 12px 4px 4px;
    }
    
    .user-dropdown-toggle .avatar {
        width: 32px;
        height: 32px;
    }
    
    .user-dropdown-toggle span {
        display: none;
    }
    
    .sidebar {
        width: 100%;
        max-width: 280px;
    }
    
    .desktop-only {
        display: none !important;
    }
    
    .lang-toggle {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
}
    


@keyframes slideOutLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

.sidebar.active {
    animation: slideInLeft 0.3s ease forwards;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.hidden {
    display: none !important;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .user-dropdown-menu {
        background: #1e293b;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .dropdown-item {
        color: rgba(255, 255, 255, 0.9);
    }
    
    .dropdown-item:hover {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .dropdown-divider {
        background: rgba(255, 255, 255, 0.1);
    }
}

/* ============================================
   LANGUAGE SELECTOR - UPDATED FIXED VERSION
   ============================================ */

.language-selector.desktop-only {
    position: fixed !important;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

.desktop-only .lang-toggle {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 60px;
    height: 60px;
    padding: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 700;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    animation: float-lang-btn 3s ease-in-out infinite;
    overflow: visible;
}

@keyframes float-lang-btn {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.desktop-only .lang-toggle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.4s ease;
    z-index: -1;
}

.desktop-only .lang-toggle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: ripple-lang-btn 2s ease-out infinite;
}

@keyframes ripple-lang-btn {
    0% {
        width: 100%;
        height: 100%;
        opacity: 0.8;
    }
    100% {
        width: 160%;
        height: 160%;
        opacity: 0;
    }
}

.desktop-only .lang-toggle:hover {
    transform: scale(1.15) rotate(5deg);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.6),
                0 0 0 8px rgba(102, 126, 234, 0.2),
                0 8px 25px rgba(118, 75, 162, 0.4);
    animation: none;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.desktop-only .lang-toggle:hover::before {
    transform: translate(-50%, -50%) scale(1);
}

.desktop-only .lang-toggle:active {
    transform: scale(0.95);
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.5);
}

.lang-toggle:active {
    transform: translateY(0) scale(1);
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.desktop-only .lang-toggle i {
    font-size: 1.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    position: relative;
    z-index: 1;
}

.desktop-only .lang-toggle:hover i {
    animation: spin-globe-btn 0.6s ease-in-out;
}

@keyframes spin-globe-btn {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.desktop-only #currentLang {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
    position: relative;
    z-index: 1;
}

/* Mobile Menu Toggle - Show only on mobile */
@media (max-width: 1024px) {
  .mobile-menu-toggle {
    display: flex !important;
    flex-direction: column;
    flex-wrap: nowrap;
    align-content: center;
    align-items: center;
    justify-content: center;
}
    .language-selector.desktop-only {
        display: none !important;
    }
}

/* Sidebar Mobile Behavior */
.mobile-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 998;
    backdrop-filter: blur(4px);
}

.mobile-sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-sidebar {
    position: fixed;
    transform: translateX(-100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-sidebar.active {
    transform: translateX(0);
    opacity: 1;
}
