/**
 * Results Dashboard Styling - Immersive AI Galaxy Theme
 * Futuristic, High-Contrast, Premium Performance
 */

:root {
    --primary-glow: 0 0 30px rgba(0, 128, 255, 0.4);
    --secondary-glow: 0 0 30px rgba(0, 255, 255, 0.4);
    --gold-glow: 0 0 40px rgba(255, 215, 0, 0.3);

    /* Score Tiers */
    --score-low: #ff3333;
    /* Red */
    --score-mid-low: #ff8800;
    /* Orange */
    --score-mid: #ffcc00;
    /* Yellow */
    --score-high: #00ff88;
    /* Light Green */
    --score-elite: #00ffff;
    /* Cyan/Neon */
}

/* Base Container & Scroll Snap */
.hackathon-results-container {
    background: #050508;
    color: #ffffff;
    font-family: 'Inter', -apple-system, sans-serif;
    height: 100vh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    position: relative;
    scrollbar-width: none;
    -ms-overflow-style: none;
    overflow-x: hidden;
    /* Prevent horizontal side-scrolling */
    width: 100%;
}

.hackathon-results-container::-webkit-scrollbar {
    display: none;
    /* Hide for Chrome/Safari */
}

/* Galaxy Background Layer */
.galaxy-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.stars-layer-1,
.stars-layer-2 {
    position: absolute;
    width: 200%;
    height: 200%;
    background-image:
        radial-gradient(1px 1px at 25% 10%, #fff 50%, transparent),
        radial-gradient(1.5px 1.5px at 50% 25%, #fff 50%, transparent),
        radial-gradient(1px 1px at 75% 40%, #fff 50%, transparent),
        radial-gradient(2px 2px at 15% 65%, #fff 50%, transparent),
        radial-gradient(1.5px 1.5px at 85% 85%, #fff 50%, transparent);
    background-size: 400px 400px;
    opacity: 0.3;
}

.stars-layer-1 {
    animation: rotateGalaxy 150s linear infinite;
}

.stars-layer-2 {
    animation: rotateGalaxy 100s linear infinite reverse;
    opacity: 0.2;
}

@keyframes rotateGalaxy {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.nebula-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 80% 20%, rgba(0, 128, 255, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 20% 80%, rgba(128, 0, 255, 0.1) 0%, transparent 40%);
    filter: blur(80px);
}

/* AI Intellectual Layer - Subtle Background Tags */
.ai-intel-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    opacity: 0.8;
}

.ai-tag {
    position: absolute;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.12);
    /* Extremely subtle */
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 300;
    white-space: nowrap;
    text-shadow: 0 0 10px rgba(0, 128, 255, 0.2);
    user-select: none;
}

/* Floating Animations for Tags */
@keyframes floatTag1 {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(20px, -30px);
    }
}

@keyframes floatTag2 {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(-25px, 20px);
    }
}

@keyframes floatTag3 {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(15px, 15px);
    }
}

.tag-v1 {
    animation: floatTag1 15s ease-in-out infinite;
}

.tag-v2 {
    animation: floatTag2 18s ease-in-out infinite;
}

.tag-v3 {
    animation: floatTag3 12s ease-in-out infinite;
}

@media (max-width: 768px) {
    .ai-intel-layer {
        display: none;
    }

    /* Hide on mobile to keep focus on simple UI */
}

/* Slide Commons */
.results-page-slide {
    height: 100vh;
    width: 100%;
    scroll-snap-align: center;
    /* Better anchoring in the middle of the viewport */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    padding: 60px 20px;
    /* Increased from 40px to give more top/bottom room */
    box-sizing: border-box;
}

.slide-inner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* Safety: prioritize top visibility if content overflows */
    align-items: center;
    height: 100%;
    box-sizing: border-box;
    position: relative;
    overflow-y: auto;
    /* Allow internal scrolling if content is taller than viewport */
    scrollbar-width: none;
}

.slide-inner::-webkit-scrollbar {
    display: none;
}

/* Centering wrapper that allows overflow to push down, not up */
.slide-content-wrapper {
    width: 100%;
    margin-top: auto;
    margin-bottom: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Slide 1: Overview Styles */
.live-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(255, 0, 80, 0.1);
    border: 1px solid rgba(255, 0, 80, 0.4);
    border-radius: 50px;
    color: #ff0050;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 25px;
    box-shadow: 0 0 20px rgba(255, 0, 80, 0.2);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: #ff0050;
    border-radius: 50%;
    animation: counterPulse 1.5s infinite;
}

@keyframes counterPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 0, 80, 0.7);
    }

    70% {
        transform: scale(1.2);
        box-shadow: 0 0 0 10px rgba(255, 0, 80, 0);
    }

    100% {
        transform: scale(1);
    }
}

