* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    padding: 0;
}

:root {
    /* Colors */
    --color-tech: #3B82F6;
    --color-tech-light: #60A5FA;
    --color-tech-dark: #2563EB;
    --color-business: #10B981;
    --color-business-light: #34D399;
    --color-business-dark: #059669;
    --color-engineering: #F59E0B;
    --color-engineering-light: #FBBF24;
    --color-engineering-dark: #D97706;
    --color-primary: #6366F1;
    --color-dark: #1F2937;
    --color-light: #F9FAFB;
    --color-white: #FFFFFF;
    --color-gray: #6B7280;
    
    /* Gradients */
    --gradient-main: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-tech: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    --gradient-business: linear-gradient(135deg, #10B981 0%, #059669 100%);
    --gradient-engineering: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    --gradient-hero: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', sans-serif;
    background: linear-gradient(to bottom, #f0f4f8, #ffffff);
    color: var(--color-dark);
    line-height: 1.7;
    overflow-x: hidden;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ===================================
   ANIMATIONS
   =================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
    }
    50% {
        box-shadow: 0 0 40px rgba(102, 126, 234, 0.8);
    }
}

.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
    opacity: 0;
}

/* ===================================
   LOGIN PAGE
   =================================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-main);
    position: relative;
    overflow: hidden;
}

.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.particles::before,
.particles::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite;
}

.particles::before {
    top: -100px;
    right: -100px;
}

.particles::after {
    bottom: -100px;
    left: -100px;
    animation-delay: 4s;
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 900px;
    padding: 2rem;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 30px;
    padding: 3rem;
    box-shadow: var(--shadow-2xl);
    animation: fadeIn 1s ease-out;
}

.login-header {
    text-align: center;
    margin-bottom: 3rem;
}

.logo-circle {
    width: 100px;
    height: 100px;
    background: var(--gradient-main);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.logo-circle i {
    font-size: 3rem;
    color: white;
}

.main-title {
    font-size: 2.5rem;
    font-weight: 900;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--color-gray);
    font-weight: 400;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    position: relative;
}

.input-group i {
    position: absolute;
    right: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-gray);
    font-size: 1.2rem;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 1rem 3.5rem 1rem 1.5rem;
    border: 2px solid #E5E7EB;
    border-radius: 15px;
    font-size: 1rem;
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s ease;
    background: white;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.selection-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-dark);
    margin-bottom: 1rem;
    text-align: center;
}

.specialty-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.specialty-card {
    position: relative;
    cursor: pointer;
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.specialty-card input[type=\"radio\"] {
    display: none;
}

.card-content {
    padding: 2rem 1rem;
    text-align: center;
    border: 3px solid #E5E7EB;
    border-radius: 20px;
    transition: all 0.3s ease;
    background: white;
}

.specialty-card i {
    font-size: 3rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.specialty-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--color-dark);
}

.specialty-card p {
    font-size: 0.9rem;
    color: var(--color-gray);
}

.check-icon {
    position: absolute;
    top: 10px;
    left: 10px;
    background: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.check-icon i {
    font-size: 1.2rem;
    color: white;
    margin: 0;
}

/* Tech Specialty */
.specialty-card.tech i {
    color: var(--color-tech);
}

.specialty-card.tech input[type=\"radio\"]:checked ~ .card-content {
    background: var(--gradient-tech);
    border-color: var(--color-tech);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.3);
}

