/* ===== VARIABLES & BASE ===== */
:root {
    --bg: #f0ede8;
    --surface: #ffffff;
    --surface2: #faf9f7;
    --border: #e0dbd2;
    --text-primary: #1a1713;
    --text-secondary: #6b6560;
    --text-muted: #a09a94;
    --accent: #2d6a4f;
    --accent-light: #52b788;
    --accent-dark: #1b4332;
    --danger: #e63946;
    --warning: #f4a261;
    --icon-container-bg: #fffef9;
    --icon-container-border: var(--border);
    --header-h: 96px;
    --radius: 12px;
    --radius-lg: 18px;
    font-size: 16px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Heebo', sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== SKIP LINK ===== */
.skip-link {
    position: absolute;
    top: -100%;
    right: 0;
    background: var(--accent);
    color: white;
    padding: 12px 24px;
    z-index: 10000;
    border-radius: 0 0 0 8px;
    font-weight: 700;
    text-decoration: none;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
}

/* ===== SPLASH ===== */
#splash-screen {
    position: fixed;
    inset: 0;
    background: var(--accent-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 9999;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

#splash-screen.fade-out {
    opacity: 0;
    transform: scale(1.04);
    pointer-events: none;
}

.splash-logo { animation: bounceIn 0.6s ease; }

.splash-test-icon {
    width: 72px;
    height: 140px;
    background: var(--icon-container-bg);
    border: 3px solid var(--border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    margin: 0 auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    position: relative;
    padding-top: 20px;
}

.test-icon-clipboard-clip {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 15px;
    background: #666;
    border-radius: 4px;
}

.test-icon-paper {
    width: 90%;
    height: 90%;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    color: var(--text-muted);
}

.test-line {
    font-weight: 700;
    font-size: 1.2rem;
    line-height: 1;
}

.test-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.test-opt-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.test-checkbox {
    width: 16px;
    height: 16px;
    border: 2px solid var(--text-muted);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: transparent;
    font-size: 14px;
}

.test-opt-text {
    font-size: 1.1rem;
    line-height: 1;
}

.is-correct-opt .test-checkbox {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(45, 106, 79, 0.1);
}

.is-correct-opt .test-opt-text {
    color: var(--accent);
    font-weight: 700;
}

.splash-title {
    font-size: 2.2rem;
    font-weight: 900;
    color: white;
    letter-spacing: -0.5px;
}

.splash-sub {
    font-size: 1rem;
    color: rgba(255,255,255,0.6);
    font-weight: 300;
}

.splash-loader {
    width: 48px;
    height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
}

.splash-loader div {
    height: 100%;
    width: 40%;
    background: var(--accent-light);
    border-radius: 2px;
    animation: slide 1s ease-in-out infinite;
}

@keyframes slide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

@keyframes bounceIn {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* ===== MAIN APP ===== */
.hidden-app {
    opacity: 0;
    transition: opacity 0.4s ease;
}

.hidden-app.visible {
    opacity: 1;
}

/* ===== HEADER ===== */
.app-header {
    position: sticky;
    top: 0;
    height: var(--header-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-area > a + a {
    margin-right: 16px;
}

.site-logo {
    height: 68px;
    width: auto;
    object-fit: contain;
}

.logo-test-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 48px;
    background: #fffef9;
    border: 2px solid #d0ccc5; 
    border-radius: 8px;
    flex-shrink: 0;
    position: relative;
    margin-top: 6px; 
}

.logo-test-icon .test-icon-clipboard-clip {
    position: absolute;
    width: 14px;
    height: 8px;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    background: #888;
    border-radius: 3px;
}

.logo-test-icon .test-icon-paper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0;
    width: 100%;
    margin-top: 4px;
}

.logo-test-icon .test-opt-row {
    margin: 0;
    padding: 0;
}

.logo-test-icon .test-checkbox {
    width: 12px;
    height: 12px;
    font-size: 10px;
    border: 2px solid #b3b0a9; 
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
}

.logo-test-icon .is-correct-opt .test-checkbox {
    border-color: #2d6a4f; 
    color: #1a73e8; 
    font-weight: 900;
    background: rgba(45, 106, 79, 0.05);
}

.logo-text-group {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.logo-title {
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1.2;
}

.logo-sub {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-secondary);
    line-height: 1.2;
}

.header-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 8px 16px;
    border: 1px solid var(--accent);
    border-radius: 20px;
    transition: background 0.2s, color 0.2s;
}

.header-link:hover {
    background: var(--accent);
    color: white;
}

.header-link:focus-visible {
    outline: 3px solid var(--accent-light);
    outline-offset: 2px;
}

/* ===== LAYOUT & APP SPECIFIC ===== */
.three-col-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    justify-content: center;
}

.main-content {
    width: 100%;
    max-width: 750px;
}

.page-title-area {
    text-align: center;
    margin: 20px 0 30px 0;
}

.page-title-area h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.page-title-area p {
    font-size: 1rem;
    color: var(--text-secondary);
}

.container {
    background: var(--surface);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid var(--border);
}

/* Tabs */
.tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    gap: 10px;
}

