:root {
    --primary: #5D4037;
    --secondary: #8D6E63;
    --accent: #D7CCC8;
    --light: #EFEBE9;
    --dark: #3E2723;
    --text: #212121;
    --gold: #D4AF37;
    --silver: #A9A9A9;
    --bronze: #CD7F32;
    --green: #4CAF50;
    --orange: #FF9800;
    --red: #F44336;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Elementos decorativos de fondo */
.coffee-beans {
    position: fixed;
    opacity: 0.03;
    z-index: -1;
    width: 80px;
    height: 80px;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

header {
    background: linear-gradient(135deg, var(--dark), var(--primary));
    color: white;
    padding: 2rem 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="40" r="1.5" fill="rgba(255,255,255,0.1)"/><circle cx="40" cy="80" r="1" fill="rgba(255,255,255,0.1)"/></svg>');
    animation: sparkle 3s linear infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.1; }
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
    position: relative;
    z-index: 2;
}

.auth-buttons {
    position: absolute;
    top: 0;
    right: 2rem;
    display: flex;
    gap: 0.5rem;
}

.auth-btn {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    text-decoration: none;
    backdrop-filter: blur(10px);
}

.auth-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.logo {
    max-width: 120px;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    margin-bottom: 0.5rem;
    position: relative;
    display: inline-block;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

h1::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--gold), #f39c12);
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

.subtitle {
    font-weight: 300;
    opacity: 0.9;
    font-size: 1.1rem;
    margin-top: 1rem;
}

.container {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 2rem;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-family: 'Playfair Display', serif;
    color: var(--primary);
    font-size: 2.5rem;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 3px;
    background: var(--primary);
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

.section-description {
    color: var(--secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.data-type-selector {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    text-align: center;
}

.data-type-selector label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--primary);
    font-size: 1.1rem;
}

.data-type-selector select {
    padding: 1rem 2rem;
    border-radius: 25px;
    border: 2px solid var(--accent);
    background-color: white;
    font-family: 'Poppins', sans-serif;
    color: var(--primary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 250px;
    font-size: 1rem;
}

.data-type-selector select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(93, 64, 55, 0.2);
}

.ranking-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 2rem;
}

.ranking-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 2rem;
    text-align: center;
}

.ranking-header h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.ranking-header p {
    opacity: 0.9;
}

.ranking-list {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border-radius: 15px;
    border-left: 5px solid var(--accent);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.ranking-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent, rgba(93, 64, 55, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ranking-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    border-left-color: var(--primary);
}

.ranking-item:hover::before {
    opacity: 1;
}

.ranking-item.rank-1 {
    border-left-color: var(--gold);
    background: linear-gradient(135deg, #fff9c4, #ffffff);
}

.ranking-item.rank-2 {
    border-left-color: var(--silver);
    background: linear-gradient(135deg, #f0f0f0, #ffffff);
}

.ranking-item.rank-3 {
    border-left-color: var(--bronze);
    background: linear-gradient(135deg, #ffeaa7, #ffffff);
}

.rank {
    font-size: 2rem;
    font-weight: 700;
    min-width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-right: 1.5rem;
    position: relative;
    z-index: 2;
}

.rank-1 { 
    background: linear-gradient(135deg, var(--gold), #f39c12);
    color: white;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
}

.rank-2 { 
    background: linear-gradient(135deg, var(--silver), #95a5a6);
    color: white;
    box-shadow: 0 4px 15px rgba(169, 169, 169, 0.4);
}

.rank-3 { 
    background: linear-gradient(135deg, var(--bronze), #e67e22);
    color: white;
    box-shadow: 0 4px 15px rgba(205, 127, 50, 0.4);
}

.rank:not(.rank-1):not(.rank-2):not(.rank-3) {
    background: linear-gradient(135deg, var(--accent), var(--secondary));
    color: var(--dark);
}

.coffee-info {
    flex-grow: 1;
    padding: 0 1rem;
    position: relative;
    z-index: 2;
}

.coffee-name {
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--dark);
    margin-bottom: 0.3rem;
    font-family: 'Playfair Display', serif;
}

.origin {
    color: var(--secondary);
    font-weight: 500;
    margin-bottom: 0.3rem;
}

.evaluation-date {
    font-size: 0.9rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.score {
    font-weight: 700;
    font-size: 1.4rem;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    position: relative;
    z-index: 2;
    min-width: 90px;
    text-align: center;
}

.score-high {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(129, 199, 132, 0.2));
    color: #2E7D32;
    border: 2px solid rgba(76, 175, 80, 0.3);
}

.score-medium {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.2), rgba(255, 213, 79, 0.2));
    color: #F57F17;
    border: 2px solid rgba(255, 193, 7, 0.3);
}

.score-low {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.2), rgba(239, 83, 80, 0.2));
    color: #C62828;
    border: 2px solid rgba(244, 67, 54, 0.3);
}

.analyze-btn {
    margin-left: 1rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 0.8rem 1.2rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 2;
}

.analyze-btn:hover {
    background: linear-gradient(135deg, var(--dark), var(--primary));
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(93, 64, 55, 0.3);
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 3rem 0;
}

.btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
    font-size: 1.1rem;
    box-shadow: 0 8px 25px rgba(93, 64, 55, 0.3);
}

.btn:hover {
    background: linear-gradient(135deg, var(--dark), var(--primary));
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(93, 64, 55, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #e0e0e0, #bdbdbd);
    color: var(--dark);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #bdbdbd, #9e9e9e);
}

footer {
    background: linear-gradient(135deg, var(--dark), var(--primary));
    color: white;
    padding: 3rem 0;
    text-align: center;
    margin-top: 4rem;
}

/* Responsivo */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    
    .container {
        padding: 0 1rem;
        margin: 2rem auto;
    }

    .auth-buttons {
        position: static;
        justify-content: center;
        margin-bottom: 1rem;
    }

    .ranking-item {
        flex-direction: column;
        text-align: center;
        padding: 2rem 1rem;
    }

    .rank {
        margin-right: 0;
        margin-bottom: 1rem;
    }

    .coffee-info {
        margin-bottom: 1rem;
        padding: 0;
    }

    .analyze-btn {
        margin: 0;
        width: 100%;
        justify-content: center;
    }

    .action-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .section-title { font-size: 2rem; }
    .data-type-selector select { min-width: 200px; }
    h1 { font-size: 1.8rem; }
    .subtitle { font-size: 1rem; }
}

/* Animaciones adicionales */
.ranking-item {
    animation: slideInUp 0.6s ease-out forwards;
    opacity: 0;
    transform: translateY(30px);
}

.ranking-item:nth-child(1) { animation-delay: 0.1s; }
.ranking-item:nth-child(2) { animation-delay: 0.2s; }
.ranking-item:nth-child(3) { animation-delay: 0.3s; }
.ranking-item:nth-child(4) { animation-delay: 0.4s; }
.ranking-item:nth-child(5) { animation-delay: 0.5s; }

@keyframes slideInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loader para cuando se cargan los datos */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--accent);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* CSS para centrar header */
.header-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 15px;
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        text-align: center;
    }
}
/* Colores más distintivos para el podio */
.podio-oro { 
    background: linear-gradient(45deg, #FFD700, #FFA500);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.podio-plata { 
    background: linear-gradient(45deg, #C0C0C0, #E5E5E5);
    box-shadow: 0 4px 15px rgba(192, 192, 192, 0.4);
}

.podio-bronce { 
    background: linear-gradient(45deg, #CD7F32, #D2691E);
    box-shadow: 0 4px 15px rgba(205, 127, 50, 0.4);
}