.specialty-card.tech input[type=\"radio\"]:checked ~ .card-content h3,
.specialty-card.tech input[type=\"radio\"]:checked ~ .card-content p,
.specialty-card.tech input[type=\"radio\"]:checked ~ .card-content i {
    color: white;
}

.specialty-card.tech input[type=\"radio\"]:checked ~ .check-icon {
    opacity: 1;
    transform: scale(1);
    background: var(--color-tech-dark);
}

/* Business Specialty */
.specialty-card.business i {
    color: var(--color-business);
}

.specialty-card.business input[type=\"radio\"]:checked ~ .card-content {
    background: var(--gradient-business);
    border-color: var(--color-business);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
}

.specialty-card.business input[type=\"radio\"]:checked ~ .card-content h3,
.specialty-card.business input[type=\"radio\"]:checked ~ .card-content p,
.specialty-card.business input[type=\"radio\"]:checked ~ .card-content i {
    color: white;
}

.specialty-card.business input[type=\"radio\"]:checked ~ .check-icon {
    opacity: 1;
    transform: scale(1);
    background: var(--color-business-dark);
}

/* Engineering Specialty */
.specialty-card.engineering i {
    color: var(--color-engineering);
}

.specialty-card.engineering input[type=\"radio\"]:checked ~ .card-content {
    background: var(--gradient-engineering);
    border-color: var(--color-engineering);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(245, 158, 11, 0.3);
}

.specialty-card.engineering input[type=\"radio\"]:checked ~ .card-content h3,
.specialty-card.engineering input[type=\"radio\"]:checked ~ .card-content p,
.specialty-card.engineering input[type=\"radio\"]:checked ~ .card-content i {
    color: white;
}

.specialty-card.engineering input[type=\"radio\"]:checked ~ .check-icon {
    opacity: 1;
    transform: scale(1);
    background: var(--color-engineering-dark);
}

.btn-login {
    background: var(--gradient-main);
    color: white;
    border: none;
    padding: 1.2rem 2rem;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
    margin-top: 1rem;
}

.btn-login:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(102, 126, 234, 0.5);
}

.btn-login:active {
    transform: translateY(-1px);
}

/* ===================================
   TOP BAR
   =================================== */
.top-bar {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1001;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    margin: 0;
    width: 100%;
}

.menu-toggle {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--color-dark);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 8px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    z-index: 1004;
    position: relative;
}

.menu-toggle:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--color-primary);
}

.menu-toggle:active {
    background: rgba(99, 102, 241, 0.2);
    transform: scale(0.95);
}

.menu-toggle:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.menu-toggle.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--color-primary);
}

.menu-toggle.active i.fa-bars::before {
    content: "\f00d"; /* Change to X icon when active */
}

.menu-toggle i.fa-bars {
    transition: transform 0.3s ease;
}

.menu-toggle.active i.fa-bars {
    transform: rotate(90deg);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.competition-page-label {
    font-weight: 700;
    font-size: 1rem;
    color: var(--color-dark);
    letter-spacing: 0.5px;
}

/* ===================================
   SIDEBAR MENU
   =================================== */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1002;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px); /* Safari support */
    cursor: pointer;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile browsers */
    background: white;
    box-shadow: -2px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 1003;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
}

.sidebar-menu.active {
    transform: translateX(0);
    visibility: visible;
    opacity: 1;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #E5E7EB;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--gradient-main);
    color: white;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.3rem;
    font-weight: 900;
}

.sidebar-brand i {
    font-size: 1.8rem;
}

.sidebar-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 0;
}

.menu-section {
    margin-bottom: 2rem;
}

.menu-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 1.5rem;
    margin-bottom: 0.75rem;
}

.menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: var(--color-dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    border-right: 3px solid transparent;
}

.menu-link i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
    color: var(--color-gray);
    transition: all 0.3s ease;
}

.menu-link:hover,
.menu-link.active {
    background: rgba(99, 102, 241, 0.08);
    border-right-color: var(--color-primary);
    color: var(--color-primary);
}

.menu-link:hover i,
.menu-link.active i {
    color: var(--color-primary);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid #E5E7EB;
    background: var(--color-light);
}

.user-info-sidebar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--gradient-main);
    color: white;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: var(--shadow-md);
}

.user-info-sidebar i {
    font-size: 1.5rem;
}

/* ===================================
   NAVBAR (Desktop Only)
   =================================== */
.navbar {
    background: white;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    display: none;
    margin: 0;
    padding: 0;
}

