/**
 * Notice Cards - Sistema unificado de banners de avisos
 * Incluindo: login-needed, address-needed, store-closed
 * Garante altura e largura consistentes em mobile, tablet e desktop
 */

/* ========================================
   CONTAINER E LAYOUT BASE
   ======================================== */

/* Container sempre visível - sem dependência de JavaScript */
#notice-cards-container {
    display: block;
}

/* Skeleton escondido por padrão - JavaScript o mostra temporariamente se quiser */
#notice-skeleton-container {
    display: none;
}

/* Força visibilidade mesmo com v-cloak (sobrescreve Vue.js) */
.notice-cards-row[v-cloak] {
    opacity: 1 !important;
    display: flex !important;
}

.notice-cards-row { 
    display: flex;
    flex-wrap: wrap;
    gap: 16px; 
    width: 100%;
    opacity: 1; /* Sempre visível por padrão */
}

/* Mobile: cada card ocupa 100% */
.notice-cards-row > * {
    flex: 1 1 100%;
    min-width: 0;
}

/* Tablets: cards lado a lado, ocupam espaço disponível */
@media (min-width: 768px) { 
    .notice-cards-row > * {
        flex: 1 1 calc(50% - 8px);
        min-width: 300px;
    }
}

/* Desktop: máximo de 3 cards por linha, ocupam espaço disponível */
@media (min-width: 992px) { 
    .notice-cards-row > * {
        flex: 1 1 calc(33.333% - 11px);
        min-width: 280px;
        max-width: 400px;
    }
}

/* Quando há apenas um card, full-width */
.notice-cards-row.single { 
    display: block;
}

.notice-cards-row.single > * {
    flex: none;
    width: 100%;
    max-width: 100%;
}

/* ========================================
   ESTILO BASE DO CARD
   ======================================== */

.notice-card { 
    background: #fff; 
    border: 1px solid #eef0f4; 
    border-radius: 16px; 
    box-shadow: 0 8px 24px rgba(37, 44, 97, 0.06); 
    text-align: center; 
    padding: 20px 16px;
    /* Garante altura mínima consistente */
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

/* Anima cards quando têm classe de animação */
.notice-card.animate {
    animation: slideIn 0.4s ease-out forwards;
}

.notice-card.animate:nth-child(1) { animation-delay: 0.1s; }
.notice-card.animate:nth-child(2) { animation-delay: 0.2s; }
.notice-card.animate:nth-child(3) { animation-delay: 0.3s; }

@keyframes slideIn {
    from { 
        opacity: 0; 
        transform: translateY(20px) scale(0.95);
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1);
    }
}

/* Variação hero (quando é o único card) */
.notice-card.hero { 
    padding: 28px 24px; 
    border-radius: 20px; 
    box-shadow: 0 14px 40px rgba(37, 44, 97, 0.10);
    min-height: 200px;
}

/* Hover effect suave */
.notice-card:hover {
    box-shadow: 0 12px 32px rgba(37, 44, 97, 0.08);
    transform: translateY(-2px);
}

/* ========================================
   TIPOGRAFIA DO CARD
   ======================================== */

.notice-card h4 { 
    font-weight: 800; 
    font-size: 20px;
    margin: 0 0 8px 0;
    color: #1f2937;
    line-height: 1.3;
}

.notice-card p { 
    color: #555; 
    margin: 0 0 12px 0;
    font-size: 15px;
    line-height: 1.5;
}

.notice-card a { 
    text-decoration: none; 
}

.notice-card.hero h4 { 
    font-size: 22px; 
    margin-bottom: 10px; 
}

/* ========================================
   ACTIONS E BOTÕES
   ======================================== */

.notice-actions { 
    display: inline-flex; 
    gap: 10px; 
    margin-top: 8px;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
}

.notice-card .btn-cta { 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    padding: 12px 20px; 
    border-radius: 12px; 
    font-weight: 700; 
    font-size: 15px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
    min-width: 120px;
}