.tabs button {
    padding: 10px 25px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.tabs button:focus-visible {
    outline: 3px solid var(--accent-light);
    outline-offset: 2px;
}

.tabs button.active-tab {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Inputs */
.input-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: block;
}

input[type="text"] {
    width: 100%;
    padding: 14px 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 16px;
    background-color: var(--surface2);
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
    background-color: var(--surface);
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.1);
}

.option-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    gap: 15px;
}

.option-row input[type="text"] { flex-grow: 1; }
.option-row input[type="checkbox"] {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: var(--accent);
}

/* Buttons */
.action-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

button {
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

button:focus-visible {
    outline: 3px solid var(--accent-light);
    outline-offset: 2px;
}

.primary-btn {
    padding: 12px 24px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    transition: background 0.2s;
}
.primary-btn:hover { background: var(--accent-dark); }

.outline-btn {
    padding: 12px 24px;
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    transition: background 0.2s;
}
.outline-btn:hover { background: rgba(45, 106, 79, 0.05); }

.finish-btn {
    width: 100%;
    padding: 15px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 18px;
    font-weight: 700;
    margin-top: 10px;
    transition: background 0.2s;
}
.finish-btn:hover { background: var(--accent-dark); }

/* רשימת שאלות ועריכה */
.divider { border: 0; height: 1px; background: var(--border); margin: 30px 0; }
.list-title { font-size: 18px; color: var(--text-primary); margin-bottom: 15px; }

#questions-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.question-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface2);
    border: 1px solid var(--border);
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.question-list-item:hover {
    background: var(--surface);
    border-color: #ccc;
}

.q-text {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 16px;
}

.q-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: background 0.2s, transform 0.1s;
}

.icon-btn:hover {
    background: var(--border);
}

.icon-btn:active {
    transform: scale(0.9);
}

.delete-btn:hover {
    background: #fff3f3;
}

/* Share Box */
.share-box {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 20px;
}

.share-input-wrapper { display: flex; gap: 10px; margin-top: 10px; }
#share-link-input { direction: ltr; text-align: left; background: var(--surface); }
.copy-btn {
    padding: 0 20px;
    background: var(--text-secondary);
    color: white;
    border: none;
    border-radius: var(--radius);
    transition: background 0.2s;
    white-space: nowrap;
}
.copy-btn:hover { background: var(--text-primary); }
.copy-btn.copied { background: var(--accent); }

/* Quiz Styles */
.quiz-progress {
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.quiz-question-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 30px;
    text-align: center;
}

.quiz-options-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.mc-option-btn {
    padding: 15px 20px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 18px;
    color: var(--text-primary);
    text-align: right;
    transition: all 0.2s;
}