@media (min-width: 1024px) {
    .navbar {
        display: block;
    }
    
    .top-bar {
        display: none;
    }
    
    /* Remove any body padding on desktop */
    body {
        padding-top: 0 !important;
    }
    
    /* Ensure admin dropdown menu is visible and styled */
    #adminDropdownMenu {
        display: none;
        position: absolute;
        top: 120%;
        inset-inline-end: 0;
        background: var(--card, white);
        border: 1px solid var(--border, #E5E7EB);
        border-radius: 10px;
        min-width: 220px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
        padding: 0.35rem;
        z-index: 1000;
        list-style: none;
        margin: 0;
        max-height: 80vh;
        overflow-y: auto;
    }
    
    #adminDropdownMenu[style*="block"] {
        display: block !important;
    }
    
    #adminDropdownToggle {
        display: inline-flex !important;
    }
    
    /* Ensure dropdown items are visible */
    #adminDropdownMenu li {
        display: block;
        margin: 0;
        padding: 0;
    }
    
    #adminDropdownMenu a {
        display: flex !important;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
        border-radius: 8px;
        color: var(--text, #111827);
        text-decoration: none;
        transition: all 0.2s ease;
        white-space: nowrap;
    }
    
    #adminDropdownMenu a:hover {
        background: rgba(99, 102, 241, 0.1);
        color: var(--primary, #6366F1);
    }
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--color-dark);
}

.nav-brand i {
    font-size: 1.8rem;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--nav-text);
    cursor: pointer;
}

.nav-toggle i { font-size: 1.4rem; }

#themeToggleBtn {
    display: none;
    background: transparent;
    border: none;
    color: var(--nav-text);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    text-decoration: none;
    color: var(--color-gray);
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 10px;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--color-primary);
    background: rgba(99, 102, 241, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--gradient-main);
    color: white;
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: var(--shadow-md);
}

.user-info i {
    font-size: 1.5rem;
}

/* ===================================
   HERO SECTION
   =================================== */
.hero-section {
    background: var(--gradient-hero);
    padding: 4rem 0;
    color: white;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    top: -200px;
    right: -200px;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.welcome-message {
    text-align: center;
    margin-bottom: 3rem;
}

.welcome-message h1 {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 600;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.hero-description {
    font-size: 1.2rem;
    opacity: 0.8;
    max-width: 700px;
    margin: 0 auto;
}

.specialties-showcase {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.specialty-box {
    background: white;
    border-radius: 25px;
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: var(--shadow-xl);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.specialty-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    transition: all 0.3s ease;
}

.specialty-box.tech::before {
    background: var(--gradient-tech);
}

.specialty-box.business::before {
    background: var(--gradient-business);
}

.specialty-box.engineering::before {
    background: var(--gradient-engineering);
}

.specialty-box:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-2xl);
}

.specialty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    transition: all 0.3s ease;
}

.specialty-box.tech .specialty-icon {
    background: var(--gradient-tech);
}

.specialty-box.business .specialty-icon {
    background: var(--gradient-business);
}

.specialty-box.engineering .specialty-icon {
    background: var(--gradient-engineering);
}

.specialty-box:hover .specialty-icon {
    transform: rotate(360deg) scale(1.1);
}

.specialty-box h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-dark);
    margin-bottom: 0.8rem;
}

.specialty-box p {
    color: var(--color-gray);
    font-size: 1rem;
    line-height: 1.6;
}

.specialty-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
}

.specialty-box.tech .specialty-badge {
    background: var(--gradient-tech);
}

.specialty-box.business .specialty-badge {
    background: var(--gradient-business);
}

.specialty-box.engineering .specialty-badge {
    background: var(--gradient-engineering);
}

/* ===================================
   QUICK LINKS SECTION
   =================================== */
.quick-links {
    padding: 5rem 0;
    background: white;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--color-dark);
    margin-bottom: 3rem;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.link-card {
    background: white;
    border: 2px solid #E5E7EB;
    border-radius: 20px;
    padding: 2.5rem 2rem;
    text-decoration: none;
    color: var(--color-dark);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.link-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-main);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 0;
}

.link-card:hover::before {
    opacity: 0.05;
}

.link-card:hover {
    transform: translateY(-5px);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-xl);
}

.link-icon {
    width: 70px;
    height: 70px;
    background: var(--gradient-main);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.link-icon i {
    font-size: 2rem;
    color: white;
}

.link-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    position: relative;
    z-index: 1;
}

