/* --- About Page & Leaderboard Styles --- */

/* Hero Section Improvements */
.hero-section {
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-4) var(--space-4) var(--space-6);
}

.hero-title {
    font-size: clamp(2rem, 4.5vw, 3.5rem);
    font-weight: var(--weight-black);
    line-height: 1.2;
    margin-bottom: var(--space-4);
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Main Grid Layout */
.about-grid {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr !important;
    gap: var(--space-6);
    align-items: start;
    max-width: 1200px;
    margin: var(--space-8) auto 0;
    padding: 0 var(--space-4);
}

/* Leaderboard Panel */
.leaderboard-panel {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    isolation: isolate;
    padding: var(--space-6);
    background: var(--bg-void);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: box-shadow 0.3s ease;
    height: fit-content;
}

.leaderboard-panel h2 {
    font-size: var(--text-3xl);
    font-weight: var(--weight-bold);
    margin-bottom: var(--space-4);
    line-height: 1.2;
}

.leaderboard-panel h2.text-flame {
    color: var(--accent-core);
    font-style: italic;
}

.leaderboard-header {
    margin-bottom: var(--space-6);
}

.leaderboard-header h2 {
    font-size: var(--text-3xl);
    font-weight: var(--weight-bold);
    margin: 0;
    line-height: 1.2;
}

.leaderboard-panel:hover {
    box-shadow: 0 12px 48px rgba(99, 102, 241, 0.2);
}

.leaderboard-panel::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    z-index: -2;
    background: radial-gradient(circle at 50% 50%,
            var(--accent-alpha),
            rgba(99, 102, 241, 0.1),
            var(--bg-void) 60%);
}

[data-theme="light"] .leaderboard-panel::before {
    background: radial-gradient(circle at 50% 50%,
            rgba(255, 136, 0, 0.1),
            rgba(99, 102, 241, 0.05),
            var(--bg-void) 70%);
}

.leaderboard-panel::after {
    content: "";
    position: absolute;
    inset: 1.5px;
    border-radius: inherit;
    z-index: -1;
    background: var(--bg-surface);
    backdrop-filter: blur(40px);
}

.leaderboard-panel>* {
    position: relative;
    z-index: 10;
}

/* Mission Panel */
.mission-panel {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    isolation: isolate;
    padding: var(--space-6);
    background: var(--bg-void);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: box-shadow 0.3s ease;
}

.mission-panel:hover {
    box-shadow: 0 12px 48px rgba(99, 102, 241, 0.2);
}

.mission-panel::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    z-index: -2;
    background: radial-gradient(circle at 50% 50%,
            var(--accent-alpha),
            rgba(99, 102, 241, 0.1),
            var(--bg-void) 60%);
}

[data-theme="light"] .mission-panel::before {
    background: radial-gradient(circle at 50% 50%,
            rgba(255, 136, 0, 0.1),
            rgba(99, 102, 241, 0.05),
            var(--bg-void) 70%);
}

.mission-panel::after {
    content: "";
    position: absolute;
    inset: 1.5px;
    border-radius: inherit;
    z-index: -1;
    background: var(--bg-surface);
    backdrop-filter: blur(40px);
}

.mission-panel>* {
    position: relative;
    z-index: 10;
}

/* Stat Cards */
.stat-card {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-5);
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: var(--space-3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.stat-card:last-child {
    margin-bottom: 0;
}

.stat-icon {
    font-size: var(--text-2xl);
    flex-shrink: 0;
}

.stat-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    font-weight: var(--weight-medium);
    margin-bottom: var(--space-1);
}

.stat-value {
    font-size: var(--text-2xl);
    font-weight: var(--weight-bold);
    font-family: var(--font-display);
    margin: 0;
    line-height: 1;
}

