:root {
    --bg-color: #fdfbf7;
    --primary-color: #0b1c2c;
    --accent-color: #d4af37;
    --text-color: #1a1a1a;
    --playing-bg: rgba(11, 28, 44, 0.08);
    --bottom-bar-height: 110px;
}

@font-face {
    font-family: 'Guttman Stam';
    src: url('./fonts/guttman-stam.ttf') format('truetype');
    font-weight: normal; font-style: normal;
}

@font-face {
    font-family: 'SBL Hebrew';
    src: url('./fonts/SBL-Hebrew.ttf') format('truetype');
    font-weight: normal; font-style: normal;
}

body {
    margin: 0; padding: 0;
    font-family: 'Heebo', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    padding-bottom: var(--bottom-bar-height);
    overflow-x: hidden;
}

/* מסך פתיחה */
#welcomeOverlay {
    position: fixed; top:0; left:0; width:100%; height:100%;
    background: var(--primary-color); z-index: 9999;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: white; text-align: center;
}
#welcomeOverlay h1 { font-family: 'Frank Ruhl Libre', serif; font-size: 3.5rem; margin-bottom: 10px; }
#welcomeOverlay p { font-size: 1.2rem; color: var(--accent-color); margin-bottom: 30px; }
.welcome-btns { display: flex; gap: 20px; }
.welcome-btn {
    background: var(--accent-color); color: var(--primary-color); border: none;
    padding: 15px 30px; border-radius: 50px; font-weight: bold; cursor: pointer; font-size: 1.1rem;
}
.welcome-btn.secondary { background: transparent; border: 2px solid var(--accent-color); color: var(--accent-color); }

header {
    background-color: var(--primary-color);
    color: white; padding: 20px 40px;
    border-bottom: 4px solid var(--accent-color);
    display: flex; justify-content: space-between; align-items: center;
}

.header-text { display: flex; flex-direction: column; flex: 1; }
header h1 { margin: 0; font-family: 'Frank Ruhl Libre', serif; font-size: 2.5rem; text-align: right; cursor: pointer; }
header h2 { margin: 0; color: var(--accent-color); font-size: 1rem; text-align: right; font-weight: 400; line-height: 1.4; }

.header-actions { display: flex; gap: 10px; align-items: center; }

.top-nav-bar {
    background-color: #fff; position: sticky; top: 0; z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); overflow-x: auto;
    display: flex; justify-content: flex-start; padding: 10px;
}

.chapter-nav { display: flex; gap: 8px; padding: 0 10px; }

.chapter-btn {
    background-color: #f8f8f8; color: var(--primary-color);
    border: 1px solid #ddd; padding: 8px 15px;
    border-radius: 8px; cursor: pointer; font-weight: 600; white-space: nowrap;
}

.chapter-btn.active { background-color: var(--accent-color); border-color: var(--accent-color); }