.link-card p {
    color: var(--color-gray);
    font-size: 1rem;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

.arrow {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    width: 40px;
    height: 40px;
    background: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
}

.link-card:hover .arrow {
    transform: translateX(-5px);
    background: var(--gradient-main);
}

/* ===================================
   PAGE HEADER
   =================================== */
.page-header {
    background: var(--gradient-main);
    padding: 4rem 0 3rem;
    text-align: center;
    color: white;
}

.page-title {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 1rem;
}

.page-subtitle {
    font-size: 1.3rem;
    opacity: 0.9;
}

/* ===================================
   SPECIALTIES DETAILS
   =================================== */
.specialties-details {
    padding: 5rem 0;
    background: var(--color-light);
}

.specialty-detail {
    background: white;
    border-radius: 30px;
    padding: 3rem;
    margin-bottom: 3rem;
    box-shadow: var(--shadow-lg);
    border: 3px solid transparent;
    transition: all 0.3s ease;
}

.specialty-detail:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-2xl);
}

.specialty-detail.tech {
    border-color: var(--color-tech);
}

.specialty-detail.business {
    border-color: var(--color-business);
}

.specialty-detail.engineering {
    border-color: var(--color-engineering);
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.detail-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
}

.specialty-detail.tech .detail-icon {
    background: var(--gradient-tech);
}

.specialty-detail.business .detail-icon {
    background: var(--gradient-business);
}

.specialty-detail.engineering .detail-icon {
    background: var(--gradient-engineering);
}

.detail-title h2 {
    font-size: 2rem;
    font-weight: 900;
    color: var(--color-dark);
    margin-bottom: 0.5rem;
}

.specialty-tag {
    display: inline-block;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
}

.specialty-detail.tech .specialty-tag {
    background: var(--color-tech);
}

.specialty-detail.business .specialty-tag {
    background: var(--color-business);
}

.specialty-detail.engineering .specialty-tag {
    background: var(--color-engineering);
}

.detail-content {
    padding-right: 1rem;
}

.detail-description {
    font-size: 1.1rem;
    line-height: 1.9;
    color: var(--color-gray);
    margin-bottom: 2rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--color-light);
    border-radius: 15px;
    transition: all 0.3s ease;
}

.feature-item:hover {
    transform: translateX(-5px);
    background: rgba(99, 102, 241, 0.1);
}

.feature-item i {
    font-size: 1.5rem;
    color: var(--color-primary);
}

.feature-item span {
    font-weight: 600;
    color: var(--color-dark);
}

/* ===================================
   CHALLENGE INFO
   =================================== */
.challenge-info {
    padding: 5rem 0;
    background: var(--color-light);
}

.info-card {
    background: white;
    border-radius: 30px;
    padding: 3rem;
    margin-bottom: 3rem;
    box-shadow: var(--shadow-lg);
}

.main-card {
    border: 3px solid var(--color-primary);
}

.card-icon {
    width: 100px;
    height: 100px;
    background: var(--gradient-main);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    animation: pulse 2s ease-in-out infinite;
}

.card-icon i {
    font-size: 3rem;
    color: white;
}

.info-card h2 {
    text-align: center;
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--color-dark);
    margin-bottom: 3rem;
}

.steps-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.step {
    text-align: center;
    padding: 2rem;
    background: var(--color-light);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.step:hover {
    transform: translateY(-5px);
    background: rgba(99, 102, 241, 0.1);
}

.step-number {
    width: 60px;
    height: 60px;
    background: var(--gradient-main);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 900;
    margin: 0 auto 1.5rem;
    box-shadow: var(--shadow-md);
}

.step-content h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-dark);
    margin-bottom: 0.8rem;
}

.step-content p {
    color: var(--color-gray);
    font-size: 1rem;
    line-height: 1.6;
}

/* ===================================
   REWARDS SECTION
   =================================== */
.rewards-section {
    margin-bottom: 3rem;
}

.rewards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.reward-card {
    background: white;
    border-radius: 25px;
    padding: 3rem 2rem;
    box-shadow: var(--shadow-lg);
    border: 3px solid transparent;
    position: relative;
    transition: all 0.3s ease;
}

.reward-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-2xl);
}