/* Mission Quote */
.mission-quote {
    text-align: center;
    margin-bottom: var(--space-10);
    padding: var(--space-8) var(--space-6);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.mission-quote::before {
    content: '"';
    position: absolute;
    top: var(--space-2);
    left: var(--space-4);
    font-size: 4rem;
    color: var(--accent-core);
    opacity: 0.3;
    font-family: serif;
    line-height: 1;
}

.mission-quote p {
    font-size: var(--text-lg);
    line-height: 1.7;
    margin: 0;
    position: relative;
    z-index: 1;
    font-style: italic;
    font-weight: var(--weight-medium);
    color: var(--text-primary);
}

/* Mission Phases Grid */
.mission-phases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-6);
    margin-top: var(--space-8);
}

.mission-phase {
    padding: var(--space-6);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
    text-align: center;
    backdrop-filter: blur(10px);
}

.mission-phase:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.3);
}

.phase-icon {
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: var(--radius-lg);
    margin: 0 auto var(--space-4);
    transition: all 0.3s ease;
}

.mission-phase:hover .phase-icon {
    transform: scale(1.1);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(118, 75, 162, 0.15) 100%);
}

.mission-phase h4 {
    font-size: var(--text-lg);
    font-weight: var(--weight-semibold);
    margin-bottom: var(--space-2);
    color: var(--text-primary);
    line-height: 1.3;
}

.mission-phase p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* Button Container */
.mission-button-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: var(--space-8);
    padding-top: var(--space-6);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    font-weight: var(--weight-bold);
    padding: var(--space-5) var(--space-8);
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    border: none;
    letter-spacing: 0.5px;
    font-size: var(--text-base);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: white !important;
    min-width: 180px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.6);
}

/* Achievements Section */
.achievements-section {
    margin-top: var(--space-16);
    padding: var(--space-12) 0;
}

.section-title {
    text-align: center;
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: var(--weight-bold);
    margin-bottom: var(--space-8);
    line-height: 1.3;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-8);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.achievement-card {
    text-align: center;
    padding: var(--space-8);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.achievement-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 36px rgba(99, 102, 241, 0.35);
    border-color: rgba(99, 102, 241, 0.5);
}

.achievement-icon {
    font-size: 3rem;
    margin-bottom: var(--space-4);
    display: inline-block;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 4px 8px rgba(99, 102, 241, 0.3));
}

.achievement-card:hover .achievement-icon {
    transform: scale(1.1);
}

.achievement-card h3 {
    font-size: var(--text-xl);
    margin-bottom: var(--space-3);
    color: var(--text-primary);
    font-weight: var(--weight-bold);
    position: relative;
    z-index: 1;
}

.achievement-card p {
    color: var(--text-secondary);
    font-size: var(--text-base);
    line-height: 1.6;
    position: relative;
    z-index: 1;
    margin: 0;
}

/* Timeline Section */
.timeline-section {
    margin-top: var(--space-16);
    padding: var(--space-12) 0;
}

.timeline {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding: var(--space-12) 0;
    isolation: isolate;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.8), rgba(99, 102, 241, 0.2));
    transform: translateX(-50%);
    border-radius: 2px;
    z-index: 2 !important;
}

.timeline-item {
    display: flex;
    align-items: center;
    margin-bottom: var(--space-16);
    position: relative;
}

.timeline-item:nth-child(odd) {
    flex-direction: row;
}

.timeline-item:nth-child(even) {
    flex-direction: row-reverse;
}

.timeline-marker {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: var(--weight-bold);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.6);
    flex-shrink: 0;
    position: relative;
    z-index: 3 !important;
    transition: transform 0.3s ease;
    border: 4px solid var(--bg-void);
}

.timeline-item:hover .timeline-marker {
    transform: scale(1.1);
}

.timeline-content {
    flex: 1;
    padding: var(--space-6);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    margin: 0 var(--space-8);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1 !important;
}

.timeline-content::before {
    content: '';
    position: absolute;
    top: 50%;
    width: 20px;
    height: 2px;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.5), transparent);
}

.timeline-item:nth-child(odd) .timeline-content::before {
    right: -28px;
    transform: translateY(-50%);
}

