/* Inherit global styles from the main site. Using variables from the provided styles.css */
:root {
    --bg-color: #020412;
    --primary-blue: #0A84FF;
    --accent-cyan: #00E0FF;
    --text-light: #EAEBF0;
    --text-dark: #A5B1CC;
    --glass-bg: rgba(10, 15, 40, 0.5);
    --glass-border: rgba(0, 224, 255, 0.2);
    --glow-shadow: 0 0 20px rgba(0, 224, 255, 0.3);
    --font-family: 'Space Grotesk', sans-serif;
    --header-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
    background-image: radial-gradient(circle at 1% 1%, #10142b 0%, var(--bg-color) 25%);
}

/* Base styles from your site's subpage styling */
.subpage-body {
    display: block;
    padding-top: var(--header-height);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

.content-section {
    padding: 6rem 0;
    position: relative;
    opacity: 1; /* Always visible on this subpage */
    transform: translateY(0);
}

.section-title {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--accent-cyan);
    text-shadow: 0 0 15px var(--accent-cyan);
}

.section-subtitle {
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 4rem;
    color: var(--text-dark);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* Styles for the animated background */
.stars-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

#stars1, #stars2, #stars3 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-repeat: repeat;
    background-size: cover;
    background-position: center;
}

#stars1 {
    background-image: radial-gradient(1px 1px at 20px 30px, #eee, rgba(0,0,0,0)), 
                      radial-gradient(1px 1px at 40px 70px, #fff, rgba(0,0,0,0)), 
                      radial-gradient(1px 1px at 50px 160px, #ddd, rgba(0,0,0,0)), 
                      radial-gradient(1px 1px at 90px 40px, #fff, rgba(0,0,0,0)), 
                      radial-gradient(1px 1px at 130px 80px, #fff, rgba(0,0,0,0)), 
                      radial-gradient(1px 1px at 160px 120px, #ddd, rgba(0,0,0,0));
    background-size: 200px 200px;
    animation: anim-stars 300s linear infinite;
}

#stars2 {
    background-image: radial-gradient(2px 2px at 10px 90px, #eee, rgba(0,0,0,0)), 
                      radial-gradient(2px 2px at 80px 30px, #fff, rgba(0,0,0,0)), 
                      radial-gradient(2px 2px at 120px 180px, #ddd, rgba(0,0,0,0)),
                      radial-gradient(2px 2px at 60px 170px, #ddd, rgba(0,0,0,0)),
                      radial-gradient(2px 2px at 175px 100px, #fff, rgba(0,0,0,0));
    background-size: 250px 250px;
    animation: anim-stars 250s linear infinite;
}

#stars3 {
    background-image: radial-gradient(2px 2px at 50px 50px, #fff, rgba(0,0,0,0)), 
                      radial-gradient(3px 3px at 100px 100px, var(--accent-cyan), rgba(0,0,0,0)),
                      radial-gradient(3px 3px at 200px 150px, #eee, rgba(0,0,0,0)),
                      radial-gradient(2px 2px at 150px 50px, #fff, rgba(0,0,0,0));
    background-size: 300px 300px;
    animation: anim-stars 200s linear infinite;
}

@keyframes anim-stars {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-2000px);
    }
}

/* Styles for the back-to-home button */
.btn {
    padding: 1rem 2.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    white-space: nowrap;
    min-width: 180px;
    text-align: center;
    display: inline-block;
}

.btn-secondary {
    background-color: transparent;
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
}
.btn-secondary:hover {
    background-color: rgba(0, 224, 255, 0.1);
    box-shadow: var(--glow-shadow);
    transform: translateY(-5px);
}

.back-link {
    text-align: center;
    margin-top: 4rem;
    padding: 0 1rem;
}

/* Styles for the finalists table */
.finalists-table-container {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    box-shadow: var(--glow-shadow);
    padding: 2rem;
    overflow: hidden;
    position: relative;
    margin: 0 1rem;
}

.scroll-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.finalists-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px; /* Ensure table is scrollable on small screens */
}

.finalists-table thead {
    background: rgba(0, 224, 255, 0.1);
}

.finalists-table th, 
.finalists-table td {
    padding: 1.2rem;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.finalists-table th {
    color: var(--accent-cyan);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.finalists-table td {
    color: var(--text-dark);
}

.finalists-table tbody tr:hover {
    background: rgba(0, 224, 255, 0.05);
}

.finalists-table tbody tr:last-child td {
    border-bottom: none;
}

.no-data-message {
    text-align: center;
    font-style: italic;
    color: var(--text-dark);
    padding: 2rem 0;
}

/* Styles for the search input and button */
.search-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 0 1rem;
    flex-wrap: wrap; /* Allows items to wrap on smaller screens */
}

#searchInput {
    padding: 0.75rem 1rem;
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-light);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

#searchInput::placeholder {
    color: var(--text-dark);
    opacity: 0.7;
}

#searchInput:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 224, 255, 0.5);
}

#clearSearchBtn {
    padding: 0.75rem 1.5rem;
    border: none;
    background: var(--primary-blue);
    color: var(--text-light);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

#clearSearchBtn:hover {
    background-color: var(--accent-cyan);
    box-shadow: var(--glow-shadow);
}

/* Responsive styles */
@media (max-width: 1024px) {
    .container {
        padding: 0 1.5rem;
    }
    .section-title {
        font-size: 2.5rem;
    }
    .section-subtitle {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }
    .section-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    .finalists-table-container {
        padding: 1rem;
    }
    .finalists-table th,
    .finalists-table td {
        padding: 0.8rem;
        font-size: 0.8rem;
    }
    .search-container {
        flex-direction: column;
        gap: 0.5rem;
    }
    #searchInput {
        max-width: none;
    }
    #clearSearchBtn {
        width: 100%;
    }
    .btn {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    .container {
        padding: 0 1rem;
        
    }
    .section-title {
        font-size: 1.5rem;
    }
    .section-subtitle {
        font-size: 0.9rem;
    }
    .content-section {
        padding: 4rem 0;
    }
    .finalists-table th,
    .finalists-table td {
        padding: 0.6rem;
    }
}