/**
 * Homem de Deus: Disciplina - Estilos Responsivos
 * Desenvolvido por B20 Conteúdo Digital
 * https://www.b20.com.br
 */

/* === MOBILE FIRST BREAKPOINTS === */

/* Mobile Small (320px+) - Base styles já definidos no style.css */

/* Mobile Large (375px+) */
@media (min-width: 375px) {
    .container {
        padding: 20px;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    .navigation-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    .nav-card {
        min-height: 180px;
        padding: 28px;
    }
}

/* Tablet Portrait (768px+) */
@media (min-width: 768px) {
    :root {
        --header-height: 70px;
    }
    
    body {
        padding-top: var(--header-height);
    }
    
    /* === HEADER TABLET/DESKTOP === */
    .app-header {
        height: var(--header-height);
        padding: 0 32px;
    }
    
    .header-logo h1 {
        font-size: 1.4rem;
    }
    
    /* === CONTAINER === */
    .container {
        padding: 32px;
        max-width: 800px;
        margin: 0 auto;
    }
    
    /* === HEADER DESKTOP ONLY (1024px+) === */
    /* Breakpoint transferido para debaixo para evitar quebra de menu */
    
    /* === HERO SECTION === */
    .hero-section {
        padding: 40px 0;
    }
    
    .hero-title {
        font-size: 2.8rem;
    }
    
    .verse-of-day {
        padding: 32px;
        margin-bottom: 32px;
    }
    
    .verse-of-day blockquote {
        font-size: 1.3rem;
    }
    
    .streak-counter {
        padding: 20px 32px;
        min-width: 140px;
    }
    
    .streak-counter i {
        font-size: 1.8rem;
    }
    
    .streak-counter span {
        font-size: 2.5rem;
    }
    
    /* === NAVIGATION GRID === */
    .navigation-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: 20px;
        margin-top: 32px;
    }
    
    .nav-card {
        min-height: 200px;
        padding: 32px;
    }
    
    .nav-card-icon {
        width: 70px;
        height: 70px;
        margin-bottom: 20px;
    }
    
    .nav-card-icon i {
        font-size: 1.8rem;
    }
    
    .nav-card h3 {
        font-size: 1.2rem;
        margin-bottom: 12px;
    }
    
    .nav-card p {
        font-size: 1rem;
    }
    
    /* === SECTION HEADERS === */
    .section-header {
        margin-bottom: 32px;
        padding-bottom: 20px;
    }
    
    .section-header h2 {
        font-size: 1.8rem;
    }
    
    /* === DEVOTIONAL === */
    .devotional-card {
        padding: 40px;
    }
    
    .devotional-verse {
        padding: 32px;
        margin-bottom: 40px;
    }
    
    .devotional-verse blockquote {
        font-size: 1.4rem;
    }
    
    .devotional-reflection h3 {
        font-size: 1.5rem;
    }
    
    .devotional-actions {
        margin-top: 40px;
    }
    
    /* === CHALLENGES === */
    .challenges-list {
        gap: 20px;
    }
    
    .challenge-card {
        padding: 24px;
    }
    
    .challenge-header {
        gap: 20px;
    }
    
    .challenge-checkbox {
        width: 28px;
        height: 28px;
    }
    
    .challenge-title {
        font-size: 1.2rem;
    }
    
    .challenge-description {
        font-size: 1rem;
    }
    
    /* === EVOLUTION === */
    .evolution-stats {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 20px;
        margin-bottom: 40px;
    }
    
    .stat-card {
        padding: 24px;
    }
    
    .stat-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 16px;
    }
    
    .stat-icon i {
        font-size: 1.5rem;
    }
    
    .stat-content h3 {
        font-size: 2rem;
    }
    
    .badges-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 20px;
    }
    
    .badge-item {
        padding: 20px;
    }
    
    .badge-icon {
        width: 50px;
        height: 50px;
        margin-bottom: 12px;
    }
    
    .badge-icon i {
        font-size: 1.3rem;
    }
    
    .badge-name {
        font-size: 0.9rem;
    }
    
    /* === PRAYER === */
    .themes-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 20px;
    }
    
    .theme-card {
        min-height: 180px;
        padding: 28px;
    }
    
    .theme-icon {
        width: 70px;
        height: 70px;
        margin-bottom: 20px;
    }
    
    .theme-icon i {
        font-size: 1.8rem;
    }
    
    .prayer-content {
        padding: 40px;
    }
    
    .timer-display {
        font-size: 4rem;
    }
    
    /* === QUIZ === */
    .quiz-question {
        padding: 40px;
    }
    
    .question-text {
        font-size: 1.3rem;
        margin-bottom: 32px;
    }
    
    .option-button {
        padding: 20px 24px;
        font-size: 1.1rem;
    }
    
    .results-card {
        padding: 48px;
    }
    
    .results-score i {
        font-size: 4rem;
    }
    
    .score-percentage {
        font-size: 3rem;
    }
    
    /* === TOAST === */
    .toast {
        bottom: 24px; /* Sem bottom nav */
        padding: 16px 32px;
    }
    
    .toast-message {
        font-size: 1rem;
    }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
    .container {
        max-width: 1000px;
        padding: 40px;
    }
    
    .hero-title {
        font-size: 3.2rem;
    }
    
    .navigation-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
        gap: 24px;
    }
    
    .nav-card {
        min-height: 220px;
    }
    
    /* === DESKTOP LAYOUT IMPROVEMENTS === */
    .devotional-content,
    .quiz-container,
    .prayer-session {
        max-width: 700px;
    }
    
    .evolution-stats {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .themes-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 600px;
        margin: 0 auto;
    }
    
    .badges-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    /* === HOVER EFFECTS DESKTOP === */
    .nav-card:hover {
        transform: translateY(-6px);
    }
    
    .btn:hover {
        transform: translateY(-3px);
    }
    
    .stat-card:hover {
        transform: translateY(-4px);
    }
    
    .theme-card:hover {
        transform: translateY(-6px);
    }
}

