/* styles.css - Compatible con todos los navegadores */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    max-width: 1200px;
    width: 100%;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1 {
    color: #333;
    text-align: center;
    margin-bottom: 30px;
    font-size: 2.5em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    color: #555;
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.8em;
}

.input-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

#codigo {
    padding: 15px 20px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    width: 300px;
    transition: all 0.3s ease;
    font-family: monospace;
    font-size: 18px;
}

#codigo:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn {
    padding: 15px 30px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.opciones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.opcion {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
}

.opcion:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.opcion.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    transform: scale(1.02);
}

.opcion-imagen-container {
    position: relative;
    display: inline-block;
    width: 100%;
}

.opcion img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 15px;
    transition: transform 0.3s ease;
}

.opcion:hover img {
    transform: scale(1.05);
}

.opcion-tooltip {
    visibility: hidden;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px 12px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.opcion-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.opcion-imagen-container:hover .opcion-tooltip {
    visibility: visible;
    opacity: 1;
}

.opcion-texto {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-top: 10px;
}

.mensaje {
    text-align: center;
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    font-weight: bold;
    animation: slideIn 0.3s ease;
}

.mensaje-exito {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.mensaje-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.mensaje-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

.login-box {
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
}

.login-box input {
    width: 100%;
    padding: 15px 20px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.login-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.resultado {
    background: #f8f9fa;
    margin: 20px 0;
    padding: 20px;
    border-radius: 15px;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease;
}

.resultado:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.resultado-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.resultado img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
}

.resultado-info {
    flex: 1;
}

.resultado-info strong {
    font-size: 1.2em;
    color: #333;
}

.votos-count {
    color: #666;
    margin-top: 5px;
}

.barra-container {
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
}

.barra {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    height: 35px;
    color: white;
    text-align: right;
    padding-right: 10px;
    line-height: 35px;
    border-radius: 10px;
    transition: width 0.5s ease;
    font-weight: bold;
    font-size: 14px;
}

.total-votos {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    margin-top: 30px;
    font-size: 1.2em;
    font-weight: bold;
}

.loading {
    text-align: center;
    padding: 40px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    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 {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    color: #666;
    font-size: 0.9em;
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 1.8em;
    }

    h2 {
        font-size: 1.4em;
    }

    .opciones-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .opcion img {
        height: 150px;
    }

    .btn {
        padding: 12px 20px;
    }

    #codigo {
        width: 100%;
    }
    
    .opcion-tooltip {
        white-space: normal;
        width: 200px;
        font-size: 12px;
    }
}

.text-center {
    text-align: center;
}

.hidden {
    display: none;
}