/* ============================================ */
/* RESPONSIVE.CSS - ADAPTAÇÕES MOBILE E TABLET  */
/* SANTOBOLETO - RESPONSIVIDADE COMPLETA        */
/* ============================================ */

/* ============================================ */
/* 1. BREAKPOINTS PADRÃO                       */
/* ============================================ */

/* 
   Breakpoints:
   - xs: 0-575px    (mobile pequeno)
   - sm: 576-767px  (mobile grande)
   - md: 768-991px  (tablet)
   - lg: 992-1199px (desktop pequeno)
   - xl: 1200px+    (desktop grande)
*/

/* ============================================ */
/* 2. DESKTOP GRANDE (XL) - Acima de 1400px    */
/* ============================================ */

@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .main-content {
        padding: 2.5rem 3rem;
    }
    
    .stories-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .projects-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .achievements-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* ============================================ */
/* 3. DESKTOP (LG) - 992px a 1199px            */
/* ============================================ */

@media (max-width: 1199px) {
    .container {
        max-width: 960px;
    }
    
    .main-content {
        padding: 2rem;
    }
    
    .stories-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .project-metrics-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ============================================ */
/* 4. TABLET (MD) - 768px a 991px              */
/* ============================================ */

@media (max-width: 991px) {
    /* Container */
    .container {
        max-width: 720px;
        padding: 0 1.5rem;
    }
    
    /* Sidebar - Modo Colapsado */
    .sidebar {
        width: 80px !important;
        padding: 1.5rem 0.5rem !important;
        align-items: center !important;
    }
    
    .sidebar .logo-text,
    .sidebar .nav-link span,
    .sidebar .user-info-sidebar,
    .sidebar .lux-sidebar-card {
        display: none !important;
    }
    
    .sidebar .nav-link {
        justify-content: center !important;
        padding: 0.75rem !important;
    }
    
    .sidebar .nav-link i {
        margin: 0 !important;
        font-size: 1.3rem !important;
    }
    
    .sidebar-user {
        justify-content: center !important;
    }
    
    /* Main Content - Ajuste de Margem */
    .main-content {
        margin-left: 80px !important;
        padding: 1.5rem !important;
    }
    
    /* Grids */
    .stories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .project-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .achievements-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Layout de Projeto */
    .project-layout {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }
    
    /* Layout de Request */
    .request-layout {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }
    
    /* Layout de Perfil */
    .profile-layout {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }
    
    /* Header */
    .header-search {
        min-width: 200px;
    }
    
    /* Hero */
    .hero-grid {
        grid-template-columns: 1fr !important;
        text-align: center;
        gap: 2.5rem;
    }
    
    .hero-content h1 {
        font-size: 2.8rem;
    }
    
    .hero-content p {
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .hero-stats {
        justify-content: center;
    }
    
    /* Podium */
    .podium {
        gap: 1rem;
    }
    
    .podium-item {
        width: 150px;
    }
    
    /* Tabs */
    .tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab {
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    /* Filtros */
    .filters-row {
        flex-wrap: wrap;
    }
    
    .filter-chip {
        font-size: 0.8rem;
        padding: 0.5rem 1rem;
    }
    
    /* Tabelas */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        min-width: 800px;
    }
}

/* ============================================ */
/* 5. MOBILE GRANDE (SM) - 576px a 767px       */
/* ============================================ */

@media (max-width: 767px) {
    /* Container */
    .container {
        max-width: 540px;
        padding: 0 1rem;
    }
    
    /* Sidebar - Permanece Colapsada */
    .sidebar {
        width: 70px !important;
    }
    
    .main-content {
        margin-left: 70px !important;
        padding: 1.25rem !important;
    }
    
    /* Grids */
    .stories-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    .project-metrics-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .achievements-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ranking-cards {
        grid-template-columns: 1fr;
    }
    
    /* Hero */
    .hero {
        padding: 2.5rem 0;
    }
    
    .hero-content h1 {
        font-size: 2.2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
    
    /* Header */
    .header {
        padding: 0.5rem 1rem;
    }
    
    .header-container {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .header-search {
        order: 3;
        width: 100%;
        min-width: auto;
        margin-top: 0.5rem;
    }
    
    .header-right {
        margin-left: auto;
    }
    
    /* Dashboard Header */
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .dashboard-header .btn-new-request {
        width: 100%;
        justify-content: center;
    }
    
    /* Page Header */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .page-header .btn-create {
        width: 100%;
        justify-content: center;
    }
    
    /* Podium */
    .podium {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }
    
    .podium-item {
        width: 100%;
        max-width: 250px;
    }
    
    .podium-item.first {
        transform: none;
        order: -1;
    }
    
    /* Cards de Missão */
    .mission-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.25rem;
    }
    
    .mission-reward {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 0.75rem;
    }
    
    /* Cards de Conquista */
    .achievement-card {
        padding: 1rem 0.75rem;
    }
    
    /* Banner de Streak */
    .streak-banner {
        flex-direction: column;
        text-align: center;
        gap: 1.25rem;
        padding: 1.5rem;
    }
    
    .streak-banner-left {
        flex-direction: column;
    }
    
    .streak-banner-right {
        text-align: center;
    }
    
    /* Banner de Bônus */
    .bonus-banner {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .missions-bonus {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    /* Banner de Gamificação */
    .gamification-banner-content {
        flex-direction: column;
        text-align: center;
    }
    
    /* Card de Level */
    .level-card {
        flex-direction: column;
        text-align: center;
    }
    
    /* Timeline */
    .timeline-item {
        gap: 1rem;
    }
    
    .timeline-images {
        justify-content: center;
    }
    
    /* Comentários */
    .comment-form {
        flex-direction: column;
    }
    
    .comment-form-avatar {
        align-self: flex-start;
    }
    
    /* Modal */
    .modal {
        width: 95%;
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    /* Botões de Ação */
    .action-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
    
    /* Footer */
    .footer-grid {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    /* Minha Posição Card */
    .my-position-card {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .my-position-stats {
        margin-left: 0;
        justify-content: center;
    }
    
    /* Lux Display */
    .lux-display-lg {
        padding: 8px 16px;
    }
    
    .lux-display-lg .lux-amount {
        font-size: 1.2rem;
    }
}

/* ============================================ */
/* 6. MOBILE PEQUENO (XS) - Até 575px          */
/* ============================================ */

@media (max-width: 575px) {
    /* Container */
    .container {
        padding: 0 0.75rem;
    }
    
    /* Main Content */
    .main-content {
        padding: 1rem !important;
    }
    
    /* Sidebar */
    .sidebar {
        width: 60px !important;
        padding: 1rem 0.25rem !important;
    }
    
    .main-content {
        margin-left: 60px !important;
    }
    
    /* Grids */
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .project-metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .achievements-grid {
        grid-template-columns: 1fr;
    }
    
    /* Hero */
    .hero-content h1 {
        font-size: 1.8rem;
    }
    
    .hero-badge {
        font-size: 0.65rem;
    }
    
    /* Títulos */
    h1 {
        font-size: 1.6rem !important;
    }
    
    h2 {
        font-size: 1.3rem !important;
    }
    
    h3 {
        font-size: 1.1rem !important;
    }
    
    /* Cards */
    .feed-card {
        border-radius: var(--radius-md);
    }
    
    .feed-card-header {
        padding: 1rem 1rem 0.5rem;
    }
    
    .feed-card-body {
        padding: 0 1rem;
    }
    
    .feed-card-footer {
        padding: 0.75rem 1rem 1rem;
    }
    
    .feed-card-title {
        font-size: 1rem;
    }
    
    .feed-card-amount {
        font-size: 1.2rem;
    }
    
    /* Project Card */
    .project-card-content {
        padding: 1.25rem;
    }
    
    .project-card-cover {
        height: 140px;
    }
    
    /* Mission Card */
    .mission-icon {
        width: 48px;
        height: 48px;
        font-size: 1.4rem;
    }
    
    /* Timeline */
    .timeline-image {
        width: 80px;
        height: 80px;
    }
    
    /* Tabs */
    .tab {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    /* Filtros */
    .filter-bar {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }
    
    .filter-chip {
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    /* Botões */
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .btn-lg {
        padding: 0.7rem 1.5rem;
        font-size: 0.95rem;
    }
    
    /* Paginação */
    .pagination-btn {
        width: 36px;
        height: 36px;
    }
    
    /* Toast */
    .toast {
        left: 1rem;
        right: 1rem;
        text-align: center;
    }
    
    /* Dropdown */
    .dropdown-menu {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        transform: translateY(100%);
    }
    
    .dropdown.active .dropdown-menu {
        transform: translateY(0);
    }
    
    /* Modal - Full Screen no Mobile */
    .modal {
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        border-radius: 0;
        margin: 0;
        padding: 1.5rem;
    }
    
    .modal-overlay {
        align-items: flex-end;
    }
    
    .modal-overlay .modal {
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        max-height: 90vh;
    }
    
    /* Esconde elementos não essenciais */
    .hide-mobile {
        display: none !important;
    }
    
    /* Ajustes de texto */
    .text-truncate-mobile {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* ============================================ */
/* 7. AJUSTES PARA TELAS MUITO PEQUENAS        */
/* ============================================ */

@media (max-width: 375px) {
    .sidebar {
        width: 50px !important;
    }
    
    .main-content {
        margin-left: 50px !important;
    }
    
    .feed-card-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .social-actions {
        width: 100%;
        justify-content: space-around;
    }
    
    .feed-card-help-btn {
        width: 100%;
        justify-content: center;
    }
    
    .project-card-metrics {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
}

/* ============================================ */
/* 8. AJUSTES PARA ORIENTAÇÃO PAISAGEM         */
/* ============================================ */

@media (orientation: landscape) and (max-height: 600px) {
    .sidebar {
        overflow-y: auto;
        padding-bottom: 1rem;
    }
    
    .modal {
        max-height: 85vh;
    }
    
    .hero {
        padding: 1.5rem 0;
    }
    
    .hero-content h1 {
        font-size: 1.8rem;
    }
}

/* ============================================ */
/* 9. SUPORTE PARA TOUCH                       */
/* ============================================ */

@media (hover: none) and (pointer: coarse) {
    /* Aumenta área de toque para botões */
    .btn,
    .nav-link,
    .tab,
    .filter-chip,
    .dropdown-item,
    .social-btn {
        min-height: 44px;
    }
    
    /* Remove efeitos hover que podem grudar */
    .feed-card:hover,
    .project-card:hover,
    .achievement-card:hover {
        transform: none;
    }
    
    /* Ajusta scroll */
    .sidebar,
    .modal,
    .table-container,
    .filters-row {
        -webkit-overflow-scrolling: touch;
    }
}

/* ============================================ */
/* 10. SUPORTE PARA DARK MODE (OPCIONAL)       */
/* ============================================ */

@media (prefers-color-scheme: dark) {
    /* 
       Se quiser implementar dark mode no futuro,
       adicione as variáveis e estilos aqui.
       
       Exemplo:
       :root {
           --bg-main: #1A1A2E;
           --bg-card: #2C2C42;
           --text-main: #FFFFFF;
       }
    */
}

/* ============================================ */
/* 11. UTILITÁRIOS DE VISIBILIDADE             */
/* ============================================ */

/* Mostrar apenas em mobile */
.show-mobile {
    display: none;
}

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

/* Mostrar apenas em tablet */
.show-tablet {
    display: none;
}

@media (min-width: 768px) and (max-width: 991px) {
    .show-tablet {
        display: block;
    }
    
    .hide-tablet {
        display: none !important;
    }
}

/* Mostrar apenas em desktop */
.show-desktop {
    display: none;
}

@media (min-width: 992px) {
    .show-desktop {
        display: block;
    }
    
    .hide-desktop {
        display: none !important;
    }
}

/* ============================================ */
/* 12. IMPRESSÃO                               */
/* ============================================ */

@media print {
    .sidebar,
    .header,
    .btn,
    .modal-overlay,
    .toast,
    .gamification-banner,
    .action-buttons,
    .footer {
        display: none !important;
    }
    
    .main-content {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .card,
    .feed-card,
    .project-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
    
    a {
        text-decoration: none;
        color: black;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.8rem;
    }
    
    .progress-bar-fill,
    .progress-fill {
        background: #ccc !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}