.timeline-item:nth-child(even) .timeline-content::before {
    left: -28px;
    transform: translateY(-50%) rotate(180deg);
}

.timeline-content:hover {
    transform: translateX(8px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
    border-color: rgba(99, 102, 241, 0.5);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(118, 75, 162, 0.08) 100%);
}

.timeline-item:nth-child(even) .timeline-content:hover {
    transform: translateX(-8px);
}

.timeline-content h3 {
    font-size: var(--text-xl);
    margin-bottom: var(--space-3);
    color: var(--text-primary);
    font-weight: var(--weight-bold);
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.timeline-content p {
    color: var(--text-secondary);
    font-size: var(--text-base);
    line-height: 1.6;
    margin: 0;
}

/* Tech Stack Section - Fixed Layout */
.tech-stack-section {
    margin-top: var(--space-16);
    padding: var(--space-12) 0;
    text-align: center;
}

.tech-stack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-8);
    max-width: 1000px;
    margin: var(--space-12) auto 0;
    padding: 0 var(--space-4);
}

.tech-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-6);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.tech-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-core), var(--accent-flame));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tech-item:hover::before {
    opacity: 1;
}

.tech-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.3);
    border-color: rgba(99, 102, 241, 0.4);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(118, 75, 162, 0.08) 100%);
}

.tech-logo {
    font-size: 2.5rem;
    margin-bottom: var(--space-4);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
}

.tech-item:hover .tech-logo {
    transform: scale(1.1);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(118, 75, 162, 0.15) 100%);
}

.tech-item span {
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
    color: var(--text-primary);
    text-align: center;
    line-height: 1.4;
}



/* Enhanced Animations */
.animate-enter {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.animate-enter.delay-200 {
    animation-delay: 0.2s;
}

.animate-enter.delay-400 {
    animation-delay: 0.4s;
}

.animate-enter.delay-600 {
    animation-delay: 0.6s;
}

.animate-enter.delay-800 {
    animation-delay: 0.8s;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .timeline::before {
        left: 30px;
    }

    .timeline-item {
        flex-direction: row !important;
        padding-left: 60px;
    }

    .timeline-marker {
        position: absolute;
        left: 0;
        margin: 0;
    }

    .timeline-content {
        margin: 0 0 0 var(--space-6);
    }

    .timeline-content::before {
        display: none;
    }

    .timeline-item:nth-child(even) .timeline-content:hover {
        transform: translateX(8px);
    }

    .tech-stack-grid {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: var(--space-6);
    }

    .tech-logo {
        width: 70px;
        height: 70px;
        font-size: 2.2rem;
    }
}

@media (max-width: 900px) {
    .tech-stack-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: var(--space-5);
    }

    .tech-item {
        padding: var(--space-5);
    }

    .tech-logo {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }

    .mission-quote {
        padding: var(--space-6) var(--space-4);
    }

    .mission-quote p {
        font-size: var(--text-base);
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: var(--space-5);
    }

    .hero-section {
        padding: var(--space-4) var(--space-4) var(--space-5);
    }

    .hero-title {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    .achievements-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: var(--space-6);
    }

    .mission-phases-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .section-title {
        font-size: var(--text-3xl);
    }
}

@media (max-width: 600px) {
    .tech-stack-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: var(--space-4);
    }

    .tech-item {
        padding: var(--space-4);
    }

    .tech-logo {
        width: 50px;
        height: 50px;
        font-size: 1.8rem;
    }

    .tech-item span {
        font-size: var(--text-sm);
    }

    .mission-phases-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .mission-quote {
        padding: var(--space-5) var(--space-6);
    }

    .mission-quote::before {
        font-size: 3rem;
        top: -5px;
        left: 5px;
    }

    .timeline-marker {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .timeline::before {
        left: 25px;
    }

    .timeline-content {
        margin-left: var(--space-6);
        padding: var(--space-4);
    }

    .achievements-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .stat-card {
        padding: var(--space-4);
        gap: var(--space-3);
    }

    .stat-icon {
        font-size: var(--text-xl);
    }

    .stat-value {
        font-size: var(--text-xl);
    }

    .leaderboard-panel,
    .mission-panel {
        padding: var(--space-5);
    }

    .btn-primary {
        padding: var(--space-4) var(--space-6);
        font-size: var(--text-sm);
        min-width: 150px;
    }
}