.instructions-hint { text-align: center; font-size: 1rem; color: #444; margin: 15px 0; font-weight: bold; }
.instructions-hint.hidden { display: none; }

.tikkun-wrapper { max-width: 1200px; margin: 20px auto; padding: 0 20px; }

.dual-view-container { 
    display: grid; grid-template-columns: 1fr 1fr; gap: 15px; width: 100%; 
}

.column { 
    background: white; padding: 30px; border-radius: 12px; 
    border-bottom: 5px solid var(--accent-color); box-shadow: 0 4px 20px rgba(0,0,0,0.03); 
}

.text-content { line-height: 2.2; text-align: justify; word-wrap: break-word; }
.mode-chumash .text-content { font-family: 'SBL Hebrew', serif; }
.mode-megillah .text-content { font-family: 'Guttman Stam', serif; }

.k-katan { color: var(--accent-color); font-weight: normal; } 
.verse-num { color: #999; font-size: 0.55em; margin-left: 8px; font-family: 'Heebo', sans-serif; }
.pasuk { border-radius: 6px; padding: 0 4px; cursor: pointer; transition: 0.2s; display: inline; }
.pasuk.playing-now { background-color: var(--playing-bg); border-bottom: 3px solid var(--accent-color); }

.mode-chumash .text-without { display: none; }
.mode-megillah .text-with, .mode-megillah .verse-num { display: none; }

.floating-controls {
    position: fixed; bottom: calc(var(--bottom-bar-height) + 20px);
    left: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 1001;
}

.f-btn {
    background: var(--accent-color); color: var(--primary-color);
    border: none; padding: 12px 22px; border-radius: 50px;
    font-weight: bold; box-shadow: 0 4px 15px rgba(0,0,0,0.2); cursor: pointer;
    font-family: 'Heebo', sans-serif; font-size: 0.95rem;
}

.bottom-nav-btns { display: flex; justify-content: center; gap: 20px; margin-top: 30px; padding: 20px 0; }
.nav-btn {
    background: var(--primary-color); color: white; border: none;
    padding: 10px 25px; border-radius: 8px; cursor: pointer; font-weight: bold;
}

.bottom-player-bar {
    position: fixed; bottom: 0; left: 0; right: 0;
    background-color: var(--primary-color); height: var(--bottom-bar-height);
    z-index: 1000; display: flex; justify-content: center; align-items: center;
}

.player-content { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: 800px; padding: 0 20px; }

.main-play-btn {
    background: var(--accent-color); border: none; width: 62px; height: 62px;
    border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.main-play-btn svg { width: 30px; height: 30px; fill: var(--primary-color); }

.mini-btn {
    background: rgba(255,255,255,0.1); color: #fff; border: 1px solid rgba(255,255,255,0.2);
    padding: 6px 10px; border-radius: 10px; cursor: pointer; font-size: 0.75rem; min-width: 50px; font-family: 'Heebo', sans-serif;
}

/* מודלים */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); z-index: 10005; align-items: center; justify-content: center;
}
.modal-box {
    background: #fff; padding: 25px; border-radius: 12px; width: 90%; max-width: 500px;
    color: var(--text-color); box-shadow: 0 5px 20px rgba(0,0,0,0.3); max-height: 85vh; overflow-y: auto;
}
.modal-box h3 { margin-top: 0; color: var(--primary-color); font-family: 'Frank Ruhl Libre', serif; font-size: 1.8rem; border-bottom: 2px solid var(--accent-color); padding-bottom: 10px; }
.close-modal { float: left; cursor: pointer; font-size: 1.5rem; color: #888; border: none; background: none; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-weight: bold; margin-bottom: 5px; }
.form-group input, .form-group textarea { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 6px; font-family: 'Heebo', sans-serif; box-sizing: border-box; }
.submit-btn { background: var(--primary-color); color: white; border: none; padding: 10px 20px; border-radius: 6px; cursor: pointer; font-weight: bold; width: 100%; font-size: 1.1rem; }

.admin-stats { margin-bottom: 20px; background: #f8f8f8; padding: 15px; border-radius: 8px; border: 1px solid #eee; }
.admin-stats p { margin: 5px 0; font-weight: bold; }
.data-list { list-style: none; padding: 0; margin: 0; font-size: 0.9rem; }
.data-list li { background: #fff; margin-bottom: 8px; padding: 8px; border: 1px solid #ddd; border-radius: 4px; }

@media (max-width: 768px) {
    header { flex-direction: column; padding: 15px; text-align: center; gap: 15px; }
    .header-text { align-items: center; }
    header h1, header h2 { text-align: center; }
    .welcome-btns { flex-direction: column; gap: 15px; width: 80%; }
    .welcome-btn { width: 100%; box-sizing: border-box; }
    .mini-btn { font-size: 0.7rem; padding: 5px 8px; }
    #welcomeOverlay h1 { font-size: 2.2rem; }
}