.mc-option-btn:hover:not(:disabled) {
    border-color: var(--accent-light);
    background: rgba(82, 183, 136, 0.05);
}

/* Animations */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.wrong-anim {
    animation: shake 0.4s ease-in-out;
    background-color: #fff3f3 !important;
    border-color: var(--danger) !important;
    color: var(--danger) !important;
}

.correct-anim {
    background-color: #f3fdf6 !important;
    border-color: #28a745 !important;
    color: #28a745 !important;
    font-weight: bold;
}

/* ===== AD CONTAINER ===== */
.ad-container {
    margin-top: 30px;
    text-align: center;
}

/* ===== FOOTER ===== */
.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    margin-top: 48px;
    padding: 32px 24px;
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.footer-logo img {
    border-radius: 8px;
    opacity: 0.85;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    justify-content: center;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-links a:focus-visible {
    outline: 2px solid var(--accent-light);
    outline-offset: 2px;
}

.footer-copy {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 0;
}

/* ===== ACCESSIBILITY WIDGET ===== */
#accessibility-widget {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9998;
}

#acc-toggle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, background 0.2s;
    cursor: pointer;
}

#acc-toggle:hover {
    transform: scale(1.1);
    background: var(--accent-dark);
}

.acc-panel {
    position: absolute;
    bottom: 60px;
    left: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 180px;
    animation: fadeUp 0.2s ease;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.acc-panel-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.acc-option {
    padding: 10px 14px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    text-align: right;
    transition: background 0.2s, border-color 0.2s;
}

.acc-option:hover {
    background: rgba(45, 106, 79, 0.06);
    border-color: var(--accent-light);
}

.acc-option:focus-visible {
    outline: 3px solid var(--accent-light);
    outline-offset: 1px;
}

/* ===== ACCESSIBILITY MODES ===== */
body.acc-high-contrast {
    --bg: #000000;
    --surface: #1a1a1a;
    --surface2: #111111;
    --border: #ffff00;
    --text-primary: #ffffff;
    --text-secondary: #ffff00;
    --text-muted: #cccccc;
    --accent: #00ff00;
    --accent-light: #66ff66;
    --accent-dark: #009900;
}

body.acc-high-contrast .app-header {
    background: #1a1a1a;
    border-bottom-color: #ffff00;
}

body.acc-high-contrast .site-footer {
    background: #000;
}

body.acc-underline-links a {
    text-decoration: underline !important;
    text-underline-offset: 3px;
}

body.acc-readable-font,
body.acc-readable-font * {
    font-family: Arial, Helvetica, sans-serif !important;
    letter-spacing: 0.02em;
}

/* ===== STATIC PAGES ===== */
.static-page {
    max-width: 750px;
    margin: 0 auto;
    padding: 32px 24px;
}

.static-page-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.static-page h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.static-page h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 28px;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--border);
}

.static-page p,
.static-page li {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.static-page ul {
    padding-right: 24px;
    margin-bottom: 16px;
}

.static-page a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.static-page a:hover {
    color: var(--accent-dark);
}

.static-page .contact-info {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-top: 20px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    :root {
        --header-h: 72px;
    }

    .site-logo { height: 48px; }
    .logo-title { font-size: 1.05rem; }
    .logo-sub { font-size: 0.9rem; }

    .container { padding: 24px 16px; }
    .page-title-area h1 { font-size: 1.5rem; }

    .tabs { flex-direction: column; }
    .tabs button { width: 100%; text-align: center; }

    .action-buttons {
        flex-direction: column;
        gap: 10px;
    }
    .action-buttons button { width: 100%; }

    .share-input-wrapper {
        flex-direction: column;
    }

    .static-page { padding: 24px 16px; }
    .static-page h1 { font-size: 1.5rem; }

    .quiz-question-title { font-size: 20px; }
    .mc-option-btn { font-size: 16px; padding: 12px 16px; }
}
