/* Modern Styles for Bible Search System */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #00B1F8;
    --primary-dark: #008ecc;
    --secondary-color: #f3f4f6;
    --text-color: #333;
    --text-light: #666;
    --white: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --border-radius: 12px;
    --input-bg: #f9fafb;
    --input-border: #d1d5db;
    --accent-yellow: #fff948;
    /* For highlighted text */
    --accent-cyan: #00fae3;
    /* For highlighted text */
}

/* Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f0f2f5;
    color: var(--text-color);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

/* Header & Menu overrides */
.sticky-menu {
    background: #ffffff !important;
    box-shadow: var(--shadow);
    padding: 0.5rem 0;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
}


/* Mobile Toggle Style */
#menu-toggle,
.hamburger {
    display: none;
}

.menu-container {
    max-width: 1400px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    position: relative;
}

@media (max-width: 1024px) {
    .menu-container {
        padding: 0 10px;
    }
}



.menu li a {
    color: #00B1F8 !important;
    font-weight: 600;
    border-radius: 8px;
    padding: 10px 15px;
    display: block;
    transition: all 0.3s ease;
}

.menu li a:hover {
    background-color: var(--primary-color);
    color: var(--white) !important;
}

/* Submenu Styles */
.submenu li a,
.submenu-level2 li a {
    color: #ffffff !important;
    background-color: #00B1F8 !important;
}

.submenu li a:hover,
.submenu-level2 li a:hover {
    background-color: #008ecc !important;
    color: #ffffff !important;
}



/* Tablet and Laptop Menu Adjustments */
@media (max-width: 1200px) {
    .menu li {
        margin: 0 2px;
    }

    .menu li a {
        padding: 6px 8px;
        font-size: 0.85rem;
    }
}

/* Mobile Menu Transformation */
@media (max-width: 768px) {
    .hamburger {
        display: block !important;
        font-size: 28px;
        color: #008ecc !important;
        cursor: pointer;
        order: 2;
    }

    .main-menu {
        display: none !important;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.92) !important;
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
        z-index: 999;
        padding: 5px 0;
        max-height: 75vh;
        overflow-y: auto;
    }

    #menu-toggle:checked~.main-menu {
        display: block !important;
    }

    .menu {
        flex-direction: column !important;
        align-items: stretch !important;
        display: flex !important;
    }

    .menu li {
        margin: 0 !important;
        width: 100% !important;
    }

    .menu li a {
        padding: 15px 25px !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
        font-size: 1rem !important;
    }

    /* Submenus explicitly shown on Mobile with better transparency */
    .submenu,
    .submenu-level2 {
        position: static !important;
        display: block !important;
        box-shadow: none !important;
        padding-left: 20px !important;
        background-color: rgba(0, 177, 248, 0.9) !important;
        width: 100% !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .submenu li a,
    .submenu-level2 li a {
        color: #ffffff !important;
        padding: 10px 20px !important;
        font-size: 0.9rem !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    }
}





.menu li a:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.auto-style67 {
    color: var(--primary-color) !important;
    font-size: 1.5rem;
    font-weight: 700;
}

/* Main Content Layout */
.content {
    width: 100% !important;
    max-width: 100% !important;
    margin: 120px 0 40px !important;
    /* Top margin for sticky header */
    padding: 0 !important;
    display: grid;
    gap: 30px;
}

/* Card Component */
.card-modern {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Search Form Section */
#one .card-modern {
    background: linear-gradient(135deg, var(--white) 0%, #f0f9ff 100%);
}

.search-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.25rem;
    align-items: flex-end;
}

@media (max-width: 1200px) {
    .search-form-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

@media (max-width: 768px) {
    .search-form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}


.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-light);
}

.form-control {
    padding: 0.75rem 1rem;
    border: 1px solid var(--input-border);
    border-radius: 8px;
    background-color: var(--input-bg);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 177, 248, 0.1);
    background-color: var(--white);
}

.btn-primary-modern {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
    text-align: center;
}

.btn-primary-modern:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