/* Large Desktop (1440px+) */
@media (min-width: 1440px) {
    .container {
        max-width: 1200px;
        padding: 48px;
    }
    
    .hero-section {
        padding: 60px 0;
    }
    
    .hero-title {
        font-size: 3.6rem;
    }
    
    .navigation-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 32px;
    }
    
    .nav-card {
        min-height: 240px;
    }
    
    /* === SIDEBAR NAVIGATION OPTION === */
    .app-layout {
        display: grid;
        grid-template-columns: 280px 1fr;
        gap: 0;
        min-height: 100vh;
    }
    
    .sidebar-nav {
        background: var(--surface-color);
        border-right: 1px solid var(--border-color);
        padding: 32px 0;
        position: fixed;
        left: 0;
        top: var(--header-height);
        bottom: 0;
        width: 280px;
        overflow-y: auto;
    }
    
    .sidebar-nav .nav-link {
        display: flex;
        align-items: center;
        gap: 16px;
        padding: 16px 32px;
        color: var(--text-color);
        text-decoration: none;
        font-weight: var(--font-weight-medium);
        transition: var(--transition);
        border-left: 3px solid transparent;
    }
    
    .sidebar-nav .nav-link:hover,
    .sidebar-nav .nav-link.active {
        background: var(--primary-light);
        color: var(--primary-color);
        border-left-color: var(--primary-color);
    }
    
    .sidebar-nav .nav-link i {
        font-size: 1.2rem;
        width: 24px;
        text-align: center;
    }
    
    .main-content-with-sidebar {
        margin-left: 280px;
        padding-top: var(--header-height);
    }
}

/* Ultra Wide (1920px+) */
@media (min-width: 1920px) {
    .container {
        max-width: 1400px;
    }
    
    .navigation-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .evolution-stats {
        grid-template-columns: repeat(4, 1fr);
        max-width: 800px;
        margin: 0 auto 40px;
    }
}

/* === PRINT STYLES === */
@media print {
    .app-header,
    .bottom-nav,
    .btn,
    .toast,
    .nav-card-badge {
        display: none !important;
    }
    
    body {
        padding: 0;
        color: #000;
        background: #fff;
    }
    
    .section {
        display: block !important;
        page-break-inside: avoid;
    }
    
    .devotional-verse,
    .prayer-text {
        border: 2px solid #000;
        page-break-inside: avoid;
    }
}

/* === HIGH CONTRAST MODE === */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.3);
        --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.4);
    }
    
    .nav-card,
    .devotional-card,
    .challenge-card,
    .quiz-question,
    .stat-card,
    .theme-card {
        border: 2px solid var(--border-color);
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .skeleton {
        animation: none;
        background: #f0f0f0;
    }
}

