/* css/style.css */

/* ... (MANTÉN TODO EL CSS ANTERIOR DE ROOT Y BODY) ... */
:root {
    --primary-color: #ff007f;
    --secondary-color: #00d4ff;
    --bg-color: #f4f4f4;
    --text-color: #333;
    --fb-color: #1877F2;
    --ig-gradient: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    --tiktok-color: #000000;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.app-container {
    width: 100%;
    max-width: 450px;
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

h1 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin: 10px 0 20px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
}

/* CANVAS */
.canvas-wrapper {
    width: 100%;
    margin-bottom: 10px;
    /* Reduje margen porque ahora hay controles abajo */
    border: 2px dashed #bbb;
    border-radius: 8px;
    overflow: hidden;
    background-color: #999;
    background-image:
        linear-gradient(45deg, #bbb 25%, transparent 25%),
        linear-gradient(-45deg, #bbb 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #bbb 75%),
        linear-gradient(-45deg, transparent 75%, #bbb 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

canvas {
    width: 100%;
    height: auto;
    display: block;
}

/* --- NUEVO: NAVEGACIÓN DE MARCOS --- */
.frame-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background: #f9f9f9;
    padding: 10px;
    border-radius: 50px;
    border: 1px solid #eee;
}

.nav-btn {
    background: var(--text-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:active {
    transform: scale(0.9);
}

#frameCounter {
    font-weight: bold;
    color: #555;
    font-size: 0.9rem;
}

/* CONTROLES */
.controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: center;
}

.category-label {
    margin: 10px 0 5px 0;
    font-size: 0.9rem;
    color: #777;
    font-weight: 600;
    text-align: left;
    padding-left: 5px;
}

.marcos-selector {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    /* Scroll horizontal si hay muchas categorias */
    padding-bottom: 5px;
}

.marcos-selector button {
    background: white;
    border: 1px solid var(--secondary-color);
    color: var(--secondary-color);
    padding: 8px 15px;
    border-radius: 20px;
    white-space: nowrap;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

/* Efecto hover/active para categorias */
.marcos-selector button:hover,
.marcos-selector button:focus {
    background: var(--secondary-color);
    color: white;
}

/* Botones Grandes */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    padding: 15px;
    border-radius: 50px;
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
}

.btn-success {
    background-color: #25D366;
    color: white;
    padding: 15px;
    border: none;
    border-radius: 50px;
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
}

.btn-success:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* FOOTER */
.app-footer {
    margin-top: 30px;
    text-align: center;
}

hr {
    border: 0;
    border-top: 1px solid #eee;
    margin-bottom: 20px;
}

.follow-text {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.social-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    font-size: 1.2rem;
}

.facebook {
    background-color: var(--fb-color);
}

.instagram {
    background: var(--ig-gradient);
}

.tiktok {
    background-color: var(--tiktok-color);
}

.btn-paypal {
    display: inline-block;
    background-color: #FFC439;
    color: #2c2e2f;
    padding: 10px 25px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.credits {
    font-size: 0.8rem;
    color: #999;
    margin-top: 10px;
}

.credits strong {
    color: var(--primary-color);
}

/* === BARRA DE NAVEGACIÓN INFERIOR === */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 2px solid #eee;
    display: flex;
    justify-content: space-around;
    padding: 10px 0 15px 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #999;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.3s;
    padding: 5px 15px;
    border-radius: 10px;
}

.nav-item i {
    font-size: 1.5rem;
    margin-bottom: 3px;
}

.nav-item:hover {
    color: var(--primary-color);
}

.nav-item.active {
    color: var(--primary-color);
    background: rgba(255, 0, 127, 0.1);
}

/* Espacio para que el contenido no quede oculto bajo la barra */
body {
    padding-bottom: 80px;
}

/* === MÓDULO DE VOTACIÓN === */

/* Header de Votación */
.votacion-header {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    margin-bottom: 20px;
}

.votacion-header h1 {
    color: white;
    margin-bottom: 5px;
}

.votacion-header p {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Secciones */
.ranking-section,
.participantes-section {
    padding: 20px;
}

.section-title {
    font-size: 1.3rem;
    margin-bottom: 20px;
    text-align: center;
    color: var(--text-color);
}

/* Ranking Top 3 */
.ranking-top {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.top-item {
    background: white;
    border-radius: 15px;
    padding: 20px 15px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 150px;
    max-width: 180px;
    transition: transform 0.3s;
}

.top-item:hover {
    transform: translateY(-5px);
}

.top-item.gold {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: white;
    order: 2;
    min-width: 180px;
}

.top-item.silver {
    background: linear-gradient(135deg, #C0C0C0 0%, #A8A8A8 100%);
    color: white;
    order: 1;
}

.top-item.bronze {
    background: linear-gradient(135deg, #CD7F32 0%, #B5651D 100%);
    color: white;
    order: 3;
}

.top-item .medalla {
    font-size: 3rem;
    margin-bottom: 10px;
}

.top-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 10px;
}

.top-item .nombre {
    font-weight: bold;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.top-item .estadisticas {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.85rem;
}

.sin-votos {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 30px;
}

/* Grid de Participantes */
.participantes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 100px;
}

@media (max-width: 768px) {
    .participantes-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* Card de Participante */
.participante-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.participante-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.foto-container {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 12px;
}

.foto-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.info-carro {
    margin-bottom: 12px;
}

.nombre-carro {
    font-size: 1.1rem;
    color: var(--text-color);
    margin: 0;
}

/* Sistema de Estrellas */
.estrellas-container {
    text-align: center;
    padding: 12px 0;
    font-size: 0.9rem;
    color: #666;
}

.estrellas {
    display: flex;
    justify-content: center;
    gap: 8px;
    font-size: 2rem;
    margin-top: 8px;
    user-select: none;
}

.estrellas i {
    color: #ddd;
    transition: all 0.2s;
    cursor: pointer;
}

.estrellas i.fa-solid {
    color: #FFD700;
}

.estrellas i:hover,
.estrellas i.hover-active {
    color: #FFA500;
    transform: scale(1.2);
}

.estrellas i:active {
    transform: scale(0.9);
}

/* Resultado de Votación */
.resultado {
    text-align: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-top: 10px;
    font-size: 0.9rem;
}

.resultado .promedio {
    font-weight: bold;
    color: var(--primary-color);
}

.resultado .total-votos {
    color: #666;
    margin-left: 5px;
}

/* Botón Cambiar Voto */
.btn-cambiar-voto {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    background: linear-gradient(135deg, var(--secondary-color) 0%, #c2185b 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cambiar-voto:hover {
    transform: scale(1.02);
}

.btn-cambiar-voto:active {
    transform: scale(0.98);
}

/* Loading */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.loading i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

/* Mensajes Flotantes */
.mensaje-flotante {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    opacity: 0;
    transition: all 0.3s;
}

.mensaje-flotante.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.mensaje-flotante.success {
    border-left: 4px solid #25D366;
    color: #155724;
}

.mensaje-flotante.success i {
    color: #25D366;
}

.mensaje-flotante.error {
    border-left: 4px solid #dc3545;
    color: #721c24;
}

.mensaje-flotante.error i {
    color: #dc3545;
}

.mensaje-flotante.info {
    border-left: 4px solid #17a2b8;
    color: #0c5460;
}

.mensaje-flotante.info i {
    color: #17a2b8;
}

/* === NAVEGACIÓN Y BUSCADOR === */

.buscador-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.input-buscar {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.input-buscar:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-buscar {
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-buscar:hover {
    transform: scale(1.05);
}

.btn-buscar:active {
    transform: scale(0.95);
}

.navegacion-carros {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

.btn-nav {
    width: 45px;
    height: 45px;
    border: 2px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-nav:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.btn-nav:active:not(:disabled) {
    transform: scale(0.9);
}

.btn-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.contador-carros {
    font-weight: bold;
    min-width: 120px;
    text-align: center;
    color: var(--text-color);
}

/* Vista Individual del Carro */
.carro-vista-individual {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 0 auto;
    margin-bottom: 100px;
}

.numero-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.foto-grande-container {
    width: 100%;
    height: 350px;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.foto-grande-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nombre-carro-grande {
    font-size: 1.8rem;
    color: var(--text-color);
    margin-bottom: 25px;
    text-align: center;
}

.estrellas-section {
    text-align: center;
    padding: 25px 0;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 20px;
}

.titulo-estrellas {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #666;
    font-weight: 600;
}

.estrellas-section .estrellas {
    font-size: 3rem;
    gap: 12px;
}

.resultados-carro {
    text-align: center;
    padding: 15px;
    background: #f0f9ff;
    border-radius: 10px;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.promedio-grande {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.4rem;
}

.total-votos-grande {
    color: #666;
    margin-left: 10px;
}

.btn-cambiar-voto-grande {
    width: 100%;
    padding: 15px;
    margin-top: 15px;
    background: linear-gradient(135deg, var(--secondary-color) 0%, #c2185b 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cambiar-voto-grande:hover {
    transform: scale(1.02);
}

.btn-cambiar-voto-grande:active {
    transform: scale(0.98);
}

/* Responsive */
@media (max-width: 768px) {
    .carro-vista-individual {
        padding: 20px;
    }

    .foto-grande-container {
        height: 250px;
    }

    .nombre-carro-grande {
        font-size: 1.4rem;
    }

    .estrellas-section .estrellas {
        font-size: 2.5rem;
        gap: 10px;
    }

    .top-item {
        cursor: pointer;
    }
}
/* === SELECTOR DE DESFILES === */
.selector-desfiles {padding: 30px 20px; max-width: 900px; margin: 0 auto;}
.desfiles-grid {display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 30px;}
.card-desfile {background: white; border-radius: 15px; padding: 30px; text-align: center; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); transition: all 0.3s; text-decoration: none; color: inherit; display: block; position: relative; overflow: hidden;}
.card-desfile::before {content: ''; position: absolute; top: 0; left: 0; right: 0; height: 5px;}
.desfile-corso::before {background: linear-gradient(135deg, #FF6B9D 0%, #FFA5C0 100%);}
.desfile-bando::before {background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);}
.desfile-naval::before {background: linear-gradient(135deg, #4A90E2 0%, #67B26F 100%);}
.card-desfile:hover {transform: translateY(-5px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);}
.icono-desfile {font-size: 4rem; margin-bottom: 20px;}
.desfile-corso .icono-desfile {color: #FF6B9D;}
.desfile-bando .icono-desfile {color: #FFD700;}
.desfile-naval .icono-desfile {color: #4A90E2;}
.card-desfile h3 {font-size: 1.5rem; margin-bottom: 10px; color: var(--text-color);}
.card-desfile p {color: #666; margin-bottom: 20px; font-size: 0.95rem;}
.btn-votar-desfile {display: inline-block; padding: 12px 25px; background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%); color: white; border-radius: 25px; font-weight: bold; transition: transform 0.2s;}
.info-votacion {text-align: center; padding: 20px; background: #f0f9ff; border-radius: 10px; color: #666; display: flex; align-items: center; justify-content: center; gap: 10px;}
.info-votacion i {color: var(--primary-color); font-size: 1.5rem;}
.btn-volver {display: inline-flex; align-items: center; gap: 8px; padding: 8px 15px; background: rgba(255, 255, 255, 0.2); color: white; text-decoration: none; border-radius: 8px; font-size: 0.9rem; margin-bottom: 10px; transition: background 0.2s;}
.btn-volver:hover {background: rgba(255, 255, 255, 0.3);}
.desfile-corso.votacion-header {background: linear-gradient(135deg, #FF6B9D 0%, #E91E63 100%);}
.desfile-bando.votacion-header {background: linear-gradient(135deg, #FFD700 0%, #FF8C00 100%);}
.desfile-naval.votacion-header {background: linear-gradient(135deg, #4A90E2 0%, #67B26F 100%);}