/* Compact overrides for the search form */
.search-form-compact .form-control {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

.search-form-compact .form-group label {
    font-size: 0.8rem;
    margin-bottom: 2px;
}

.search-form-compact .btn-primary-modern {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .card-modern {
        padding: 1rem;
    }
}


/* Tabs Redesign */
.tabs {
    border-bottom: none;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 5px;
}

.tab-link {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-light);
    font-weight: 500;
    border-radius: 30px;
    padding: 10px 20px;
}

.tab-link:hover {
    background-color: rgba(0, 177, 248, 0.1);
    color: var(--primary-color);
}

.tab-link.active {
    background-color: var(--primary-color);
    color: var(--white);
    box-shadow: 0 4px 10px rgba(0, 177, 248, 0.3);
}

.tab-content {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: none;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bible Text Content & Newspaper Layout */
.verse-grid,
.newspaper2 {
    display: block;
    column-count: 2;
    column-gap: 3rem;
    column-rule: 1px solid #e5e7eb;
}

@media (max-width: 1024px) {

    .verse-grid,
    .newspaper2 {
        column-count: 1;
        column-gap: 0;
    }
}

.verse-item {
    margin-bottom: 1rem;
    break-inside: avoid;
    display: block;
}

.verse-number {
    font-weight: 700;
    color: var(--primary-color);
    margin-right: 5px;
    font-size: 0.9em;
    vertical-align: super;
}

.verse-text {
    font-size: 1.1rem;
    line-height: 1.8;
}

/* Highlights */
.highlight-yellow {
    background-color: var(--accent-yellow);
    padding: 2px 4px;
    border-radius: 4px;
}

.highlight-cyan {
    background-color: var(--accent-cyan);
    padding: 2px 4px;
    border-radius: 4px;
}

/* Table Responsiveness & Graphics */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid #e5e7eb;
    background: var(--white);
    position: relative;
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    min-width: 100%;
}

@media (max-width: 1024px) {
    table {
        width: 100% !important;
        min-width: 100% !important;
        /* Allow tables to shrink for better responsiveness */
    }
}

@media (max-width: 768px) {
    table {
        width: 100% !important;
        min-width: 100% !important;
        font-size: 0.85rem;
    }

    th,
    td {
        padding: 8px 5px !important;
    }
}

table img,
.table-responsive img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin: 5px 0;
}

th,
td {
    padding: 12px;
    text-align: left;
    border: 1px solid #e5e7eb;
    word-break: keep-all;
    /* Prefer keeping words together */
    overflow-wrap: break-word;
    word-wrap: break-word;
    white-space: normal;
    /* Ensure text wraps */
}

/* Specific fix for Hebrew/Greek text in cells */
td[dir="rtl"],
.hebrew-text {
    direction: rtl;
    text-align: right;
    font-size: 1.2rem;
}



/* Section Titles */
h1,
h2,
h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
}


h3.caja_super {
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: var(--shadow);
    margin: 2rem 0;
}

/* Dialog/Modal Styling */
dialog {
    border: none;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: min(500px, 90vw);
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

dialog h2 {
    margin-top: 0;
}

/* Responsive iframe container */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin: 20px 0;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Print Styles */
@media print {

    /* Hide non-printable elements */
    .sticky-menu,
    #one,
    /* Search form */
    .tabs,
    .controles,
    .btn-primary-modern,
    button,
    footer,
    .scroll-top-btn,
    .controles-superiores {
        display: none !important;
    }

    /* Reset layout for print */
    body {
        background: white;
        color: black;
    }

    .content {
        margin: 0;
        padding: 0;
        display: block;
    }

    .card-modern {
        box-shadow: none;
        border: none;
        padding: 0;
    }

    .tab-content {
        display: none;
        /* Hide all tabs by default */
        box-shadow: none;
        padding: 0;
        margin: 0;
    }

    /* Only show the active tab content */
    .tab-content.active {
        display: block !important;
    }

    /* Ensure text is readable */
    .verse-grid {
        display: block;
        /* Use block for print to avoid column break issues if needed, or keep grid */
        column-count: 2;
    }

    .verse-text {
        font-size: 11pt;
        color: #000;
        page-break-inside: avoid;
    }

    a {
        text-decoration: none;
        color: #000;
    }

    /* Specifically for Trad3 popup if used */
    dialog {
        display: none;
    }
}