@media (max-width: 400px) {
    .tech-stack-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-3);
    }

    .tech-item {
        padding: var(--space-3);
    }

    .tech-logo {
        width: 45px;
        height: 45px;
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: var(--space-3) var(--space-3) var(--space-4);
    }

    .hero-title {
        font-size: clamp(1.8rem, 7vw, 2.5rem);
        margin-bottom: var(--space-4);
    }

    .hero-subtitle {
        font-size: var(--text-base);
    }

    .about-grid {
        margin-top: var(--space-6);
        gap: var(--space-4);
        padding: 0 var(--space-3);
    }

    .leaderboard-panel h2,
    .mission-panel h2 {
        font-size: var(--text-2xl);
    }

    .section-title {
        font-size: clamp(1.5rem, 5vw, 2rem);
        margin-bottom: var(--space-6);
    }

    .timeline-content h3 {
        font-size: var(--text-lg);
    }

    .achievement-card {
        padding: var(--space-6);
    }

    .achievement-icon {
        font-size: 2.5rem;
    }
}

/* Light Theme Adjustments */
[data-theme="light"] .stat-card {
    background: var(--bg-secondary);
    border-color: var(--border-light);
}

[data-theme="light"] .stat-card:hover {
    background: white;
    box-shadow: var(--shadow-md);
}

[data-theme="light"] .stat-label {
    color: var(--accent-success);
}

[data-theme="light"] .stat-value {
    color: var(--text-primary) !important;
}

[data-theme="light"] .mission-quote {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.08) 0%, transparent 100%);
    border-left-color: var(--accent-core);
}

[data-theme="light"] .mission-quote p {
    color: var(--text-primary);
}

[data-theme="light"] .mission-phase {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.6) 100%);
    border-color: var(--border-light);
}

[data-theme="light"] .achievement-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.6) 100%);
    border-color: var(--border-light);
}

[data-theme="light"] .timeline-content {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.6) 100%);
    border-color: var(--border-light);
}

/* ===============================================
   LARGE SCREENS (>1200px) - Modern Grid Layout
   =============================================== */
@media (min-width: 1201px) {

    /* Remove the centered vertical line for large screens */
    .timeline::before {
        display: none;
    }

    /* Create a 2x2 grid layout */
    .timeline {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-8);
        max-width: 1200px;
        padding: var(--space-8) var(--space-4);
    }

    /* Reset timeline items to normal flow */
    .timeline-item {
        display: block;
        margin-bottom: 0;
        position: relative;
    }

    /* Remove alternating layout */
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        flex-direction: unset;
    }

    /* Redesign marker as corner badge */
    .timeline-marker {
        position: absolute;
        top: -12px;
        left: -12px;
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
        box-shadow: 0 4px 16px rgba(99, 102, 241, 0.5);
        border: 3px solid var(--bg-void);
        z-index: 10;
    }

    /* Full-width content cards */
    .timeline-content {
        margin: 0;
        padding: var(--space-8);
        min-height: 180px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    /* Remove the connection lines */
    .timeline-content::before {
        display: none;
    }

    /* Adjust hover effects */
    .timeline-content:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 32px rgba(99, 102, 241, 0.35);
    }

    .timeline-item:nth-child(even) .timeline-content:hover {
        transform: translateY(-4px);
    }

    /* Enhanced typography for large screens */
    .timeline-content h3 {
        font-size: 1.5rem;
        margin-bottom: var(--space-4);
    }

    .timeline-content p {
        font-size: 1.05rem;
        line-height: 1.7;
    }
}