/* Study Guide Bilingual CSS */

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f5f5f5;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background-color: white;
    padding: 30px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* Navigation */
.nav-container {
    background-color: #003366;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 8px 12px;
    background-color: #004488;
    border-radius: 3px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.nav-links a:hover {
    background-color: #0066cc;
}

.nav-links a.active {
    background-color: #cc0000;
}

/* Toggle Controls */
.controls {
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background-color: #e8f4f8;
    border-radius: 5px;
}

.toggle-btn {
    padding: 10px 20px;
    background-color: #006600;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
}

.toggle-btn:hover {
    background-color: #008800;
}

/* Content Layout */
h1 {
    color: #003366;
    text-align: center;
    border-bottom: 3px solid #cc0000;
    padding-bottom: 10px;
    margin-bottom: 30px;
}

h2 {
    color: #003366;
    margin-top: 30px;
    margin-bottom: 15px;
    padding: 10px 10px 10px 15px;
    background-color: #e8f4f8;
    border-left: 5px solid #003366;
}

h3 {
    color: #004488;
    margin-left: 20px;
}

.content-row {
    display: block;
    margin-bottom: 20px;
}

.english-column {
    width: 100%;
    padding-right: 0;
    border-right: none;
}

.spanish-column {
    padding-left: 0;
}

.spanish-column.hidden {
    display: none;
}

p {
    line-height: 1.6;
    margin-bottom: 15px;
    text-align: justify;
}

.page-ref, .caption {
    font-style: italic;
    font-size: 0.85em;
    color: #666;
}

.q-ref {
    font-weight:bold;
    font-size: 0.75em;
    color: red;
}

ul {
    margin: 10px 0;
    padding-left: 30px;
}

li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.diagram {
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
}

/* Explanation popup styles */
.explan {
    /*cursor: help;*/
    text-decoration: underline dotted 2px;
    color: #004488;
}

.popup {
    display: none;
    position: fixed;
    border: 2px solid blue;
    background-color: azure;
    padding: 8px;
    border-radius: 5px;
    font-size: 0.85em;
    max-width: 300px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    text-align: left;
    cursor: default;
}

.popup.visible {
    display: block;
}

.popup p {
    margin: 0.5em 0;
    text-align: left;
}

.popup p:first-child {
    margin-top: 0;
}

.popup p:last-child {
    margin-bottom: 0;
}

.popup ul,
.popup ol {
    margin: 0.5em 0;
    padding-left: 1.5em;
}

.popup li {
    margin-bottom: 0.3em;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .english-column {
        border-right: none;
        border-bottom: none;
        padding-bottom: 0;
        margin-bottom: 0;
    }
}
/* Spanish help hint box */
.spanish-hint {
    background-color: #e8f5e9;
    border: 2px solid #2196f3;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 16px 0;
    font-size: 14px;
    color: navy;
    line-height: 1.5;
}

/* Hide Spanish by default */
.spanish-column {
    display: none;
}

/* Show Spanish when activated - matches hint box styling */
.spanish-column.show,
.spanish-translation-inline {
    display: block;
    margin-top: 8px;
    margin-bottom: 8px;
    padding: 12px 16px;
    background-color: #e8f5e9;
    border: 2px solid #2196f3;
    border-radius: 8px;
    font-style: italic;
    cursor: pointer;
    font-size: inherit;
}

.spanish-translation-inline:hover {
    background-color: #d0ead0;
}

/* Section collapsing */
.content-row.collapsed .english-column > *:not(h2):not(.section-intro),
.content-row.collapsed .spanish-column {
    display: none;
}

/* Make headings clickable */
h2 {
    cursor: pointer;
    user-select: none;
    padding-top: 12px;
    padding-bottom: 12px;
    position: relative;
}

h2:hover {
    color: #1976d2;
}

h2::after,
h3::after {
    content: '\25BC';
    font-size: 0.7em;
    display: inline-block;
    margin-left: 0.4em;
    transition: transform 0.3s;
}

.content-row.collapsed h2::after,
.content-row.collapsed h3::after {
    transform: rotate(-90deg);
}

/* Make English paragraphs clickable for Spanish toggle */
.english-column p,
.english-column ul,
.english-column ol {
    cursor: pointer;
    position: relative;
}

.english-column p:hover,
.english-column ul:hover,
.english-column ol:hover {
    background-color: #f0f7ff;
}

/* Add subtle indicator that content is clickable */
.english-column p::after,
.english-column ul::after,
.english-column ol::after {
    content: '\1F310';
    position: absolute;
    right: 4px;
    top: 4px;
    font-size: 12px;
    opacity: 0.3;
}

.english-column p:hover::after,
.english-column ul:hover::after,
.english-column ol:hover::after {
    opacity: 0.6;
}

/* Don't make page-refs or captions clickable for Spanish */
.page-ref,
.caption {
    cursor: default !important;
}

.page-ref::after,
.caption::after {
    content: '' !important;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .spanish-hint {
        font-size: 13px;
        padding: 10px 12px;
    }
}

/* ============================================================
   Question/Answer Modal Popups (.qpop)
   Distinct from .popup explanation tooltips
   ============================================================ */

/* Overlay dims the page behind the modal */
.qpop-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
}

.qpop-overlay.visible {
    display: block;
}

/* Modal box */
.qpop {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    border: 2px solid #003366;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 2100;
    min-width: 300px;
    max-width: 560px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
}

.qpop.visible {
    display: flex;
    flex-direction: column;
}

/* Header bar with X close button */
.qpop-header {
    display: flex;
    justify-content: flex-end;
    padding: 6px 10px 0 10px;
    border-bottom: 1px solid #ccc;
    background-color: #003366;
    border-radius: 6px 6px 0 0;
}

.qpop-close-x {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2em;
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
}

.qpop-close-x:hover {
    color: #ffcc00;
}

/* Modal body content */
.qpop .english-question,
.qpop .spanish-question {
    padding: 12px 16px;
}

.qpop .language-label {
    font-size: 0.75em;
    font-weight: bold;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 4px;
    letter-spacing: 0.05em;
}

.qpop .question-number {
    font-size: 0.85em;
    font-weight: bold;
    color: #003366;
    margin-bottom: 6px;
}

.qpop .question-text {
    font-weight: bold;
    margin: 0 0 8px 0;
}

.qpop ul {
    margin: 0 0 8px 0;
    padding-left: 1.5em;
}

.qpop li.answer {
    margin-bottom: 4px;
    line-height: 1.5;
}

/* Audio player area */
.qpop .audio-controls {
    margin-top: 8px;
}

.qpop audio {
    width: 100%;
    height: 36px;
}

/* Divider between English and Spanish sections */
.qpop .english-question + .spanish-question {
    border-top: 1px solid #ddd;
    background-color: #f9f9f9;
}

/* Footer bar with Close/Cerrar button */
.qpop-footer {
    padding: 8px 16px;
    border-top: 1px solid #ccc;
    text-align: center;
    background-color: #f5f5f5;
    border-radius: 0 0 6px 6px;
}

.qpop-close-btn {
    background-color: #003366;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 6px 20px;
    font-size: 0.9em;
    cursor: pointer;
}

.qpop-close-btn:hover {
    background-color: #0055aa;
}

/* Mobile adjustments for qpop */
@media (max-width: 768px) {
    .qpop {
        width: 95%;
        max-height: 90vh;
    }
}

