/**
 * CSS Responsivo para Portal do Filiado
 * Otimizado para dispositivos móveis
 *
 * @author Eduardo Santos - Portal do Filiado
 * @date 2025-11-02
 */

/* Reset e Base */
* {
    box-sizing: border-box;
}

.portal-card .text-muted {
    text-align: center;
    margin-bottom: 10px !important;
}

/* Mobile First - Base Styles */
body {
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Cards Responsivos */
.portal-card {
    margin: 20px !important;
}

.portal-card1 {
    margin: 0 10px !important;
}

.portal-card .card-body {
    padding: 15px;
}

.info-card {
    min-height: 165px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Tabelas Responsivas */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-portal {
    font-size: 0.9rem;
}

.table-portal th,
.table-portal td {
    white-space: nowrap;
    padding: 8px;
}

/* Formulários Responsivos */
.form-control,
.form-select {
    font-size: 16px;
    /* Evita zoom no iOS */
}

/* Botões Responsivos */
.btn {
    padding: 10px 20px;
    font-size: 14px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Navbar Responsivo */
.navbar {
    padding: 10px 0;
}

.navbar-brand {
    font-size: 1.2rem;
}

/* Dropdown Menu */
.dropdown-menu {
    font-size: 14px;
}

.dropdown-item {
    padding: 10px 15px;
}

/* Modais Responsivos */
.modal-dialog {
    margin: 10px;
}

.modal-body {
    padding: 15px;
}

/* Alertas */
.alert-portal {
    font-size: 14px;
    padding: 12px;
}

/* Footer */
.footer-portal {
    font-size: 12px;
    padding: 15px 0;
}

/* Tablets (768px e acima) */
@media (min-width: 768px) {
    body {
        font-size: 16px;
    }

    .portal-card .card-body {
        padding: 20px;
    }

    .info-card {
        min-height: 220px;
    }

    .table-portal {
        font-size: 1rem;
    }

    .table-portal th,
    .table-portal td {
        padding: 12px;
    }

    .btn {
        padding: 12px 24px;
        font-size: 16px;
    }

    .navbar-brand {
        font-size: 1.5rem;
    }

    .modal-dialog {
        margin: 30px auto;
    }

    .footer-portal {
        font-size: 14px;
        padding: 20px 0;
    }
}

/* Desktop (992px e acima) */
@media (min-width: 992px) {
    .portal-card .card-body {
        padding: 25px;
    }

    .info-card {
        min-height: 240px;
    }

    .table-portal th,
    .table-portal td {
        white-space: normal;
    }
}

/* Touch Targets - Mínimo 44x44px para acessibilidade */
.btn,
.nav-link,
.dropdown-item,
.form-check-input {
    /* min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center; */
}

/* Melhorias de Acessibilidade */
:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Animações Suaves */
* {
    transition: all 0.3s ease;
}

/* Scroll Suave */
html {
    scroll-behavior: smooth;
}

/* Otimizações para Performance */
.info-card,
.portal-card {
    will-change: transform;
}

/* Landscape Mobile */
@media (max-width: 767px) and (orientation: landscape) {
    .info-card {
        min-height: 150px;
    }

    .modal-dialog {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* Impressão */
@media print {

    .navbar,
    .footer-portal,
    .btn,
    .dropdown {
        display: none !important;
    }

    .portal-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Dark Mode Support (opcional) */
@media (prefers-color-scheme: dark) {
    /* Implementar se necessário */
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Contato Item (Atualização Cadastral) */
.contato-item {
    margin-bottom: 10px;
}

@media (max-width: 767px) {

    .contato-item .col-md-3,
    .contato-item .col-md-6 {
        margin-bottom: 10px;
    }
}

/* Upload de Arquivos */
.form-control[type="file"] {
    padding: 8px;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

@media (max-width: 767px) {
    .status-badge {
        font-size: 0.75rem;
        padding: 6px 12px;
    }
}

/* Cards de Eventos */
.card {
    margin-bottom: 15px;
}

.card-body {
    padding: 15px;
}

@media (min-width: 768px) {
    .card-body {
        padding: 20px;
    }
}

/* Compact lists (mobile/tablet) */
@media (max-width: 1199px) {
    .compact-tabs {
        border-bottom: none;
        gap: 8px;
        margin-bottom: 12px;
        flex-wrap: wrap;
    }

    .compact-tabs .nav-link {
        border: 1px solid rgba(0, 0, 0, 0.12);
        border-radius: 999px;
        padding: 6px 10px;
        font-size: 1.12rem;
        color: var(--dark-color);
        min-height: 32px;
        min-width: 0;
    }

    .compact-tabs .nav-link.active {
        background: #495057;
        color: #ffffff;
        border-color: transparent;
    }

    .compact-accordion .accordion-item {
        border: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
        border-radius: 0;
    }

    .compact-accordion .accordion-button {
        background: transparent !important;
        color: var(--dark-color) !important;
        padding: 10px 0;
        box-shadow: none;
    }

    .compact-accordion .accordion-button:focus {
        box-shadow: none;
    }

    .compact-accordion .accordion-button::after {
        display: none !important;
    }

    .compact-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        width: 100%;
    }

    .compact-row-main {
        flex: 1 1 auto;
        min-width: 0;
    }

    .compact-title {
        font-size: 0.95rem;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .compact-sub {
        display: flex;
        align-items: center;
        gap: 6px;
        flex-wrap: wrap;
        margin-top: 4px;
    }

    .badge-compact {
        font-size: 0.65rem;
        padding: 2px 6px;
        border-radius: 999px;
    }

    .compact-meta {
        font-size: 0.75rem;
        color: #6c757d;
        margin-top: 4px;
    }

    .compact-chevron {
        font-size: 1.1rem;
        color: #6c757d;
        transition: transform 0.2s ease;
    }

    .compact-accordion .accordion-button:not(.collapsed) .compact-chevron {
        transform: rotate(90deg);
    }

    .compact-body {
        padding: 10px 0 12px;
        font-size: 0.85rem;
    }

    .compact-section {
        margin-bottom: 10px;
    }

    .compact-section-title {
        font-weight: 600;
        font-size: 0.75rem;
        color: #495057;
        margin-bottom: 6px;
        text-transform: uppercase;
        letter-spacing: 0.02em;
    }

    .compact-participants,
    .compact-info {
        display: grid;
        gap: 4px;
    }

    .compact-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 10px;
    }

    .compact-actions .btn {
        padding: 6px 10px;
        font-size: 0.75rem;
        min-height: 32px;
        min-width: 32px;
    }

    .compact-actions .btn i {
        margin-right: 4px;
    }

    .compact-scroll {
        max-height: 60vh;
        overflow-y: auto;
        padding-right: 4px;
        -webkit-overflow-scrolling: touch;
    }
}

/* Melhorias para iOS */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
textarea,
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Melhorias para Android */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Loading States */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Skeleton Loading (opcional) */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

    100% {
        background-position: -200% 0;
    }
}

@media screen and (min-width: 265px) and (max-width: 760px) {
    body .portal-card1 {
        line-height: normal;
    }
}

/* Garantia de ícones visíveis no mobile (menu e cards do dashboard) */
@media (max-width: 991.98px) {
    .portal-header .navbar-brand,
    .portal-header .navbar-nav .nav-link {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .portal-header .navbar-brand i[class*="bi-"],
    .portal-header .navbar-nav .nav-link i[class*="bi-"] {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        min-width: 1rem;
        line-height: 1 !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .portal-card1 .info-card i[class*="bi-"] {
        display: block !important;
        line-height: 1 !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
}
