/**
 * Word Evolution Modal - Mechanical Bible
 * Clean, minimal layout. Colors/fonts inherit from egyptian-theme.css.
 * Copyright (c) 2026 Tammy L Casey. All rights reserved.
 */

/* Modal Overlay */
.word-modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 10000;
    overflow-y: auto;
    padding: 10px;
}
.word-modal.show {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

/* Modal Content */
.word-modal-content {
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 6px;
    max-width: 780px;
    width: 100%;
    margin: 20px auto;
    padding: 20px 24px;
    position: relative;
    background: linear-gradient(135deg, #0a0808 0%, #1a1410 50%, #0a0808 100%);
}

/* Close Button */
.word-modal-close {
    position: absolute;
    top: 10px; right: 14px;
    font-size: 1.6rem;
    cursor: pointer;
    border: none;
    background: none;
    color: #806030;
    transition: all 0.2s ease;
}
.word-modal-close:hover {
    color: #d4af37;
    text-shadow: 0 0 8px rgba(212,175,55,0.5);
}

/* Word Header */
.word-header-section {
    text-align: center;
    padding: 0 0 14px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    margin-bottom: 14px;
}

.word-language-badge {
    display: inline-block;
    background: rgba(212, 175, 55, 0.12);
    padding: 2px 12px;
    border-radius: 3px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
    color: #a08040;
    border: 1px solid rgba(212, 175, 55, 0.25);
}

/* Large Hebrew display */
.word-hebrew-large {
    font-size: 3.2rem;
    text-align: center;
    color: #d4af37;
    text-shadow: 0 0 25px rgba(212, 175, 55, 0.35);
    margin: 6px 0;
    font-family: 'SBL Hebrew', 'Ezra SIL', 'Times New Roman', serif;
    direction: rtl;
}

.word-translit {
    font-size: 1rem;
    font-style: italic;
    color: #c0a060;
    margin: 4px 0;
}

.word-definition {
    color: #e0d0a0;
    font-size: 0.95rem;
    margin: 10px auto 0;
    padding: 10px 14px;
    background: rgba(212, 175, 55, 0.06);
    border-left: 3px solid #d4af37;
    border-radius: 0 4px 4px 0;
    text-align: left;
    max-width: 650px;
    line-height: 1.5;
}
.word-definition strong { color: #d4af37; }

.word-usage { font-size: 0.85rem; margin-top: 4px; }
.word-usage strong { color: #c0a060; }

/* Stats Row */
.word-stats-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 14px 0;
}
.word-stat-box {
    text-align: center;
    padding: 8px 16px;
    border: 1px solid rgba(212, 175, 55, 0.25);
    background: rgba(10, 8, 6, 0.6);
    border-radius: 4px;
    min-width: 80px;
}
.word-stat-value {
    font-size: 1.1rem;
    font-weight: bold;
    color: #d4af37;
}
.word-stat-label {
    font-size: 0.7rem;
    margin-top: 2px;
    color: #806030;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Section Headers */
.word-section-header {
    font-size: 0.85rem;
    margin: 16px 0 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    color: #d4af37;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Pictographic */
.word-pictographic {
    font-size: 0.95rem;
    text-align: center;
    color: #e0d0a0;
    padding: 10px 14px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    background: rgba(212, 175, 55, 0.04);
    margin: 8px 0;
    border-radius: 4px;
    line-height: 1.5;
}

/* Letter Table */
.word-letter-table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.word-letter-table th,
.word-letter-table td {
    border: 1px solid rgba(212, 175, 55, 0.2);
    padding: 6px 8px;
    text-align: center;
    font-size: 0.8rem;
    color: #c0a060;
}
.word-letter-table th {
    background: rgba(212, 175, 55, 0.1);
    font-weight: 600;
    font-size: 0.7rem;
    color: #a08040;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.word-letter-table td:first-child {
    font-size: 1.4rem;
    color: #d4af37;
    font-family: 'SBL Hebrew', 'Ezra SIL', serif;
}
.word-letter-table td:nth-child(2) { font-size: 0.85rem; }

/* Timeline */
.word-timeline { margin: 8px 0; }
.word-timeline-stage {
    display: flex;
    border: 1px solid rgba(212, 175, 55, 0.2);
    margin: 4px 0;
    border-radius: 4px;
    overflow: hidden;
    background: rgba(10, 8, 6, 0.5);
}
.word-timeline-num {
    background: rgba(212, 175, 55, 0.1);
    padding: 8px 12px;
    min-width: 38px;
    text-align: center;
    font-weight: bold;
    font-size: 0.85rem;
    color: #d4af37;
    display: flex;
    align-items: center;
    justify-content: center;
}
.word-timeline-content {
    padding: 8px 12px;
    flex: 1;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #c0a060;
}
.word-timeline-content strong { color: #e0d0a0; }
.word-timeline-period {
    font-size: 0.75rem;
    margin-left: 6px;
    color: #806030;
}
.word-timeline-hebrew {
    font-size: 1.2rem;
    color: #d4af37;
    font-family: 'SBL Hebrew', 'Ezra SIL', serif;
}
.greek-word {
    font-size: 1.1rem;
    font-style: normal;
    color: #c0b080;
}

/* Sources */
.word-sources {
    margin-top: 14px;
    padding: 10px 12px;
    background: rgba(10, 8, 6, 0.6);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 4px;
    font-size: 0.75rem;
    color: #806030;
    line-height: 1.6;
}
.word-sources strong { color: #a08040; }

/* Loading */
.word-modal-loading {
    text-align: center;
    padding: 40px 10px;
    font-size: 1rem;
    color: #a08040;
}

/* First occurrence */
.word-modal-body p { color: #a08040; font-size: 0.85rem; margin: 6px 0; }
.word-modal-body p strong { color: #c0a060; }

/* Control Word Styling */
.control-word-badge {
    background: linear-gradient(135deg, #5c0000, #aa2222);
    color: #ffcccc;
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 8px;
    border: 1px solid #cc4444;
    font-size: 0.8rem;
    letter-spacing: 1px;
}
.control-mechanism {
    background: rgba(100, 0, 0, 0.2);
    border-left: 3px solid #cc4444;
    padding: 8px 12px;
    margin-bottom: 10px;
    color: #ffcccc;
    font-size: 0.85rem;
}
.original-meaning { color: #4ade80; font-weight: bold; }
.corrupted-meaning { color: #ff6b6b; font-weight: bold; }
.mechanism { color: #807060; font-style: italic; display: block; margin-top: 3px; font-size: 0.8rem; }
.mechanism.decay { color: #cc9999; }
.mechanism.decay.final { color: #ff4444; font-weight: bold; }
.word-timeline-stage.corrupted { background: rgba(100, 0, 0, 0.12); border-color: rgba(200, 60, 60, 0.4); }
.word-timeline-stage.corrupted .word-timeline-num { background: linear-gradient(135deg, #5c0000, #aa2222); color: #ffcccc; }

/* Mobile */
@media (max-width: 768px) {
    .word-modal-content { margin: 8px auto; padding: 14px 16px; }
    .word-hebrew-large { font-size: 2.4rem; }
    .word-stats-row { gap: 6px; }
    .word-stat-box { padding: 6px 10px; min-width: 65px; }
    .word-stat-value { font-size: 1rem; }
    .word-letter-table th, .word-letter-table td { padding: 4px 3px; }
    .word-timeline-stage { flex-direction: column; }
    .word-timeline-num { padding: 4px; }
}
