/* Reset et variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Couleurs TikTok + Montagne */
    --primary: #00f2ea;
    --secondary: #ff0050;
    --dark: #000000;
    --dark-gray: #161823;
    --medium-gray: #2f2f3a;
    --light-gray: #f1f1f2;
    --white: #ffffff;
    --snow: #e8f4f8;
    --ice: #b8e6f0;
    --mountain: #4a7c9e;
    --mountain-dark: #2c5f7e;
    --success: #25d366;
    --error: #ff4444;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #00f2ea 0%, #ff0050 100%);
    --gradient-mountain: linear-gradient(180deg, #2c5f7e 0%, #4a7c9e 50%, #b8e6f0 100%);
    --gradient-snow: linear-gradient(180deg, rgba(255,255,255,0.9) 0%, rgba(184,230,240,0.7) 100%);
    
    /* Typographie */
    --font-main: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    font-family: var(--font-main);
    background: linear-gradient(180deg, #1a1a2e 0%, #2c5f7e 50%, #4a7c9e 100%);
    color: var(--white);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Animation de neige */
.snow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    top: -10px;
    color: white;
    font-size: 1em;
    opacity: 0.8;
    animation: fall linear infinite;
    pointer-events: none;
}

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(360deg);
    }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

/* Header */
.header {
    padding: 30px 0;
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-bottom: 3px solid var(--primary);
    box-shadow: 0 4px 20px rgba(0, 242, 234, 0.3);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo-icon {
    font-size: 3rem;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.logo h1 {
    font-size: 3rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(0, 242, 234, 0.5);
}

.tagline {
    font-size: 1.2rem;
    color: var(--ice);
    font-weight: 600;
}

/* Main container */
.main-container {
    padding: 40px 0;
}

/* Welcome card */
.welcome-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    margin-bottom: 40px;
    border: 2px solid rgba(0, 242, 234, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.welcome-card h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--primary);
}

.welcome-card p {
    font-size: 1.1rem;
    color: var(--light-gray);
}

/* Vote section */
.vote-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    padding: 40px;
    border: 2px solid rgba(0, 242, 234, 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    max-width: 600px;
    margin: 0 auto 40px;
}

.vote-card h3 {
    font-size: 1.8rem;
    margin-bottom: 30px;
    text-align: center;
    color: var(--primary);
}

/* Form styles */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--white);
}

.custom-select {
    position: relative;
}

#station-search {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid rgba(0, 242, 234, 0.5);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--dark);
    font-size: 1rem;
    font-family: var(--font-main);
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

#station-search:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(0, 242, 234, 0.4);
}

select {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid rgba(0, 242, 234, 0.5);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--dark);
    font-size: 1rem;
    font-family: var(--font-main);
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23000' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(0, 242, 234, 0.4);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix {
    position: absolute;
    left: 20px;
    font-size: 1.2rem;
    color: var(--dark);
    font-weight: 600;
    z-index: 1;
}

input[type="text"] {
    width: 100%;
    padding: 15px 20px 15px 40px;
    border: 2px solid rgba(0, 242, 234, 0.5);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--dark);
    font-size: 1rem;
    font-family: var(--font-main);
    transition: all 0.3s ease;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(0, 242, 234, 0.4);
}

.help-text {
    display: block;
    margin-top: 8px;
    color: var(--ice);
    font-size: 0.9rem;
}

/* Button */
.btn-vote {
    width: 100%;
    padding: 18px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 15px;
    color: var(--white);
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 8px 20px rgba(0, 242, 234, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-vote:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 242, 234, 0.6);
}

.btn-vote:active {
    transform: translateY(-1px);
}

.btn-vote:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    font-size: 1.5rem;
}

/* Vote message */
.vote-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    display: none;
}

.vote-message.success {
    background: rgba(37, 211, 102, 0.2);
    border: 2px solid var(--success);
    color: var(--success);
    display: block;
}

.vote-message.error {
    background: rgba(255, 68, 68, 0.2);
    border: 2px solid var(--error);
    color: var(--error);
    display: block;
}

/* Already voted */
.info-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    padding: 40px;
    text-align: center;
    border: 2px solid rgba(255, 0, 80, 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    max-width: 600px;
    margin: 0 auto 40px;
}

.info-card h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--secondary);
}

.info-card p {
    font-size: 1.1rem;
    color: var(--light-gray);
    margin-bottom: 10px;
}

/* Results section */
.results-section {
    margin-top: 60px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.results-header h2 {
    font-size: 2rem;
    color: var(--primary);
}

.btn-refresh {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid var(--primary);
    border-radius: 10px;
    color: var(--white);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-refresh:hover {
    background: var(--primary);
    color: var(--dark);
    transform: scale(1.05);
}

/* Podium */
.podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 40px;
    padding: 20px;
    flex-wrap: wrap;
}

.podium-place {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    min-width: 200px;
    border: 2px solid;
    position: relative;
    transition: all 0.3s ease;
}

.podium-place:hover {
    transform: translateY(-10px);
}

.podium-place.first {
    border-color: #FFD700;
    box-shadow: 0 8px 32px rgba(255, 215, 0, 0.4);
    order: 2;
}

.podium-place.second {
    border-color: #C0C0C0;
    box-shadow: 0 8px 32px rgba(192, 192, 192, 0.4);
    order: 1;
}

.podium-place.third {
    border-color: #CD7F32;
    box-shadow: 0 8px 32px rgba(205, 127, 50, 0.4);
    order: 3;
}

.podium-medal {
    font-size: 3rem;
    margin-bottom: 10px;
}

.podium-station {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--white);
}

.podium-votes {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Results list */
.results-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.result-item {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    border: 2px solid rgba(0, 242, 234, 0.2);
    transition: all 0.3s ease;
}

.result-item:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary);
    transform: translateX(5px);
}

.result-rank {
    font-size: 1.5rem;
    font-weight: 800;
    min-width: 50px;
    text-align: center;
    color: var(--primary);
}

.result-info {
    flex: 1;
}

.result-station {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 5px;
}

.result-votes {
    font-size: 1rem;
    color: var(--ice);
}

.result-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 8px;
}

.result-bar-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 10px;
    transition: width 1s ease;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Footer */
.footer {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    padding: 30px 0;
    text-align: center;
    margin-top: 60px;
    border-top: 2px solid rgba(0, 242, 234, 0.3);
}

.footer p {
    color: var(--ice);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .logo h1 {
        font-size: 2rem;
    }
    
    .tagline {
        font-size: 1rem;
    }
    
    .welcome-card h2 {
        font-size: 1.5rem;
    }
    
    .vote-card {
        padding: 25px;
    }
    
    .podium {
        flex-direction: column;
        align-items: center;
    }
    
    .podium-place {
        width: 100%;
        max-width: 300px;
    }
    
    .podium-place.first,
    .podium-place.second,
    .podium-place.third {
        order: 0;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .result-item {
        flex-direction: column;
        text-align: center;
    }
}

/* Animations supplémentaires */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}
