:root {
    --primary-gold: #d4af37;
    --secondary-gold: #f3e5ab;
    --deep-purple: #1a0b2e;
    --light-purple: #2d1b4e;
    --text-light: #f0f0f0;
    --text-muted: #a0a0a0;
    --accent-glow: rgba(212, 175, 55, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background: radial-gradient(circle at top, var(--light-purple), var(--deep-purple));
    color: var(--text-light);
    padding: 2rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
    animation: slideUp 0.5s ease-out;
}

/* --- Layout & Header --- */
.container {
    max-width: 800px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease-out;
}

h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-gold);
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 2rem;
}

nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 1.1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-gold);
    border-bottom-color: var(--primary-gold);
}

/* --- Search Components --- */
.search-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
    position: relative;
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

.input-wrapper {
    flex-grow: 1;
    position: relative;
}

input[type="text"] {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    color: var(--text-light);
    font-family: 'Outfit', sans-serif;
    transition: all 0.3s ease;
}

input[type="text"]:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-gold);
    box-shadow: 0 0 15px var(--accent-glow);
}

button#search-btn {
    padding: 0 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--deep-purple);
    background: var(--primary-gold);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Outfit', sans-serif;
}

button#search-btn:hover {
    background: var(--secondary-gold);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.4);
}

.autocomplete-items {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: none;
    border-top: none;
    z-index: 99;
    top: 100%;
    left: 0;
    right: 0;
    border-radius: 0 0 15px 15px;
    overflow: hidden;
    background: rgba(26, 11, 46, 0.95);
    backdrop-filter: blur(10px);
}

.autocomplete-items div {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-light);
}

.autocomplete-items div:hover {
    background-color: rgba(212, 175, 55, 0.2);
}

.autocomplete-active {
    background-color: rgba(212, 175, 55, 0.4) !important;
}

/* --- Result Cards --- */
.contestant-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    animation: slideUp 0.5s ease-out;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
}

.contestant-name {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--primary-gold);
    margin-bottom: 0.5rem;
}

.season-info {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.placement-badge {
    background: rgba(212, 175, 55, 0.1);
    color: var(--primary-gold);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

/* --- Stats Grid --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-item {
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 12px;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-light);
}

.should-have-placed {
    color: #4caf50;
}

/* --- Tables --- */
.dances-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.dances-table th,
.dances-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dances-table th {
    color: var(--primary-gold);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.dances-table tr:last-child td {
    border-bottom: none;
}

/* --- Animations --- */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Mobile Responsiveness --- */
@media (max-width: 600px) {
    h1 {
        font-size: 2.5rem;
    }

    .search-container {
        flex-direction: column;
    }

    .card-header {
        flex-direction: column;
        gap: 1rem;
    }

    .autocomplete-items {
        width: 100%;
    }
}
/* --- Analytics Styles --- */
.section-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 3rem;
    animation: slideUp 0.5s ease-out;
}

.analytics-title {
    color: var(--primary-gold);
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    padding-bottom: 0.5rem;
}

.rank-list {
    list-style: none;
    padding-left: 0;
}

.rank-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rank-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.rank-number {
    font-weight: bold;
    color: var(--primary-gold);
    margin-right: 1rem;
    width: 20px;
}

.rank-details {
    flex-grow: 1;
}

.rank-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.rank-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.rank-stat {
    font-weight: bold;
    color: var(--text-light);
}

.stat-highlight {
    color: #4caf50;
}

.stat-negative {
    color: #ff6b6b;
}

.analytics-link {
    color: var(--text-light);
    text-decoration: none;
    border-bottom: 1px dotted var(--primary-gold);
    transition: all 0.3s ease;
}

.analytics-link:hover {
    color: var(--primary-gold);
    border-bottom: 1px solid var(--primary-gold);
}

/* --- Dropdown Menu --- */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: rgba(26, 11, 46, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    border-radius: 10px;
    z-index: 100;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    animation: fadeInDown 0.2s ease-out;
}

.dropdown-content a {
    color: var(--text-light);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: all 0.2s;
    font-family: 'Outfit', sans-serif;
}

.dropdown-content a:hover {
    background-color: rgba(212, 175, 55, 0.2);
    color: var(--primary-gold);
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-toggle {
    cursor: default;
}

@keyframes fadeInDownCentered {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.dropdown-content {
    animation: fadeInDownCentered 0.2s ease-out;
}

.dropdown-content::before {
    content: "";
    position: absolute;
    top: -1rem;
    left: 0;
    width: 100%;
    height: 1rem;
    background: transparent;
}
