/* ==========================================
   IRREGULAR VERBS - PAST PARTICIPLE PAGE STYLES
   (based on past-verbs.css, same look)
   ========================================== */

body {
    background: linear-gradient(135deg, #B8D9F0 0%, #8FC0DC 100%);
}

body > .container {
    margin: 20px auto;
    flex: 1;
}

.container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 1600px;
    width: 100%;
}

h1 {
    text-align: center;
    font-size: clamp(28px, 5vw, 48px);
    color: #333;
    margin-bottom: 15px;
}

.main-display {
    background: #EDF5FA;
    border-radius: 15px;
    padding: 40px;
    margin-bottom: 20px;
    min-height: 500px;
    display: grid;
    grid-template-columns: 2fr 2fr 1fr;
    gap: 30px;
    align-items: center;
}

/* Image Section - Left */
.image-section {
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-section img {
    max-width: 100%;
    max-height: 800px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Verb Section - Center */
.verb-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.verb-display {
    font-size: 120px;
    font-weight: bold;
    text-align: center;
    color: #333;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* Base and past forms: smaller line above the participle */
.forms-line {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 18px;
    font-size: 56px;
    color: #64748b;
    line-height: 1.1;
}

.form-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.form-label {
    font-size: 15px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94a3b8;
    margin-top: 4px;
}

.form-arrow {
    color: #cbd5e1;
    font-weight: 400;
}

/* Past participle: the highlighted word */
.participle {
    font-size: 120px;
    line-height: 1.1;
    color: #2563A8;
    background: #ffffff;
    padding: 6px 36px 14px;
    border-radius: 18px;
    border-bottom: 6px solid #f97316;
    box-shadow: 0 6px 20px rgba(37, 99, 168, 0.12);
}

/* Placeholder when a picture has not been downloaded yet */
.image-missing {
    display: none;
    width: 100%;
    min-height: 300px;
    align-items: center;
    justify-content: center;
    font-size: 96px;
    background: rgba(255, 255, 255, 0.6);
    border: 3px dashed #cbd5e1;
    border-radius: 10px;
}

.image-section.missing img {
    display: none;
}

.image-section.missing .image-missing {
    display: flex;
}

.speak-btn {
    font-size: 64px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    transition: all 0.2s ease;
    opacity: 0.7;
    border-radius: 50%;
}

.speak-btn:hover {
    opacity: 1;
    transform: scale(1.1);
    background: rgba(37, 99, 168, 0.15);
}

.speak-btn:active {
    transform: scale(0.95);
}

.pronunciation-display {
    font-size: 48px;
    font-weight: bold;
    color: #1F5494;
    text-align: center;
}

/* Translation Section - Right */
.translation-section {
    display: flex;
    flex-direction: column;
    gap: 30px;
    justify-content: center;
}

.translation-box {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.translation-label {
    font-size: 18px;
    color: #999;
    margin-bottom: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.translation-text {
    font-size: 36px;
    color: #333;
    font-weight: 600;
}

.progress {
    text-align: center;
    font-size: 14px;
    color: #999;
    margin-bottom: 15px;
    font-weight: 400;
    opacity: 0.7;
}

.toggle-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.toggle-btn {
    padding: 12px 20px;
    font-size: 18px;
    font-weight: 600;
    border: 2px solid #2563A8;
    background: white;
    color: #2563A8;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    background: #E3F2FD;
}

.toggle-btn.active {
    background: #2563A8;
    color: white;
}

.controls {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.btn {
    flex: 1;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #ddd;
    background: #f8f9fa;
    color: #666;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.8;
}

.btn:hover {
    background: #e9ecef;
    color: #333;
    opacity: 1;
    border-color: #ccc;
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: #2563A8;
    color: white;
    border-color: #2563A8;
    opacity: 0.9;
}

.btn-primary:hover {
    background: #1F5494;
    opacity: 1;
}

.speed-control {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    opacity: 0.8;
}

.speed-control label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #666;
    font-size: 13px;
}

#speedSlider {
    width: 100%;
    margin-bottom: 8px;
    cursor: pointer;
}

#speedValue {
    display: inline-block;
    font-weight: 600;
    color: #2563A8;
    font-size: 14px;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .main-display {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .verb-display {
        font-size: 100px;
    }
    
    .translation-text {
        font-size: 30px;
    }
}

/* Tablet optimization */
@media (max-width: 768px) {
    .container {
        padding: 25px;
    }
    
    .main-display {
        padding: 25px;
        min-height: 400px;
    }
    
    .verb-display {
        font-size: 80px;
    }
    
    .speak-btn {
        font-size: 48px;
    }
    
    .pronunciation-display {
        font-size: 36px;
    }
    
    .translation-text {
        font-size: 24px;
    }
    
    .toggle-btn {
        padding: 10px 16px;
        font-size: 16px;
    }
    
    .btn {
        padding: 12px 18px;
        font-size: 15px;
    }
    
    .image-section img {
        max-height: 300px;
    }
}

/* Mobile phone optimization */
@media (max-width: 480px) {
    body > .container {
        margin: 10px auto;
    }
    
    .container {
        padding: 15px;
        border-radius: 15px;
    }
    
    .main-display {
        padding: 20px;
        min-height: 250px;
        gap: 15px;
    }
    
    .verb-display {
        font-size: 48px;
    }
    
    .speak-btn {
        font-size: 40px;
        padding: 8px;
    }
    
    .pronunciation-display {
        font-size: 28px;
    }
    
    .translation-box {
        padding: 15px;
    }
    
    .translation-text {
        font-size: 20px;
    }
    
    .progress {
        font-size: 12px;
        margin-bottom: 12px;
    }
    
    .toggle-controls {
        gap: 6px;
    }
    
    .toggle-btn {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .controls {
        gap: 6px;
        margin-bottom: 8px;
    }
    
    .btn {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .speed-control {
        padding: 12px;
        margin-top: 15px;
    }
    
    .speed-control label {
        font-size: 12px;
    }
    
    #speedValue {
        font-size: 12px;
    }
    
    .image-section img {
        max-height: 200px;
    }
}

/* Dark mode styles */
html.dark-mode body {
    background: linear-gradient(135deg, #1a2332 0%, #0f1823 100%);
}

html.dark-mode body .container {
    background: #1e2936;
}

html.dark-mode body h1 {
    color: #e8f1f8;
}

html.dark-mode body .main-display {
    background: #2a3441;
}

html.dark-mode body .verb-display {
    color: #e8f1f8;
}

html.dark-mode body .pronunciation-display {
    color: #5ba3d1;
}

html.dark-mode body .translation-box {
    background: #1e2936;
}

html.dark-mode body .translation-text {
    color: #d4dfe8;
}

html.dark-mode body .translation-label {
    color: #8a9db0;
}

html.dark-mode body .progress {
    color: #8a9db0;
}

html.dark-mode body .toggle-btn {
    background: #2a3441;
    color: #5ba3d1;
    border-color: #3d4f62;
}

html.dark-mode body .toggle-btn:hover {
    background: #1e2936;
}

html.dark-mode body .toggle-btn.active {
    background: #2563A8;
    color: white;
}

html.dark-mode body .btn {
    background: #2a3441;
    color: #a8b8c8;
    border-color: #3d4f62;
}

html.dark-mode body .btn:hover {
    background: #1e2936;
    color: #d4dfe8;
}

html.dark-mode body .btn-primary {
    background: #2563A8;
    color: white;
}

html.dark-mode body .btn-primary:hover {
    background: #1F5494;
}

html.dark-mode body .speed-control {
    background: #2a3441;
}

html.dark-mode body .speed-control label {
    color: #a8b8c8;
}

html.dark-mode body #speedValue {
    color: #5ba3d1;
}

/* ==========================================
   PAST PARTICIPLE: responsive sizes
   ========================================== */
@media (max-width: 1200px) {
    .participle { font-size: 100px; }
    .forms-line { font-size: 48px; }
}

@media (max-width: 768px) {
    .participle { font-size: 72px; padding: 4px 24px 10px; }
    .forms-line { font-size: 36px; gap: 12px; }
    .form-label { font-size: 12px; }
    .image-missing { min-height: 200px; font-size: 64px; }
}

@media (max-width: 480px) {
    .participle { font-size: 48px; padding: 4px 16px 8px; border-bottom-width: 4px; }
    .forms-line { font-size: 26px; gap: 8px; }
    .form-label { font-size: 10px; }
    .image-missing { min-height: 150px; font-size: 48px; }
}

/* ==========================================
   PAST PARTICIPLE: dark mode
   ========================================== */
html.dark-mode body .forms-line { color: #a8b8c8; }
html.dark-mode body .form-label { color: #6b7f93; }
html.dark-mode body .form-arrow { color: #3d4f62; }
html.dark-mode body .participle {
    background: #1e2936;
    color: #7cc0ec;
    box-shadow: none;
}
html.dark-mode body .image-missing {
    background: #1e2936;
    border-color: #3d4f62;
}

/* ==========================================
   LAYOUT UPDATE
   - French & Arabic side by side, in a row under the picture and word
   - Full-width speaker bar on phones
   - Swiping between words (see assets/js/swipe.js)
   ========================================== */
.main-display {
    grid-template-columns: 1fr 1fr;
    touch-action: pan-y; /* let the page handle sideways swipes */
}

.translation-section {
    grid-column: 1 / -1;
    flex-direction: row;
    gap: 20px;
}

.translation-box {
    flex: 1 1 0;
    min-width: 0;
}

/* No empty row when both translations are switched off */
.translation-section:not(:has(> .translation-box[style*="block"])) {
    display: none;
}

@media (max-width: 1200px) {
    .main-display {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .translation-section {
        gap: 12px;
    }

    .translation-box {
        padding: 14px 10px;
    }

    .translation-label {
        font-size: 13px;
        margin-bottom: 6px;
    }
}

/* Phones: speaker becomes a full-width bar under the word */
@media (max-width: 600px) {
    .verb-section {
        width: 100%;
    }

    .speak-btn {
        align-self: stretch;
        width: 100%;
        border-radius: 12px;
        padding: 10px;
        font-size: 34px;
        opacity: 1;
        background: rgba(37, 99, 168, 0.12);
        border: 2px solid rgba(37, 99, 168, 0.25);
    }

    .speak-btn:hover {
        transform: none;
        background: rgba(37, 99, 168, 0.2);
    }

    .speak-btn:active {
        transform: scale(0.98);
    }

    html.dark-mode body .speak-btn {
        background: rgba(91, 163, 209, 0.15);
        border-color: rgba(91, 163, 209, 0.35);
    }
}

/* Small "swipe" hint, only on touch screens */
.swipe-hint {
    display: none;
    text-align: center;
    font-size: 13px;
    color: #94a3b8;
    margin: -6px 0 14px;
}

@media (hover: none) and (pointer: coarse) {
    .swipe-hint {
        display: block;
    }
}

/* Swipe animation: the word area slides sideways without making the page scroll sideways */
body > .container {
    overflow-x: clip;
}