.event-title-premium {
    font-size: clamp(1.8rem, 6vw, 4rem);
    /* Shrunk from 2.5/8/5 */
    font-weight: 900;
    text-transform: uppercase;
    margin: 0;
    background: linear-gradient(135deg, #fff 0%, #00d2ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 20px rgba(0, 128, 255, 0.4));
    letter-spacing: -1px;
}

.event-subtitle-premium {
    font-size: clamp(1.2rem, 3vw, 2rem);
    color: rgba(255, 255, 255, 0.6);
    margin-top: 10px;
    margin-bottom: 60px;
    font-weight: 300;
}

/* Counters V2 */
.results-counters-premium {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.counter-card-v2 {
    position: relative;
    padding: 40px 60px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 30px;
    backdrop-filter: blur(20px);
    transition: all 0.4s ease;
    min-width: 320px;
}

.counter-card-v2:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-color);
    transform: translateY(-5px) scale(1.02);
}

.counter-icon-v2 {
    font-size: 3rem;
    filter: drop-shadow(0 0 15px var(--primary-color));
}

#publicVotesCounter .counter-icon-v2 {
    color: #00ffff;
}

#juryVotesCounter .counter-icon-v2 {
    color: #b000ff;
}

.counter-content {
    text-align: left;
}

.counter-value {
    font-size: 4rem;
    font-weight: 900;
    line-height: 1;
}

.counter-label {
    font-size: 0.9rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 5px;
}

/* Scroll Indicator - Relocated to Bottom Right */
.scroll-indidicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0.5;
    background: rgba(0, 0, 0, 0.4);
    padding: 8px 15px;
    border-radius: 30px;
    backdrop-filter: blur(5px);
    transition: opacity 0.3s;
    z-index: 100;
}

.scroll-indidicator:hover {
    opacity: 1;
}

.scroll-indidicator p {
    font-size: 0.75rem;
    color: #fff;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mouse-icon {
    width: 16px;
    height: 26px;
    border: 1.5px solid #fff;
    border-radius: 10px;
    position: relative;
}

.mouse-icon:before {
    content: '';
    position: absolute;
    top: 5px;
    left: 50%;
    width: 1.5px;
    height: 5px;
    background: #fff;
    transform: translateX(-50%);
    animation: scrollMouse 2s infinite;
}

@keyframes scrollMouse {
    0% {
        transform: translate(-50%, 0);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, 20px);
        opacity: 0;
    }
}

