/* resources/views/portal/assets/css/responsive.css */

/* ============================================
   RESPONSIVE DESIGN - PORTAL CPJ HUÍLA
   ============================================ */

/* Dispositivos Muito Grandes (Desktop Wide) */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .hero-title {
        font-size: 3.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Dispositivos Grandes (Desktop) */
@media (max-width: 1200px) {
    .container {
        max-width: 1140px;
        padding: 0 15px;
    }
    
    .hero .container {
        gap: 2rem;
    }
    
    .hero-title {
        font-size: 2.8rem;
    }
    
    .news-grid,
    .activities-grid,
    .documents-grid,
    .partnerships-slider {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

/* Dispositivos Médios (Tablets Landscape) */
@media (max-width: 992px) {
    .container {
        max-width: 960px;
    }
    
    /* Layout em coluna única para hero */
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }
    
    .hero-image {
        order: -1;
    }
    
    .hero-image img {
        max-width: 500px;
        margin: 0 auto;
    }
    
    .hero-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    /* Estatísticas em 2 colunas */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .stat-item {
        padding: 1.5rem;
    }
    
    /* Cards em 2 colunas */
    .news-grid,
    .activities-grid,
    .documents-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .partnerships-slider {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
    
    /* Footer em 2 colunas */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Ajustes de tipografia */
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }
    h3 { font-size: 1.4rem; }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .cta-title {
        font-size: 2.2rem;
    }
}

/* Dispositivos Pequenos (Tablets Portrait) */
@media (max-width: 768px) {
    .container {
        max-width: 720px;
        padding: 0 12px;
    }
    
    /* Menu Mobile */
    .navbar-menu {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        padding: 2rem;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 999;
    }
    
    .navbar-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .navbar-toggle {
        display: block;
        background: none;
        border: none;
        font-size: 1.5rem;
        color: var(--primary);
        cursor: pointer;
        padding: 5px;
    }
    
    .navbar-nav {
        flex-direction: column;
        width: 100%;
        gap: 1rem;
    }
    
    .nav-link {
        display: block;
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--gray-light);
    }
    
    .nav-link:last-child {
        border-bottom: none;
    }
    
    .navbar-actions {
        flex-direction: column;
        width: 100%;
        margin-top: 1rem;
        gap: 0.75rem;
    }
    
    /* Hero ajustes */
    .hero {
        padding: 3rem 0;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    /* Cards em 1 coluna */
    .news-grid,
    .activities-grid,
    .documents-grid,
    .partnerships-slider {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .activity-actions {
        flex-direction: column;
    }
    
    .activity-actions .btn {
        width: 100%;
        text-align: center;
    }
    
    /* Document cards em coluna */
    .document-card {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        padding: 1.25rem;
    }
    
    .document-icon {
        font-size: 2.5rem;
    }
    
    .document-actions {
        margin-left: 0;
        width: 100%;
    }
    
    .document-actions .btn {
        width: 100%;
    }
    
    /* Section header em coluna */
    .section-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        margin-bottom: 2rem;
    }
    
    /* Statistics em 2 colunas */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .stat-item {
        padding: 1.25rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    /* CTA section */
    .cta {
        padding: 3rem 0;
    }
    
    .cta-title {
        font-size: 1.8rem;
    }
    
    .cta-text {
        font-size: 1.1rem;
        padding: 0 1rem;
    }
    
    .cta-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .cta-actions .btn {
        width: 100%;
        max-width: 300px;
        margin-bottom: 0.5rem;
    }
    
    /* Footer */
    .footer {
        padding: 3rem 0 1.5rem;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-logo {
        justify-content: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .footer-contact li {
        justify-content: center;
    }
}

/* Dispositivos Muito Pequenos (Celulares) */
@media (max-width: 576px) {
    .container {
        padding: 0 10px;
    }
    
    /* Tipografia reduzida */
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.2rem; }
    
    .hero-title {
        font-size: 1.8rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-actions .btn {
        width: 100%;
        max-width: 280px;
        margin-bottom: 0.75rem;
    }
    
    /* Statistics em 1 coluna */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-item {
        padding: 1.5rem;
    }
    
    /* Cards full width */
    .news-card,
    .activity-card,
    .document-card,
    .partner-card {
        width: 100%;
        margin: 0 auto;
    }
    
    .news-image {
        height: 180px;
    }
    
    /* Activity cards ajustes */
    .activity-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .activity-meta {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    /* Botões full width */
    .btn {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
    }
    
    .btn-lg {
        padding: 14px 24px;
    }
    
    /* Padding sections reduzido */
    .section {
        padding: 2.5rem 0;
    }
    
    .hero {
        padding: 2.5rem 0;
    }
    
    /* Document cards ajustes */
    .document-meta {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    /* Partnership cards */
    .partner-card {
        padding: 1.5rem;
    }
    
    /* Forms responsivos */
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-control {
        width: 100%;
        padding: 12px;
        font-size: 16px; /* Evita zoom no iOS */
    }
    
    /* Modal mobile */
    .modal-content {
        margin: 10px;
        width: calc(100% - 20px);
    }
}

/* Dispositivos Extra Pequenos (Celulares pequenos) */
@media (max-width: 375px) {
    .container {
        padding: 0 8px;
    }
    
    .hero-title {
        font-size: 1.6rem;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .cta-title {
        font-size: 1.6rem;
    }
    
    .cta-text {
        font-size: 1rem;
    }
    
    .footer-bottom p {
        font-size: 0.8rem;
    }
}

/* ============================================
   ORIENTAÇÃO LANDSCAPE
   ============================================ */
@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        padding: 2rem 0;
        min-height: auto;
    }
    
    .hero .container {
        min-height: auto;
    }
    
    .navbar {
        position: relative;
    }
    
    .navbar-menu {
        max-height: 80vh;
        overflow-y: auto;
    }
}

/* ============================================
   IMPRESSÃO
   ============================================ */
@media print {
    .navbar,
    .hero-actions,
    .cta,
    .footer,
    .btn,
    .social-links {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: #000;
        background: #fff;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
    
    .news-grid,
    .activities-grid,
    .documents-grid {
        display: block;
    }
    
    .news-card,
    .activity-card,
    .document-card {
        break-inside: avoid;
        margin-bottom: 20pt;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .news-image,
    .activity-actions,
    .document-actions {
        display: none;
    }
}

/* ============================================
   ACESSIBILIDADE E USABILIDADE
   ============================================ */

/* Melhorar foco para navegação por teclado */
.btn:focus,
.nav-link:focus,
.form-control:focus {
    outline: 3px solid var(--secondary);
    outline-offset: 2px;
}

/* Melhorar contraste para modo alto contraste */
@media (prefers-contrast: high) {
    .btn-primary {
        border: 2px solid currentColor;
    }
    
    .nav-link.active::after {
        height: 3px;
    }
}

/* Suporte para modo escuro */
@media (prefers-color-scheme: dark) {
    .bg-light {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .activity-card,
    .news-card,
    .document-card,
    .partner-card,
    .stat-item {
        background: #2d3748;
        color: #e2e8f0;
        border: 1px solid #4a5568;
    }
    
    .news-title a,
    .activity-title,
    .document-title,
    .partner-name {
        color: #e2e8f0;
    }
    
    .news-excerpt,
    .activity-excerpt,
    .document-description,
    .partner-type {
        color: #cbd5e0;
    }
}

/* ============================================
   ANIMAÇÕES RESPONSIVAS
   ============================================ */

/* Animação de entrada para cards em mobile */
@media (max-width: 768px) {
    .news-card,
    .activity-card,
    .document-card,
    .partner-card {
        animation: slideUp 0.5s ease forwards;
        opacity: 0;
        transform: translateY(20px);
    }
    
    @keyframes slideUp {
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    /* Delay stagger para cards */
    .news-card:nth-child(1) { animation-delay: 0.1s; }
    .news-card:nth-child(2) { animation-delay: 0.2s; }
    .news-card:nth-child(3) { animation-delay: 0.3s; }
}

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

/* Hide/Show classes para diferentes breakpoints */
.hide-on-mobile {
    display: block;
}

.show-on-mobile {
    display: none;
}

@media (max-width: 768px) {
    .hide-on-mobile {
        display: none !important;
    }
    
    .show-on-mobile {
        display: block !important;
    }
}

/* Grid utilities responsivas */
.grid-responsive {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

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

/* Flex utilities responsivas */
.flex-responsive {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

@media (max-width: 768px) {
    .flex-responsive {
        flex-direction: column;
    }
}

/* Container fluid para mobile */
@media (max-width: 768px) {
    .container-fluid {
        padding: 0 15px;
    }
}

/* ============================================
   CORREÇÕES ESPECÍFICAS PARA NAVEGADORES
   ============================================ */

/* Safari iOS específico */
@supports (-webkit-touch-callout: none) {
    .hero {
        min-height: -webkit-fill-available;
    }
    
    input,
    select,
    textarea {
        font-size: 16px; /* Previne zoom no iOS */
    }
}

/* Firefox scrollbar styling */
@-moz-document url-prefix() {
    .navbar-menu {
        scrollbar-width: thin;
        scrollbar-color: var(--primary) var(--gray-light);
    }
}

/* ============================================
   LOADING STATES RESPONSIVOS
   ============================================ */

@media (max-width: 768px) {
    .skeleton {
        animation: skeleton-loading 1.5s infinite;
        background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
        background-size: 200% 100%;
        border-radius: 4px;
    }
    
    @keyframes skeleton-loading {
        0% {
            background-position: 200% 0;
        }
        100% {
            background-position: -200% 0;
        }
    }
    
    .skeleton-text {
        height: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .skeleton-title {
        height: 1.5rem;
        width: 70%;
        margin-bottom: 1rem;
    }
    
    .skeleton-image {
        height: 200px;
        width: 100%;
        margin-bottom: 1rem;
    }
}

/* ============================================
   TOUCH TARGETS PARA MOBILE
   ============================================ */

@media (max-width: 768px) {
    /* Tamanho mínimo para toque recomendado pela WCAG */
    .btn,
    .nav-link,
    .news-link,
    .social-link {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Aumentar padding para inputs em mobile */
    .form-control {
        padding: 15px;
    }
    
    /* Aumentar espaço entre itens clicáveis */
    .navbar-nav {
        gap: 0.75rem;
    }
    
    .hero-actions {
        gap: 1rem;
    }
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS PARA MOBILE
   ============================================ */

@media (max-width: 768px) {
    /* Reduzir efeitos de sombra em mobile para performance */
    .news-card:hover,
    .activity-card:hover,
    .document-card:hover,
    .partner-card:hover {
        transform: none;
        box-shadow: var(--shadow);
    }
    
    /* Desabilitar animações complexas se o usuário preferir */
    @media (prefers-reduced-motion: reduce) {
        *,
        *::before,
        *::after {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }
}