.reward-card.first-place {
    border-color: #FFD700;
    background: linear-gradient(135deg, #FFF9E6 0%, #FFFFFF 100%);
}

.reward-card.second-place {
    border-color: #C0C0C0;
}

.reward-card.third-place {
    border-color: #CD7F32;
}

.medal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
}

.first-place .medal-icon {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
}

.second-place .medal-icon {
    background: linear-gradient(135deg, #C0C0C0 0%, #808080 100%);
}

.third-place .medal-icon {
    background: linear-gradient(135deg, #CD7F32 0%, #8B4513 100%);
}

.reward-card h3 {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--color-dark);
    margin-bottom: 2rem;
}

.reward-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.reward-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--color-light);
    border-radius: 12px;
}

.reward-item i {
    font-size: 1.3rem;
    color: var(--color-primary);
}

.reward-item span {
    font-weight: 600;
    color: var(--color-dark);
}

.place-badge {
    position: absolute;
    top: -15px;
    right: -15px;
    font-size: 4rem;
}

/* ===================================
   MOTIVATION BANNER
   =================================== */
.motivation-banner {
    background: var(--gradient-main);
    border-radius: 25px;
    padding: 3rem;
    text-align: center;
    color: white;
    box-shadow: var(--shadow-xl);
}

.banner-content i {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

.banner-content h3 {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 1rem;
}

.banner-content p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    background: white;
    color: var(--color-primary);
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

/* ===================================
   LEADERBOARD
   =================================== */
.leaderboard-section {
    padding: 5rem 0;
    background: var(--color-light);
}

.leaderboard-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.rank-card {
    background: white;
    border-radius: 30px;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    border: 3px solid transparent;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.rank-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-2xl);
}

.rank-card.rank-1 {
    border-color: #FFD700;
    background: linear-gradient(135deg, #FFF9E6 0%, #FFFFFF 100%);
}

.rank-card.tech {
    border-color: var(--color-tech);
}

.rank-card.business {
    border-color: var(--color-business);
}

.rank-card.engineering {
    border-color: var(--color-engineering);
}

.rank-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 60px;
    height: 60px;
    background: var(--gradient-main);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: white;
    font-weight: 900;
    box-shadow: var(--shadow-lg);
}

.rank-badge .rank-number {
    font-size: 1.8rem;
}

.rank-badge i {
    font-size: 1.2rem;
    margin-top: -5px;
}

.rank-content {
    padding-right: 6rem;
}

.rank-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.rank-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
}

.rank-card.tech .rank-icon {
    background: var(--gradient-tech);
}

.rank-card.business .rank-icon {
    background: var(--gradient-business);
}

.rank-card.engineering .rank-icon {
    background: var(--gradient-engineering);
}

.rank-info h2 {
    font-size: 2rem;
    font-weight: 900;
    color: var(--color-dark);
    margin-bottom: 0.3rem;
}

.rank-info p {
    color: var(--color-gray);
    font-size: 0.95rem;
}