.notice-card .btn-cta.btn-primary { 
    background: linear-gradient(135deg, #1f2937, #374151); 
    color: #fff; 
    box-shadow: 0 6px 16px rgba(31, 41, 55, 0.25); 
}

.notice-card .btn-cta.btn-primary:hover { 
    filter: brightness(1.1); 
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(31, 41, 55, 0.35); 
}

.notice-card .btn-cta.btn-secondary { 
    background: #f9fafb; 
    color: #111; 
    border-color: #e5e7eb; 
}

.notice-card .btn-cta.btn-secondary:hover { 
    background: #eef2f7;
    border-color: #d1d5db;
}

/* ========================================
   RESPONSIVIDADE - MOBILE
   ======================================== */

@media (max-width: 767.98px) {
    .notice-cards-row { 
        gap: 12px; 
    }
    
    .notice-card { 
        padding: 16px 14px; 
        border-radius: 12px;
        min-height: 160px;
    }
    
    .notice-card h4 { 
        font-size: 18px; 
    }
    
    .notice-card p { 
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    /* Login card: botões em grid lado a lado */
    .login-notice-card .notice-actions { 
        display: grid; 
        grid-template-columns: 1fr 1fr; 
        gap: 8px; 
        width: 100%; 
    }
    
    .login-notice-card .btn-cta { 
        padding: 10px 12px; 
        border-radius: 10px; 
        font-size: 14px;
        min-width: auto;
    }
    
    .login-notice-card { 
        padding: 14px 12px;
        min-height: 160px;
    }
    
    /* Card hero em mobile */
    .notice-cards-row.single .notice-card.hero { 
        padding: 18px 16px;
        min-height: 180px;
    }
    
    .notice-card .btn-cta {
        font-size: 14px;
        padding: 10px 16px;
        min-width: 100px;
    }
}

/* ========================================
   RESPONSIVIDADE - TABLET
   ======================================== */

@media (min-width: 768px) and (max-width: 991.98px) {
    .notice-card {
        min-height: 170px;
        padding: 18px;
    }
    
    .notice-card h4 {
        font-size: 19px;
    }
    
    .notice-card .btn-cta {
        font-size: 14px;
        padding: 11px 18px;
    }
}

/* ========================================
   AJUSTES ESPECÍFICOS POR TIPO
   ======================================== */

/* Login card */
#vue-login-needed { 
    display: contents; 
}

/* Address card */
#vue-address-needed { 
    display: contents; 
}

/* Schedule/Store closed card - usa estilos base */

/* ========================================
   ESTADOS E VARIAÇÕES
   ======================================== */

/* Card com ícone (opcional para futuro) */
.notice-card.with-icon {
    padding-top: 24px;
}

.notice-card-icon {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.8;
}

/* Card de aviso/warning */
.notice-card.warning {
    border-color: #fef3c7;
    background: #fffbeb;
}

.notice-card.warning h4 {
    color: #92400e;
}

.notice-card.warning p {
    color: #78350f;
}

/* Card de erro */
.notice-card.error {
    border-color: #fecaca;
    background: #fef2f2;
}

.notice-card.error h4 {
    color: #991b1b;
}

.notice-card.error p {
    color: #7f1d1d;
}

/* Card de sucesso */
.notice-card.success {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.notice-card.success h4 {
    color: #166534;
}

.notice-card.success p {
    color: #14532d;
}

/* ========================================
   UTILITÁRIOS
   ======================================== */

/* Forçar altura igual em todos os cards de uma row */
.notice-cards-row.equal-height .notice-card {
    height: 100%;
}

/* ========================================
   SKELETON LOADING / PLACEHOLDER
   ======================================== */

/* Skeleton para cards enquanto carregam */
.notice-card-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border: 1px solid #eef0f4;
    border-radius: 16px;
    min-height: 180px;
    padding: 20px 16px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.notice-card-skeleton-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.notice-card-skeleton-title {
    width: 70%;
    height: 24px;
    background: #e0e0e0;
    border-radius: 8px;
}

.notice-card-skeleton-text {
    width: 90%;
    height: 16px;
    background: #e8e8e8;
    border-radius: 6px;
}

.notice-card-skeleton-text:last-of-type {
    width: 80%;
}

.notice-card-skeleton-button {
    width: 140px;
    height: 44px;
    background: #d8d8d8;
    border-radius: 12px;
    margin-top: 8px;
}

/* Ocultar skeleton quando conteúdo carrega */
.notice-cards-row:not(.loading) .notice-card-skeleton {
    display: none;
}

/* Estado de carregamento */
.notice-cards-row.loading .notice-card {
    display: none;
}

/* Previne FOUC apenas para elementos Vue com v-cloak */
[v-cloak] {
    opacity: 0;
}

/* Quando Vue está pronto */
.notice-cards-row:not([v-cloak]) .notice-card.animate {
    animation: slideIn 0.4s ease-out forwards;
}

/* Centralização perfeita do conteúdo */
.notice-card-content {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

/* Espaçamento consistente */
.notice-cards-spacing {
    margin-top: 16px;
    margin-bottom: 16px;
}

@media (max-width: 767.98px) {
    .notice-cards-spacing {
        margin-top: 12px;
        margin-bottom: 12px;
    }
}
