/**
 * trivias-list.css
 * Estilos específicos para la página de listado de trivias (trivias.html)
 * Separado del archivo principal trivia.css para mejor mantenibilidad
 */

/* ============================================
   PAGINACIÓN
   ============================================ */
.pagination-container {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}

.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 5px;
}

.pagination li {
    margin: 0 2px;
}

.pagination a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    text-decoration: none;
    color: var(--col-dar);
    font-weight: bold;
    background-color: white;
    border: 1px solid var(--col-dar-20);
    transition: all 0.3s ease;
    cursor: pointer;
}

.pagination a:hover {
    background-color: var(--col-pri-10-por);
    border-color: var(--col-pri);
}

.pagination a.active {
    background-color: var(--col-pri);
    color: white;
    border-color: var(--col-pri);
}

.pagination a.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   TARJETAS DE TRIVIA - MEJORAS
   ============================================ */
.trivia-card {
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
    background: white;
    margin-bottom: 20px;
    min-height: auto !important;
    height: auto !important;
}

.trivia-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* ============================================
   ESTADOS DE TRIVIA
   ============================================ */
.trivia-status {
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px 6px 0 0;
    text-align: center;
    font-size: 0.75rem;
    opacity: 0.9;
}

.trivia-status.status-3 {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.trivia-status.status-4 {
    background: linear-gradient(135deg, #FF9800, #f57c00);
    color: white;
}

.trivia-status.status-5 {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: white;
    animation: pulse 2s infinite;
}

.trivia-status.status-6 {
    background: linear-gradient(135deg, #9E9E9E, #757575);
    color: white;
}

.trivia-status.status-7 {
    background: linear-gradient(135deg, #607D8B, #455A64);
    color: white;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* ============================================
   TÍTULO DE TRIVIA
   ============================================ */
.trivia-title {
    font-size: 1.3rem;
    font-weight: bold;
    margin: 12px 12px 10px 12px;
    color: var(--col-dar);
    line-height: 1.2;
    text-align: center;
    border-bottom: 2px solid var(--col-pri);
    padding-bottom: 8px;
}

/* ============================================
   SECCIÓN DE PREMIO
   ============================================ */
.trivia-prize {
    display: flex;
    align-items: center;
    margin: 10px 12px 8px 12px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid var(--col-pri);
}

.prize-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    margin-right: 12px;
    flex-shrink: 0;
    border: 2px solid var(--col-pri);
}

.prize-text strong {
    display: block;
    color: var(--col-dar);
    font-size: 1rem;
    line-height: 1.2;
    margin-bottom: 4px;
}

.prize-text small {
    color: #666;
    font-size: 0.8rem;
    line-height: 1.2;
}

/* ============================================
   SECCIÓN DEL HOST
   ============================================ */
.trivia-host {
    display: flex;
    align-items: center;
    margin: 8px 12px 6px 12px;
    padding: 6px 8px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.host-label {
    font-weight: 600;
    color: var(--col-pri);
    margin-right: 8px;
    font-size: 0.9rem;
}

.pic-circular-host {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 8px;
    border: 2px solid var(--col-pri);
    flex-shrink: 0;
}

.host-name {
    font-weight: 600;
    color: var(--col-dar);
    font-size: 0.9rem;
}

/* ============================================
   INFORMACIÓN DE TRIVIA
   ============================================ */
.trivia-info {
    margin: 6px 12px;
}

.info-item {
    display: flex;
    align-items: center;
    margin: 3px 0;
    font-size: 0.85rem;
}

.info-item i {
    margin-right: 6px;
    color: var(--col-pri);
    width: 14px;
    font-size: 0.8rem;
}

.info-item strong {
    color: var(--col-dar);
}

/* ============================================
   SECCIÓN DE TIEMPO
   ============================================ */
.time-section {
    margin: 6px 12px;
    padding: 6px;
    border-radius: 6px;
    background: #f8f9fa;
}

.time-section.live {
    background: linear-gradient(135deg, #ffebee, #fce4ec);
    border-left: 3px solid #f44336;
}

.time-section.paused {
    background: linear-gradient(135deg, #f3e5f5, #e1bee7);
    border-left: 3px solid #9c27b0;
}

.time-section.finished {
    background: linear-gradient(135deg, #e8f5e8, #c8e6c9);
    border-left: 3px solid #4caf50;
}

.time-section i {
    color: var(--col-pri);
    margin-right: 6px;
}

/* ============================================
   CRONÓMETRO / COUNTDOWN
   ============================================ */
.countdown-timer p {
    margin: 0 0 4px 0;
    font-size: 0.9rem;
    color: #555;
    font-weight: 500;
    line-height: 1.2;
}

.countdown-timer h1 {
    margin: 0;
    font-size: 1.4rem;
    color: var(--col-pri);
    font-weight: bold;
    line-height: 1.1;
}

/* Asegurar que countdown-timer tenga tamaño base aumentado */
.countdown-timer {
    font-size: 1.5rem !important;
}

/* EXCLUSIÓN: Mantener tamaños originales en time-section live y progress-section */
.time-section.live .countdown-timer,
.time-section.live .countdown-timer p,
.time-section.live .countdown-timer h1,
.progress-section .countdown-timer,
.progress-section .countdown-timer p,
.progress-section .countdown-timer h1 {
    font-size: inherit !important;
}

.time-section.live span,
.progress-section span {
    font-size: 0.85rem !important;
}

/* ============================================
   SECCIÓN DE PROGRESO
   ============================================ */
.progress-section {
    margin: 6px 12px;
    padding: 6px;
    background: #f0f7ff;
    border-radius: 6px;
    border-left: 3px solid #2196f3;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    margin-top: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #8bc34a);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* ============================================
   ESTADO DE ENTRADA
   ============================================ */
.entry-status {
    margin: 6px 12px 10px 12px;
    padding: 6px;
    border-radius: 6px;
    font-weight: 600;
    text-align: center;
    font-size: 0.85rem;
}

.entry-status.available {
    background: linear-gradient(135deg, #e8f5e8, #c8e6c9);
    color: #2e7d32;
    border: 2px solid #4caf50;
}

.entry-status.unavailable {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    color: #c62828;
    border: 2px solid #f44336;
}

.entry-status.finished {
    background: linear-gradient(135deg, #f3e5f5, #e1bee7);
    color: #6a1b9a;
    border: 2px solid #9c27b0;
}

.entry-status i {
    margin-right: 4px;
}

.entry-status small {
    display: block;
    margin-top: 2px;
    font-size: 0.75rem;
    opacity: 0.8;
}

/* ============================================
   BOTÓN JUGAR
   ============================================ */
.play-button-container {
    margin: 10px 12px;
    padding: 0;
    display: flex;
    justify-content: center;
}

.play-button {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.play-button:hover {
    background: linear-gradient(135deg, #45a049, #388e3c);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.play-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.play-button i {
    font-size: 1.1rem;
}

.play-button span {
    font-size: 1rem;
    font-weight: 600;
}

/* ============================================
   INFORMACIÓN DEL GANADOR
   ============================================ */
.winner-info {
    margin-top: 6px;
    padding: 6px;
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    border-radius: 6px;
    border-left: 3px solid #ff9800;
}

.winner-label {
    font-weight: bold;
    color: #e65100;
    display: block;
    margin-bottom: 4px;
    font-size: 0.85rem;
}

.winner-container {
    display: flex;
    align-items: center;
}

.winner-pic {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 6px;
    border: 2px solid #ff9800;
}

.winner-name {
    font-weight: 600;
    color: var(--col-dar);
    font-size: 0.85rem;
}

.winner-city {
    display: block;
    font-size: 0.75rem;
    color: #666;
    margin-top: 2px;
}

/* ============================================
   LAYOUT Y CONTENEDORES
   ============================================ */
.trivias-container {
    display: grid;
    gap: 20px;
    padding: 20px;
}

.trivias-main-container {
    max-width: 100%;
    margin: 0 auto;
}

.trivias-heading {
    text-align: center;
    padding: 20px;
    margin-bottom: 0;
}

.trivias-heading h1 {
    margin-bottom: 10px;
}

.trivias-heading p {
    margin-bottom: 0;
    color: #666;
}

/* ============================================
   EFECTOS VISUALES PARA CRONÓMETROS
   ============================================ */

/* Cronómetro en rojo cuando queda menos de 1 minuto */
.countdown-warning {
    background: linear-gradient(135deg, #ffebee, #ffcdd2) !important;
    border: 2px solid #f44336 !important;
    border-radius: 8px;
    padding: 8px;
}

.countdown-warning h1 {
    color: #d32f2f !important;
    text-shadow: 0 0 10px rgba(244, 67, 54, 0.3);
}

.countdown-warning p {
    color: #c62828 !important;
    font-weight: bold;
}

/* Cronómetro agrandado y parpadeando cuando quedan menos de 10 segundos */
.countdown-critical {
    background: linear-gradient(135deg, #ffebee, #ff8a80) !important;
    border: 3px solid #f44336 !important;
    border-radius: 10px;
    padding: 12px;
    transform: scale(1.1);
    animation: countdown-pulse 0.8s infinite alternate;
    box-shadow: 0 0 20px rgba(244, 67, 54, 0.4);
}

.countdown-critical h1 {
    color: #b71c1c !important;
    font-size: 2rem !important;
    text-shadow: 0 0 15px rgba(244, 67, 54, 0.5);
    animation: countdown-flash 0.5s infinite alternate;
}

.countdown-critical p {
    color: #d32f2f !important;
    font-weight: bold;
    font-size: 1.1rem !important;
}

/* Estilos para cronómetros en segundos (menos de 1 minuto) */
.countdown-seconds h1 {
    font-size: 1.82rem !important;
    color: #d32f2f !important;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(244, 67, 54, 0.3);
}

/* Efecto de parpadeo para menos de 10 segundos */
.countdown-blink h1 {
    animation: countdown-blink-text 0.6s infinite alternate;
}

/* Estilo cuando llega a cero */
.countdown-start {
    background: linear-gradient(135deg, #e8f5e8, #c8e6c9) !important;
    border: 3px solid #4caf50 !important;
    border-radius: 10px;
    padding: 12px;
    animation: countdown-celebration 1s infinite alternate;
    box-shadow: 0 0 25px rgba(76, 175, 80, 0.4);
}

.countdown-start-message {
    color: #2e7d32 !important;
    font-size: 1.8rem !important;
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
    animation: countdown-bounce 0.6s infinite alternate;
}

.countdown-start p {
    color: #388e3c !important;
    font-weight: bold;
    font-size: 1.2rem !important;
}

/* ============================================
   ANIMACIONES DEL CRONÓMETRO
   ============================================ */
@keyframes countdown-pulse {
    0% { 
        transform: scale(1.1);
        box-shadow: 0 0 20px rgba(244, 67, 54, 0.4);
    }
    100% { 
        transform: scale(1.15);
        box-shadow: 0 0 30px rgba(244, 67, 54, 0.6);
    }
}

@keyframes countdown-flash {
    0% { 
        opacity: 1;
        text-shadow: 0 0 15px rgba(244, 67, 54, 0.5);
    }
    100% { 
        opacity: 0.7;
        text-shadow: 0 0 25px rgba(244, 67, 54, 0.8);
    }
}

@keyframes countdown-blink-text {
    0% { 
        opacity: 1;
        transform: scale(1);
        text-shadow: 0 0 10px rgba(244, 67, 54, 0.3);
    }
    100% { 
        opacity: 0.6;
        transform: scale(1.05);
        text-shadow: 0 0 20px rgba(244, 67, 54, 0.7);
    }
}

@keyframes countdown-celebration {
    0% { 
        transform: scale(1);
        box-shadow: 0 0 25px rgba(76, 175, 80, 0.4);
    }
    100% { 
        transform: scale(1.05);
        box-shadow: 0 0 35px rgba(76, 175, 80, 0.6);
    }
}

@keyframes countdown-bounce {
    0% { 
        transform: scale(1);
    }
    100% { 
        transform: scale(1.05);
    }
}

/* ============================================
   MEDIA QUERIES - RESPONSIVE
   ============================================ */

/* Desktop: 3 columnas */
@media (min-width: 1200px) {
    .trivias-container {
        grid-template-columns: repeat(3, 1fr);
        max-width: 1200px;
        margin: 0 auto;
    }
}

/* Tablet: 2 columnas */
@media (min-width: 768px) and (max-width: 1199px) {
    .trivias-container {
        grid-template-columns: repeat(2, 1fr);
        max-width: 800px;
        margin: 0 auto;
    }
}

/* Mobile: 1 columna con altura optimizada */
@media (max-width: 767px) {
    .trivias-main-container {
        padding: 0;
    }

    .trivias-heading {
        padding: 15px 15px 10px 15px;
    }

    .trivias-heading h1 {
        font-size: 1.8rem;
        margin-bottom: 8px;
    }

    .trivias-heading p {
        font-size: 0.9rem;
    }

    .trivias-container {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 0 15px 15px 15px;
        min-height: calc(100vh - 180px);
    }

    .trivia-card {
        max-height: 55vh;
        margin-bottom: 0;
        overflow: hidden;
    }

    .trivia-status {
        font-size: 0.7rem;
        padding: 3px 6px;
    }

    .trivia-title {
        font-size: 1.1rem;
        margin: 8px 10px 6px 10px;
        line-height: 1.1;
        padding-bottom: 6px;
    }

    .trivia-prize {
        margin: 6px 10px;
        padding: 8px;
        flex-direction: row;
    }

    .prize-image {
        width: 60px;
        height: 60px;
        margin-right: 10px;
    }

    .prize-text strong {
        font-size: 0.9rem;
    }

    .prize-text small {
        font-size: 0.75rem;
    }

    .trivia-host {
        margin: 6px 10px 4px 10px;
        padding: 4px 6px;
    }

    .host-label {
        font-size: 0.8rem;
        margin-right: 6px;
    }

    .pic-circular-host {
        width: 28px;
        height: 28px;
        margin-right: 6px;
    }

    .host-name {
        font-size: 0.85rem;
    }

    .trivia-info {
        margin: 4px 10px;
    }

    .info-item {
        font-size: 0.8rem;
        margin: 2px 0;
    }

    .time-section,
    .progress-section,
    .entry-status {
        margin: 4px 10px;
        padding: 4px;
    }

    .countdown-timer h1 {
        font-size: 1.35rem;
    }

    .entry-status {
        margin: 4px 10px 8px 10px;
        padding: 4px;
    }

    .entry-status small {
        margin-top: 1px;
    }

    /* Botón Jugar en mobile */
    .play-button-container {
        margin: 6px 10px 8px 10px;
    }

    .play-button {
        padding: 10px 20px;
        font-size: 0.9rem;
        min-width: 100px;
    }

    .play-button i {
        font-size: 1rem;
    }

    .play-button span {
        font-size: 0.9rem;
    }

    /* Paginación en mobile */
    .pagination-container {
        margin: 15px 0;
        padding: 0 15px;
    }
}

/* Mobile pequeño */
@media (max-width: 480px) {
    .trivias-heading h1 {
        font-size: 1.6rem;
    }

    .trivias-heading p {
        font-size: 0.85rem;
    }

    .trivia-card {
        max-height: 50vh;
    }

    .trivias-container {
        padding: 0 10px 10px 10px;
        gap: 10px;
    }

    .trivia-title {
        font-size: 1rem;
        margin: 6px 8px 4px 8px;
        padding-bottom: 4px;
    }

    .trivia-prize {
        margin: 4px 8px;
        padding: 6px;
    }

    .prize-image {
        width: 50px;
        height: 50px;
        margin-right: 8px;
    }

    .prize-text strong {
        font-size: 0.85rem;
    }

    .prize-text small {
        font-size: 0.7rem;
    }

    .trivia-host {
        margin: 4px 8px 3px 8px;
        padding: 3px 4px;
    }

    .host-label {
        font-size: 0.75rem;
        margin-right: 4px;
    }

    .pic-circular-host {
        width: 24px;
        height: 24px;
        margin-right: 4px;
    }

    .host-name {
        font-size: 0.8rem;
    }

    .trivia-info,
    .time-section,
    .progress-section,
    .entry-status {
        margin: 3px 8px;
        padding: 3px;
    }

    .countdown-timer h1 {
        font-size: 1.35rem;
    }

    .info-item {
        font-size: 0.75rem;
        margin: 1px 0;
    }

    .entry-status {
        margin: 3px 8px 6px 8px;
        padding: 3px;
    }

    /* Botón Jugar en mobile pequeño */
    .play-button-container {
        margin: 4px 8px 6px 8px;
    }

    .play-button {
        padding: 8px 16px;
        font-size: 0.8rem;
        min-width: 90px;
    }

    .play-button i {
        font-size: 0.9rem;
    }

    .play-button span {
        font-size: 0.8rem;
    }
}