.rank-stats {
    display: flex;
    gap: 3rem;
    margin-bottom: 1.5rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.stat-item i {
    font-size: 1.5rem;
    color: var(--color-primary);
}

.stat-value {
    font-size: 2rem;
    font-weight: 900;
    color: var(--color-dark);
    margin-left: 0.5rem;
}

.stat-label {
    color: var(--color-gray);
    font-size: 0.95rem;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #E5E7EB;
    border-radius: 50px;
    overflow: hidden;
    margin-bottom: 0.8rem;
}

.progress-fill {
    height: 100%;
    border-radius: 50px;
    transition: width 1s ease-out;
    position: relative;
}

.progress-fill.tech {
    background: var(--gradient-tech);
}

.progress-fill.business {
    background: var(--gradient-business);
}

.progress-fill.engineering {
    background: var(--gradient-engineering);
}

.progress-text {
    color: var(--color-gray);
    font-size: 0.9rem;
    font-weight: 600;
}

.trophy-icon {
    position: absolute;
    top: 50%;
    left: 30px;
    transform: translateY(-50%);
    font-size: 6rem;
    opacity: 0.1;
}

/* ===================================
   STATS SUMMARY
   =================================== */
.stats-summary {
    background: white;
    border-radius: 25px;
    padding: 3rem;
    box-shadow: var(--shadow-lg);
    margin-top: 3rem;
}

.stats-summary h3 {
    text-align: center;
    font-size: 2rem;
    font-weight: 900;
    color: var(--color-dark);
    margin-bottom: 2.5rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.summary-item {
    text-align: center;
    padding: 2rem 1rem;
    background: var(--color-light);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.summary-item:hover {
    transform: translateY(-5px);
    background: rgba(99, 102, 241, 0.1);
}

.summary-item i {
    font-size: 3rem;
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.summary-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--color-dark);
    margin-bottom: 0.5rem;
}

.summary-label {
    display: block;
    color: var(--color-gray);
    font-size: 0.95rem;
    font-weight: 600;
}

/* ===================================
   BACK BUTTON
   =================================== */
.back-button-container {
    text-align: center;
    margin-top: 3rem;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    background: var(--gradient-main);
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.btn-back:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

/* ===================================
   FOOTER
   =================================== */
.footer {
    background: var(--color-dark);
    color: white;
    padding: 2.5rem 0;
    text-align: center;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-brand i {
    font-size: 1.5rem;
    color: var(--color-primary);
}

.footer-copyright {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

/* Mobile First Approach */
@media (max-width: 767px) {
    .container {
        padding: 0 1rem;
    }
    
    .hero-section {
        padding: 2rem 0;
    }
    
    .welcome-message h1 {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .specialties-showcase {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 1rem;
    }
    
    .links-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .specialties-details {
        padding: 3rem 0;
    }
    
    .specialty-detail {
        padding: 2rem 1.5rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .rewards-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .steps-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .activities-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .page-subtitle {
        font-size: 1.1rem;
    }
    
    .rank-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .top-bar {
        padding: 0.75rem 1rem;
    }
    
    .competition-page-label {
        font-size: 0.9rem;
    }
    
    .sidebar-menu {
        width: 300px;
        max-width: 90vw;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1023px) {
    .specialties-showcase {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .links-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .rewards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .steps-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .activities-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop */
@media (min-width: 1024px) {
    body {
        padding-top: 0;
    }
    
    .specialties-showcase {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .links-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .rewards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .steps-container {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .summary-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .dashboard-stats {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .activities-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

/* Large Desktop */
@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
    }
}

/* Fix for body padding on mobile when sidebar is open */
body.sidebar-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Ensure proper spacing for content below top bar on mobile */
@media (max-width: 1023px) {
    body {
        padding-top: 0;
    }
    
    .page-header {
        margin-top: 0;
    }
    
    .hero-section {
        margin-top: 0;
    }
    
    /* Ensure top bar is at the very top */
    .top-bar {
        margin: 0;
        top: 0;
    }
}

/* Fix sidebar scrollbar styling */
.sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Smooth scrolling */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* Touch-friendly buttons on mobile */
@media (max-width: 767px) {
    button,
    .btn,
    .menu-link,
    .nav-menu a {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Ensure proper touch targets */
    .menu-toggle {
        min-width: 44px;
        min-height: 44px;
    }
    
    .sidebar-close {
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Improve spacing */
    .top-bar {
        padding: 0.75rem 1rem;
    }
    
    .sidebar-header {
        padding: 1.25rem 1rem;
    }
    
    .menu-link {
        padding: 1rem 1.25rem;
    }
}

/* Improve readability on small screens */
@media (max-width: 767px) {
    body {
        font-size: 16px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
    /* Ensure proper text wrapping */
    .competition-page-label {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 200px;
    }
}

/* Prevent horizontal scroll on mobile */
@media (max-width: 767px) {
    html, body {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    * {
        max-width: 100%;
    }
}

/* Ensure sidebar doesn't cause layout shift */
@media (max-width: 1023px) {
    .sidebar-menu {
        will-change: transform;
    }
}

/* Smooth transitions for better UX */
@media (prefers-reduced-motion: no-preference) {
    .sidebar-menu,
    .sidebar-overlay,
    .menu-link {
        transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    }
}

