/* =====================================================
   SMART SORTEIOS - CARDS DE GANHADORES
   Arquivo: assets/css/ganhadores-cards.css
   Versão: 1.0.0
   Descrição: CSS compartilhado para cards de ganhadores
              Usado em: index.php e ganhadores.php
   ===================================================== */

/* ===== ESTRUTURA BASE DO CARD ===== */

/* Card de ganhador - altura uniforme */
.card-ganhador {
    min-height: 400px;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #e9ecef;
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    position: relative;
}

/* Borda superior animada */
.card-ganhador::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f59e0b 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-ganhador:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 28px rgba(102, 126, 234, 0.25);
    border-color: #667eea;
}

.card-ganhador:hover::before {
    opacity: 1;
}

/* ===== FOTO DO GANHADOR ===== */

.ganhador-foto {
    padding: 2.5rem 2rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    text-align: center;
}

.ganhador-foto::after {
    content: '🎉';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.5rem;
    opacity: 0.3;
}

.ganhador-foto i {
    font-size: 5rem;
    color: rgba(255, 255, 255, 0.9);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

.card-ganhador:hover .ganhador-foto i {
    transform: scale(1.1) rotate(-5deg);
}

/* ===== INFORMAÇÕES DO GANHADOR ===== */

.ganhador-info {
    padding: 1.75rem;
    background: white;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

/* ===== 1ª LINHA: NOME DA PREMIAÇÃO ===== */

.card-ganhador .ganhador-premiacao {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #667eea;
    padding: 0.625rem 0.875rem;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-radius: 8px;
    border-left: 3px solid #667eea;
    line-height: 1.4;
    margin-bottom: 0 !important;
}

.card-ganhador .ganhador-premiacao i {
    color: #667eea !important;
    font-size: 1.125rem !important;
    flex-shrink: 0;
}

/* ===== 2ª LINHA: NÚMERO DO BILHETE ===== */

.card-ganhador .ganhador-bilhete {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
    padding: 0.875rem 1.25rem !important;
    border-radius: 12px !important;
    font-size: 1.125rem !important;
    font-weight: 700 !important;
    color: #92400e !important;
    border: 2px solid #fcd34d !important;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.25) !important;
    transition: all 0.3s ease;
    margin-bottom: 0 !important;
    width: auto !important;
}

.card-ganhador .ganhador-bilhete i {
    font-size: 1.375rem !important;
    color: #f59e0b !important;
    filter: drop-shadow(0 2px 4px rgba(251, 191, 36, 0.3));
}

/* Remove emoji duplicado do CSS antigo */
.card-ganhador .ganhador-bilhete::before {
    content: none !important;
}

.card-ganhador:hover .ganhador-bilhete {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(251, 191, 36, 0.35) !important;
}

/* ===== 3ª LINHA: POSIÇÃO DO PRÊMIO ===== */

.ganhador-premio {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
    padding: 0.5rem 0;
    border-bottom: 2px solid #f1f5f9;
    margin-bottom: 0 !important;
}

/* ===== 4ª LINHA: VALOR DO PRÊMIO ===== */

.ganhador-valor {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    filter: drop-shadow(0 2px 4px rgba(16, 185, 129, 0.2));
    margin-bottom: 0 !important;
}

/* ===== 5ª LINHA: DATA DO SORTEIO ===== */

.ganhador-data {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
    padding-top: 0.5rem;
    margin-top: auto;
    border-top: 1px solid #f1f5f9;
    margin-bottom: 0 !important;
}

.ganhador-data i {
    color: #f59e0b;
    font-size: 1rem;
}

/* ===== RESPONSIVIDADE ===== */

/* Tablet */
@media (max-width: 768px) {
    .card-ganhador {
        min-height: 380px;
    }
    
    .ganhador-foto {
        padding: 2rem 1.5rem 1.25rem;
    }
    
    .ganhador-foto i {
        font-size: 4rem;
    }
    
    .ganhador-info {
        padding: 1.5rem;
        gap: 0.75rem;
    }
    
    .card-ganhador .ganhador-premiacao {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
    
    .card-ganhador .ganhador-bilhete {
        font-size: 1rem !important;
        padding: 0.75rem 1rem !important;
    }
    
    .card-ganhador .ganhador-bilhete i {
        font-size: 1.25rem !important;
    }
    
    .ganhador-premio {
        font-size: 1rem;
    }
    
    .ganhador-valor {
        font-size: 1.75rem;
    }
    
    .ganhador-data {
        font-size: 0.8125rem;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .card-ganhador {
        min-height: 360px;
    }
    
    .ganhador-foto {
        padding: 1.75rem 1.25rem 1rem;
    }
    
    .ganhador-foto i {
        font-size: 3.5rem;
    }
    
    .ganhador-info {
        padding: 1.25rem;
        gap: 0.625rem;
    }
    
    .card-ganhador .ganhador-premiacao {
        font-size: 0.8125rem;
        padding: 0.5rem 0.625rem;
    }
    
    .card-ganhador .ganhador-bilhete {
        font-size: 0.9375rem !important;
        padding: 0.625rem 0.875rem !important;
    }
    
    .card-ganhador .ganhador-bilhete i {
        font-size: 1.125rem !important;
    }
    
    .ganhador-premio {
        font-size: 0.9375rem;
    }
    
    .ganhador-valor {
        font-size: 1.5rem;
    }
    
    .ganhador-data {
        font-size: 0.75rem;
    }
}

/* ===== AJUSTES PARA CARDS-AJUSTADOS.CSS ===== */

/* Se cards-ajustados.css estiver ativo, manter proporções */
@media (min-width: 769px) {
    .card-ganhador {
        min-height: 400px; /* Garante altura padrão */
    }
}

/* ===== ANIMAÇÕES ===== */

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animação ao carregar cards */
.card-ganhador {
    animation: slideInUp 0.4s ease-out;
}

/* Delay progressivo para múltiplos cards */
.card-ganhador:nth-child(1) { animation-delay: 0.1s; }
.card-ganhador:nth-child(2) { animation-delay: 0.2s; }
.card-ganhador:nth-child(3) { animation-delay: 0.3s; }
.card-ganhador:nth-child(4) { animation-delay: 0.4s; }
.card-ganhador:nth-child(5) { animation-delay: 0.5s; }
.card-ganhador:nth-child(6) { animation-delay: 0.6s; }
/* =====================================================
   CARDS DE SORTEIO AGRUPADO — v2.0
   Usado em: ganhadores.php e index.php (seção ganhadores)
   ===================================================== */

.card-sorteio-resultado {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    margin-bottom: 1rem;
}

.card-sorteio-resultado:hover {
    box-shadow: 0 6px 20px rgba(102,126,234,0.15);
    transform: translateY(-2px);
}

/* Header azul com gradiente do site */
.card-sorteio-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.card-sorteio-header .sorteio-nome {
    color: white;
    font-size: 14px;
    font-weight: 700;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-sorteio-header .sorteio-data {
    color: rgba(255,255,255,0.8);
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Body */
.card-sorteio-body {
    padding: 10px 16px;
}

/* Linha de cada prêmio */
.premio-linha {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
}

.premio-linha:last-child {
    border-bottom: none;
}

/* Badge de posição */
.premio-badge {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

/* Valor */
.premio-valor {
    font-weight: 700;
    color: #059669;
    font-size: 15px;
    min-width: 95px;
    flex-shrink: 0;
}

/* Bilhete — destaque principal */
.premio-bilhete {
    font-family: 'Courier New', monospace;
    font-weight: 900;
    color: #1e3a8a;
    background: #eff6ff;
    border: 2px solid #3b82f6;
    border-radius: 7px;
    padding: 4px 12px;
    font-size: 17px;
    letter-spacing: 2px;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(59,130,246,0.15);
}

/* Ponto */
.premio-ponto {
    color: #64748b;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

/* Linha do Giro */
.giro-linha {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 0 4px;
    font-size: 13px;
    color: #7c3aed;
    font-weight: 600;
    border-top: 1px solid #f1f5f9;
    margin-top: 2px;
}

.giro-linha i {
    font-size: 14px;
    color: #7c3aed;
    flex-shrink: 0;
}

.giro-linha .giro-info {
    color: #64748b;
    font-weight: 400;
    font-size: 12px;
}

/* Accordion do Giro */
.giro-accordion {
    margin-top: 4px;
    border-top: 1px dashed #e9d5ff;
    padding-bottom: 4px;
}

.giro-accordion-btn {
    width: 100%;
    background: none;
    border: none;
    padding: 7px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #7c3aed;
    cursor: pointer;
    text-align: left;
}

.giro-accordion-btn i {
    transition: transform 0.2s ease;
    font-size: 11px;
}

.giro-accordion-btn.aberto i {
    transform: rotate(180deg);
}

.giro-lista {
    display: none;
    padding: 4px 0 2px;
}

.giro-lista.aberta {
    display: block;
}

.giro-item-linha {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid #faf5ff;
    font-size: 13px;
}

.giro-item-linha:last-child {
    border-bottom: none;
}

.giro-item-num {
    width: 22px;
    height: 22px;
    background: #7c3aed;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.giro-item-bilhete {
    font-family: 'Courier New', monospace;
    font-weight: 900;
    color: #1e3a8a;
    background: #eff6ff;
    border: 2px solid #3b82f6;
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 15px;
    letter-spacing: 2px;
    flex-shrink: 0;
}

.giro-item-ponto {
    color: #64748b;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

/* Link Ver todos */
.ganhadores-ver-todos {
    text-align: center;
    margin-top: .75rem;
}

.ganhadores-ver-todos a {
    color: #667eea;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 20px;
    border: 1px solid #667eea;
    border-radius: 20px;
    transition: all 0.2s ease;
}

.ganhadores-ver-todos a:hover {
    background: #eff6ff;
}

/* Mobile */
@media (max-width: 576px) {
    .card-sorteio-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .premio-ponto { display: none; }
    .card-sorteio-body { padding: 8px 12px; }
}

/* =====================================================
   CONSULTAR BILHETE — correção mobile
   Sobrescreve consulta-resultado.css que remove bordas
   e usa 100vw nos cards de resultado
   ===================================================== */

@media (max-width: 768px) {
    body section#consultar-bilhete.consulta-section .consulta-card {
        margin-left: 1rem !important;
        margin-right: 1rem !important;
        border-radius: 16px !important;
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
        overflow: hidden !important;
    }

    /* Resultado dentro do card — não extrapola */
    body section#consultar-bilhete #resultadoConsulta {
        width: 100% !important;
        max-width: 100% !important;
        margin: 1rem 0 0 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }

    body section#consultar-bilhete .card-resultado-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 0 0.75rem 0 !important;
        border-radius: 12px !important;
        box-sizing: border-box !important;
    }

    body section#consultar-bilhete .card-resultado {
        border-radius: 12px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
}

@media (max-width: 480px) {
    body section#consultar-bilhete.consulta-section .consulta-card {
        margin-left: 0.75rem !important;
        margin-right: 0.75rem !important;
        border-radius: 12px !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

@media (max-width: 400px) {
    body section#consultar-bilhete.consulta-section .consulta-card {
        margin-left: 0.5rem !important;
        margin-right: 0.5rem !important;
        border-radius: 10px !important;
    }
}

/* Mobile — padding lateral menor para não apertar o input */
@media (max-width: 576px) {
    .ganhadores-section .container,
    .ganhadores-container .container,
    .consulta-section .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        border-radius: 0.75rem;
    }

    .consulta-card {
        padding: 1.5rem 0.75rem !important;
    }

    .input-bilhete {
        font-size: 1.25rem !important;
    }

    /* Ponto truncado no mobile mas visível */
    .premio-ponto {
        max-width: 100px;
    }
}

/* Galaxy S6 Edge e similares (360px) */
@media (max-width: 375px) {
    .ganhadores-section .container,
    .ganhadores-container .container,
    .consulta-section .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .consulta-card {
        padding: 1.25rem 0.5rem !important;
    }

    .premio-ponto {
        max-width: 80px;
        font-size: 11px;
    }
}

/* =====================================================
   RODAPÉ DO CARD — botões PDF e Compartilhar
   ===================================================== */

.card-sorteio-footer {
    padding: 10px 16px 12px;
    display: flex;
    gap: 8px;
    border-top: 1px solid #f1f5f9;
}

.btn-card-acao {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: all 0.2s ease;
}

.btn-card-pdf {
    background: #eff6ff;
    color: #1e3a8a;
    border: 1px solid #bfdbfe;
}

.btn-card-pdf:hover {
    background: #dbeafe;
    color: #1e3a8a;
}

.btn-card-compartilhar {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.btn-card-compartilhar:hover {
    background: #dcfce7;
}