/* Slide 2: Leaderboard Styles */
.section-title-premium {
    font-size: 2.22rem;
    font-weight: 800;
    margin-bottom: 40px;
    /* Increased from 30px for better breathing room */
    letter-spacing: -1px;
    background: linear-gradient(to right, #fff, #888);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.leaderboard-grid-premium {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    width: 100%;
    max-height: 80vh;
    /* Increased to use more space */
    overflow-y: auto;
    padding: 10px;
    scrollbar-width: none;
    /* Hide scrollbar */
    -ms-overflow-style: none;
}

.leaderboard-grid-premium::-webkit-scrollbar {
    display: none;
}

.candidate-card-v2 {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 15px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    min-height: 140px;
    /* Even more compact */
}

.candidate-card-v2.rank-1 {
    border-color: #ffd700;
    background: linear-gradient(145deg, rgba(255, 215, 0, 0.1), transparent);
}

.candidate-card-v2.rank-2 {
    border-color: rgba(255, 255, 255, 0.3);
}

.candidate-card-v2.rank-3 {
    border-color: rgba(205, 127, 50, 0.5);
}

.rank-badge-premium {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1rem;
    color: #ffffff;
    z-index: 5;
}

.rank-1 .rank-badge-premium {
    background: #ffd700;
    color: #000;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.card-name-v2 {
    font-size: 1.5rem;
    /* Slightly smaller */
    font-weight: 800;
    margin-bottom: 5px;
    text-align: left;
    color: #ffffff;
    padding-right: 45px;
    /* Clear space for rank badge */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-project-v2 {
    font-size: 0.95rem;
    /* Shrunk from 1.1 */
    color: #cccccc;
    /* Much lighter than previous #aaa */
    text-align: left;
    margin-bottom: 20px;
    font-weight: 400;
}

.score-display-v2 {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.score-text-v2 {
    font-size: 0.8rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.score-big-v2 {
    font-size: 2.8rem;
    /* Shrunk from 3.5 */
    font-weight: 900;
}

/* Score Color Coding Classes */
.score-elite {
    color: var(--score-elite);
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.score-high {
    color: var(--score-high);
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
}

.score-mid {
    color: var(--score-mid);
    text-shadow: 0 0 20px rgba(255, 204, 0, 0.5);
}

.score-mid-low {
    color: var(--score-mid-low);
    text-shadow: 0 0 20px rgba(255, 136, 0, 0.5);
}

.score-low {
    color: var(--score-low);
    text-shadow: 0 0 20px rgba(255, 51, 51, 0.5);
}

/* Analysis Controls & Tabs */
.analysis-controls {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
}

.results-tabs-premium {
    display: flex;
    gap: 15px;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-btn-v2 {
    background: transparent;
    border: none;
    color: #888;
    padding: 10px 25px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn-v2:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn-v2.active {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 0 20px rgba(0, 128, 255, 0.4);
}

/* Slide 3: Analysis Styles */
.table-container-v2 {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 5px;
    backdrop-filter: blur(15px);
    max-height: 70vh;
    /* Increased height */
    overflow-y: auto;
    width: 100%;
    scrollbar-width: none;
}

.table-container-v2::-webkit-scrollbar {
    display: none;
}

.results-table-v2 {
    width: 100%;
    border-collapse: collapse;
}

.results-table-v2 th {
    padding: 15px 20px;
    /* Shrunk */
    text-align: left;
    color: #bbbbbb;
    /* Lighter for visibility */
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 2px;
}

.results-table-v2 td {
    padding: 12px 20px;
    /* Shrunk from 20 */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 1rem;
    color: #ffffff;
    /* Bright white text */
}

.val-col {
    text-align: right !important;
    min-width: 80px;
    /* Prevent squeezing */
}

.team-name-row {
    font-weight: 700;
    color: #fff;
    font-size: 1rem;
}

.project-name-row {
    font-size: 0.8rem;
    color: #888;
}

/* Dashboard Meta Footer */
.dashboard-meta {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 30px;
    color: #ffffff;
    /* Explicitly white meta text */
    font-size: 0.95rem;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.refresh-badge {
    background: rgba(0, 128, 255, 0.1);
    color: var(--primary-color);
    padding: 2px 12px;
    border-radius: 20px;
}

/* Loading State V2 */
.results-loading-premium {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px;
}

.loader-ring {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Animations */
@keyframes slideInUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.animate-up {
    animation: slideInUp 0.8s ease forwards;
}

/* Responsive Optimization */
@media (max-width: 1100px) {
    .leaderboard-grid-premium {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hackathon-results-container {
        scroll-snap-type: none;
        overflow-y: scroll;
        height: auto;
        min-height: 100vh;
    }

    .results-page-slide {
        height: auto;
        min-height: 100vh;
        padding: 40px 15px;
        display: block;
        /* Avoid flex centering on mobile to prevent overlaps */
    }

    .slide-inner {
        padding: 0;
        height: auto;
        max-width: 100%;
        display: block;
    }

    .event-title-premium {
        font-size: 2rem;
        letter-spacing: -1px;
    }

    .event-subtitle-premium {
        font-size: 1rem;
        margin-bottom: 30px;
    }

    .results-counters-premium {
        gap: 15px;
    }

    .counter-card-v2 {
        min-width: 100%;
        padding: 20px;
        gap: 15px;
        border-radius: 20px;
    }

    .counter-icon-v2 {
        font-size: 2rem;
    }

    .counter-value {
        font-size: 2.5rem;
    }

    .section-title-premium {
        font-size: 1.8rem;
        margin-bottom: 20px;
    }

    .leaderboard-grid-premium {
        display: flex;
        flex-direction: column;
        gap: 15px;
        padding: 0;
        max-height: none;
        overflow: visible;
    }

    .candidate-card-v2 {
        width: 100%;
        min-height: auto;
        padding: 20px;
        border-radius: 15px;
    }

    .card-name-v2 {
        font-size: 1.3rem;
    }

    .score-big-v2 {
        font-size: 2.2rem;
    }

    .table-container-v2 {
        max-height: none;
        padding: 0;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.05);
        border-radius: 15px;
        backdrop-filter: blur(10px);
    }

    .table-responsive-v2 {
        overflow-x: auto;
        width: 100%;
        -webkit-overflow-scrolling: touch;
        margin: 15px -15px;
        padding: 0 15px;
        border-radius: 0;
    }

    .analysis-controls {
        margin-bottom: 20px;
        flex-direction: column;
        align-items: center;
    }

    .results-tabs-premium {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 10px;
        justify-content: flex-start;
        gap: 10px;
    }

    .tab-btn-v2 {
        white-space: nowrap;
        font-size: 0.8rem;
        padding: 8px 15px;
    }

    .results-table-v2 th,
    .results-table-v2 td {
        padding: 12px 10px;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .team-name-row {
        font-size: 0.9rem;
    }

    .project-name-row {
        font-size: 0.75rem;
    }

    .dashboard-meta {
        flex-direction: column;
        gap: 10px;
        font-size: 0.8rem;
        padding-bottom: 40px;
        /* Add breathing room at bottom */
    }

    .scroll-indidicator {
        display: none !important;
    }
}