/* === LANDSCAPE ORIENTATION === */
@media (orientation: landscape) and (max-height: 600px) {
    .hero-section {
        padding: 20px 0;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .verse-of-day {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .streak-counter {
        padding: 12px 20px;
    }
    
    .navigation-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 12px;
    }
    
    .nav-card {
        min-height: 120px;
        padding: 16px;
    }
    
    .nav-card-icon {
        width: 40px;
        height: 40px;
        margin-bottom: 8px;
    }
    
    .nav-card-icon i {
        font-size: 1.2rem;
    }
    
    .nav-card h3 {
        font-size: 1rem;
        margin-bottom: 4px;
    }
    
    .nav-card p {
        font-size: 0.8rem;
    }
}

/* Desktop & Large Tablets (1024px+) */
@media (min-width: 1024px) {
    :root {
        --bottom-nav-height: 0px; /* Esconder bottom nav */
    }
    
    body {
        padding-bottom: 0; /* Remover padding do bottom nav */
    }

    /* Desktop Navigation - Mostrar apenas em telas grandes */
    .desktop-nav {
        display: flex;
        gap: 6px;
    }
    
    .desktop-nav .nav-link {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 8px 14px;
        border-radius: var(--border-radius);
        color: var(--text-color);
        text-decoration: none;
        font-size: 0.95rem;
        font-weight: var(--font-weight-semibold);
        transition: var(--transition);
        min-height: 44px;
    }
    
    .desktop-nav .nav-link:hover,
    .desktop-nav .nav-link.active {
        background: var(--primary-color);
        color: white;
        transform: translateY(-2px);
        box-shadow: var(--shadow-light);
    }
    
    .desktop-nav .nav-link i {
        font-size: 1rem;
    }
    
    /* ESCONDER BOTTOM NAV NO DESKTOP! */
    .bottom-nav {
        display: none !important;
    }

    .container {
        max-width: 1200px;
    }
}

/* === SAFE AREAS (iPhone X+) === */
@supports (padding: max(0px)) {
    .app-header {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
        padding-top: env(safe-area-inset-top);
    }
    
    .bottom-nav {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }
    
    body {
        padding-top: max(var(--header-height), env(safe-area-inset-top) + var(--header-height));
    }
    
    .container {
        padding-left: max(16px, env(safe-area-inset-left) + 16px);
        padding-right: max(16px, env(safe-area-inset-right) + 16px);
    }
}

/* === CONTAINER QUERIES (Modern Browsers) === */
@supports (container-type: inline-size) {
    .nav-card {
        container-type: inline-size;
        container-name: nav-card;
    }
    
    @container nav-card (min-width: 300px) {
        .nav-card-icon {
            width: 70px;
            height: 70px;
        }
        
        .nav-card-icon i {
            font-size: 1.6rem;
        }
        
        .nav-card h3 {
            font-size: 1.2rem;
        }
    }
    
    .stat-card {
        container-type: inline-size;
        container-name: stat-card;
    }
    
    @container stat-card (min-width: 180px) {
        .stat-icon {
            width: 60px;
            height: 60px;
        }
        
        .stat-content h3 {
            font-size: 2rem;
        }
    }
}

/* === FOCUS STYLES (Accessibility) === */
@media (prefers-reduced-motion: no-preference) {
    .nav-link:focus,
    .nav-item:focus,
    .btn:focus,
    .nav-card:focus,
    .theme-card:focus,
    .option-button:focus,
    .faq-question:focus {
        outline: 3px solid var(--primary-color);
        outline-offset: 2px;
        box-shadow: 0 0 0 6px rgba(255, 153, 0, 0.2);
    }
}

/* === DARK MODE RESPONSIVE ADJUSTMENTS === */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .desktop-nav .nav-link:hover,
    :root:not([data-theme="light"]) .desktop-nav .nav-link.active {
        background: var(--primary-color);
        color: white;
    }
    
    :root:not([data-theme="light"]) .skeleton {
        background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
        background-size: 200% 100%;
        animation: skeleton-loading 1.5s infinite;
    }
}

:root[data-theme="dark"] .desktop-nav .nav-link:hover,
:root[data-theme="dark"] .desktop-nav .nav-link.active {
    background: var(--primary-color);
    color: white;
}

:root[data-theme="dark"] .skeleton {
    background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}
