/**
 * Componente Tabela de Países
 * Estilos baseados no design do Figma
 */

 .tabela-de-entes {
    padding: var(--spacing-lg) 0;
    background-color: var(--color-background);
}

.tabela-de-entes__container {
    max-width: 808px;
    margin: 0 auto;
    padding: 0 20px;
}

.tabela-de-entes__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 16px;
}
.tabela-de-entes__half {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.tabela-de-entes__column {
    display: flex;
    flex-direction: column;
}

.tabela-de-entes__item {
    display: flex;
    align-items: center;
    padding: 4px 0;
    font-weight: 600;
}
.tabela-de-entes__item a {
    text-decoration: none;
    color: var(--neutral-0);
}
.tabela-de-entes__item a:hover {
    color: var(--success-300);
}

.tabela-de-entes__country-name {
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.2;
    color: var(--color-text-primary);
    text-align: left;
    display: block;
    width: 100%;
}

/* Responsividade - Mobile */
@media (max-width: 768px) {
    .tabela-de-entes__grid {
        /* grid-template-columns: repeat(2, 1fr); */
        display: flex;
        align-items: flex-start;
        gap: 0;
        margin-left: -8px;
        margin-right: -8px;
    }
    .tabela-de-entes__half {
        width: 50%;
        grid-template-columns: repeat(1, 1fr);
        gap: 0;
    }
    .tabela-de-entes__column:nth-child(2n) {
        /* padding-left: 8px; */
    }
    .tabela-de-entes__column:nth-child(2n+1) {
        /* padding-right: 8px; */
    }
}

/* Responsividade - Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .tabela-de-entes__grid {
        /* grid-template-columns: repeat(3, 1fr); */
    }
}

/* Estados de hover para interatividade */
.tabela-de-entes__item:hover .tabela-de-entes__country-name {
    color: var(--color-primary);
    transition: color 0.2s ease;
}

/* Animações de entrada */
.tabela-de-entes.animar {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.tabela-de-entes.animar.animar--active {
    opacity: 1;
    transform: translateY(0);
}

/* Animações escalonadas para os itens */
.tabela-de-entes.animar--active .tabela-de-entes__item {
    animation: fadeInUp 0.4s ease-out forwards;
}

.tabela-de-entes.animar--active .tabela-de-entes__item:nth-child(1) { animation-delay: 0.1s; }
.tabela-de-entes.animar--active .tabela-de-entes__item:nth-child(2) { animation-delay: 0.15s; }
.tabela-de-entes.animar--active .tabela-de-entes__item:nth-child(3) { animation-delay: 0.2s; }
.tabela-de-entes.animar--active .tabela-de-entes__item:nth-child(4) { animation-delay: 0.25s; }
.tabela-de-entes.animar--active .tabela-de-entes__item:nth-child(5) { animation-delay: 0.3s; }
.tabela-de-entes.animar--active .tabela-de-entes__item:nth-child(6) { animation-delay: 0.35s; }
.tabela-de-entes.animar--active .tabela-de-entes__item:nth-child(7) { animation-delay: 0.4s; }
.tabela-de-entes.animar--active .tabela-de-entes__item:nth-child(8) { animation-delay: 0.45s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estados de loading */
.tabela-de-entes--loading {
    position: relative;
}

.tabela-de-entes--loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2rem;
    height: 2rem;
    margin: -1rem 0 0 -1rem;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Estados de erro */
.tabela-de-entes--error {
    text-align: center;
    padding: var(--spacing-lg);
    color: var(--color-error);
}

.tabela-de-entes--error .tabela-de-entes__message {
    font-family: var(--font-primary);
    font-size: 1rem;
    line-height: 1.5;
}

/* Acessibilidade */
@media (prefers-reduced-motion: reduce) {
    .tabela-de-entes.animar,
    .tabela-de-entes__item {
        animation: none;
        transition: none;
    }
}

/* Foco para navegação por teclado */
.tabela-de-entes__item:focus-within {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Print styles */
@media print {
    .tabela-de-entes {
        break-inside: avoid;
    }
    
    .tabela-de-entes__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
