/* Responsive Design - MaisDeus Bíblia Online */

/* Tablet (768px e abaixo) */
@media (max-width: 768px) {
    .bible-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .sidebar-left {
        position: fixed;
        left: -100%;
        top: 60px;
        width: 75%;
        height: calc(100vh - 60px);
        background-color: var(--bg-light);
        z-index: 99;
        transition: left 0.3s ease;
        max-height: none;
        overflow-y: auto;
        border-radius: 0;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
    }

    .sidebar-left.active {
        left: 0;
    }

    .sidebar-right {
        max-height: none;
        display: none;
    }

    .sidebar-right.active {
        display: block;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background-color: var(--primary-dark);
        padding: 1rem;
        gap: 0;
    }

    .main-nav.active {
        display: flex;
    }

    .nav-link {
        padding: 0.75rem 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .menu-toggle {
        display: flex;
    }

    .chapter-controls {
        flex-direction: column;
        align-items: flex-start;
    }

    .chapter-nav {
        width: 100%;
        flex-wrap: wrap;
    }

    .chapter-nav select {
        flex: 1;
        min-width: 150px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn {
        width: 100%;
    }

    .verse-item {
        flex-direction: column;
        gap: 0.5rem;
    }

    .verse-number {
        flex-direction: row;
        align-items: center;
    }

    .verse-text {
        font-size: 1rem;
    }

    .header-top {
        gap: 1rem;
    }

    .logo-text {
        font-size: 1.2rem;
    }

    .theme-toggle {
        font-size: 1.2rem;
        padding: 0.4rem;
    }

    .content-main {
        padding: 1rem;
        z-index: 1;
    }
}

/* Mobile (480px e abaixo) */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    .header-top {
        gap: 0.5rem;
    }

    .logo-img {
        width: 32px;
        height: 32px;
    }

    .logo-text {
        font-size: 1rem;
    }

    .chapter-info h1 {
        font-size: 1.5rem;
    }

    .version-info {
        font-size: 0.85rem;
    }

    .chapter-nav {
        width: 100%;
    }

    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    .btn-icon {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }

    .verse-text {
        font-size: 0.95rem;
    }

    .verse-number .number {
        min-width: 25px;
    }

    .btn-share-verse,
    .btn-highlight-verse {
        font-size: 1rem;
    }

    .action-buttons {
        gap: 0.5rem;
    }

    .action-buttons .btn {
        flex: 1;
        min-width: 0;
    }

    .sidebar-left {
        width: 85%;
    }

    .sidebar-left {
        padding: 1rem;
    }

    .books-list h3 {
        font-size: 1rem;
    }

    .testament-group h4 {
        font-size: 0.9rem;
    }

    .book-link {
        padding: 0.4rem 0.5rem;
        font-size: 0.85rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .footer-section h4 {
        font-size: 1rem;
    }

    .content-main {
        padding: 1rem;
    }
}

/* Modo Paisagem (Landscape) */
@media (max-height: 600px) and (orientation: landscape) {
    .header {
        padding: 0.5rem 0;
    }

    .main-content {
        padding: 1rem 0;
    }

    .chapter-controls {
        margin-bottom: 1rem;
    }

    .verse-item {
        margin-bottom: 0.75rem;
        padding: 0.75rem;
    }

    .sidebar-left {
        max-height: 60vh;
    }

    .sidebar-right {
        max-height: 60vh;
    }
}

/* Impressão */
@media print {
    .header,
    .footer,
    .sidebar-left,
    .sidebar-right,
    .action-buttons,
    .chapter-controls,
    .menu-toggle,
    .theme-toggle {
        display: none;
    }

    .bible-container {
        grid-template-columns: 1fr;
    }

    .content-main {
        box-shadow: none;
        padding: 0;
    }

    .verse-item {
        page-break-inside: avoid;
        padding: 0;
        margin-bottom: 1rem;
    }

    .verse-text {
        font-size: 12pt;
    }

    body {
        background-color: white;
        color: black;
    }
}

/* Suporte a Notch (iPhone X e similares) */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }

    .header-top {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
}

/* Dark Mode Preferences */
@media (prefers-color-scheme: dark) {
    body:not(.light-theme) {
        --text-color: #E0E0E0;
        --text-light: #B0B0B0;
        --bg-color: #1E1E1E;
        --bg-light: #2D2D2D;
        --border-color: #444;
    }
}

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

/* High Contrast Mode */
@media (prefers-contrast: more) {
    :root {
        --primary-color: #000;
        --primary-dark: #000;
        --text-color: #000;
        --bg-color: #FFF;
        --border-color: #000;
    }

    .btn-primary {
        border: 2px solid black;
    }
}
