/**
 * Main Stylesheet for EYA Platform
 * Global styles for the entire platform
 */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4F46E5;
    --secondary-color: #7C3AED;
    --success-color: #10B981;
    --danger-color: #EF4444;
    --warning-color: #F59E0B;
    --info-color: #3B82F6;
    --text-color: #1F2937;
    --text-light: #6B7280;
    --bg-color: #FFFFFF;
    --bg-light: #F9FAFB;
    --border-color: #E5E7EB;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-light);
    line-height: 1.6;
}

/* ============================================
   Premium Header Styles - Desktop First
   ============================================ */
.main-header {
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

.header-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
}

.header-brand {
    display: flex;
    align-items: center;
}

.header-logo {
    height: 36px;
    width: auto;
    display: block;
}

.brand-content {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.brand-tagline {
    font-size: 0.6875rem;
    color: var(--text-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-color);
    transition: all 0.2s ease;
    border-radius: 0.5rem;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
}

.mobile-menu-toggle:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.mobile-menu-toggle .close-icon {
    display: none;
}

.mobile-menu-toggle[aria-expanded="true"] .menu-icon {
    display: none;
}

.mobile-menu-toggle[aria-expanded="true"] .close-icon {
    display: block;
}

/* Header Right - User Menu */
.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.75rem;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.user-menu:hover {
    background: var(--bg-light);
}

.user-menu:hover .user-menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

.avatar-text {
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}

.user-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: capitalize;
    font-weight: 500;
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    z-index: 1001;
    padding: 0.5rem;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.menu-item:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.menu-item svg {
    flex-shrink: 0;
}

.menu-item-danger {
    color: var(--danger-color);
}

.menu-item-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

/* App Container */
.app-container {
    display: flex;
    min-height: calc(100vh - 72px);
    position: relative;
}

/* ============================================
   Premium Sidebar Styles - Desktop First
   ============================================ */
.sidebar {
    width: 280px;
    background: var(--bg-color);
    border-right: 1px solid var(--border-color);
    position: sticky;
    top: 72px;
    height: calc(100vh - 72px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-self: flex-start;
    flex-shrink: 0;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

.sidebar-overlay.active {
    opacity: 1;
}

.sidebar-content {
    padding: 1.5rem 0;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    /* Custom scrollbar styling for webkit browsers */
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-light);
}

.sidebar-nav {
    padding: 0;
    position: relative;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    margin: 0;
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1.5rem;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: 0;
    margin: 0 0.75rem;
    border-radius: 0.5rem;
}

.nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 0 2px 2px 0;
    transition: height 0.2s ease;
}

.nav-link:hover {
    background: var(--bg-light);
    color: var(--primary-color);
    transform: translateX(2px);
}

.nav-link:hover::before {
    height: 60%;
}

.nav-item.active .nav-link {
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.08) 0%, rgba(124, 58, 237, 0.08) 100%);
    color: var(--primary-color);
    font-weight: 600;
}

.nav-item.active .nav-link::before {
    height: 100%;
    border-radius: 0 2px 2px 0;
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: currentColor;
    transition: transform 0.2s ease;
}

.nav-link:hover .nav-icon {
    transform: scale(1.1);
}

.nav-item.active .nav-icon {
    color: var(--primary-color);
}

.nav-label {
    flex: 1;
    line-height: 1.5;
    letter-spacing: -0.01em;
}

.nav-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.nav-empty {
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Main Content */
.content {
    flex: 1;
    padding: 2.5rem;
    background-color: var(--bg-light);
    min-height: calc(100vh - 72px);
    overflow-x: hidden;
}

/* Footer Styles */
.main-footer {
    background-color: var(--bg-color);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-copyright {
    color: var(--text-light);
    font-size: 0.875rem;
}

.footer-nav {
    display: flex;
    gap: 1.5rem;
}

.footer-link {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.footer-link:hover {
    color: var(--primary-color);
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-light);
}

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }

/* Common Page Header Gradient */
.page-header-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 1rem;
    padding: 2rem;
    color: white;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: white;
}

.page-subtitle {
    font-size: 1.2rem;
    margin: 0;
    opacity: 0.95;
}

/* Common Section Styles */
.dashboard-section {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin-bottom: 1.5rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .main-header {
        padding: 1rem 1.5rem;
    }
    
    .content {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 0 1rem;
        height: 64px;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .header-left {
        gap: 1rem;
    }
    
    .brand-name {
        font-size: 1.125rem;
    }
    
    .brand-tagline {
        font-size: 0.625rem;
    }
    
    .user-details {
        display: none;
    }
    
    .user-menu-dropdown {
        right: -1rem;
    }
    
    /* Sidebar Mobile Styles */
    .sidebar {
        position: fixed;
        top: 64px;
        left: 0;
        height: calc(100vh - 64px);
        width: 280px;
        max-width: 85vw;
        z-index: 999;
        transform: translateX(-100%);
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.15);
        border-right: 1px solid var(--border-color);
        min-height: calc(100vh - 64px);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-overlay {
        display: block;
        top: 64px;
    }
    
    .app-container {
        flex-direction: column;
    }
    
    .content {
        padding: 1.5rem;
        width: 100%;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .page-subtitle {
        font-size: 1rem;
    }
}

@media (max-width: 640px) {
    .main-header {
        padding: 0.75rem;
    }
    
    .header-title {
        font-size: 1.125rem;
    }
    
    .sidebar {
        width: 100%;
        max-width: 100vw;
    }
    
    .content {
        padding: 0.75rem;
    }
    
    .page-title {
        font-size: 1.75rem;
    }
}
