/* ==========================================================================
   1. FONTOVI I VARIJABLE
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Kalam:wght@400;700&family=Itim&family=Lato:wght@400;500;700&display=swap');

:root {
    --primary: #145234;
    --bg-creamy: #fdfbf0;
    --text-main: #1e293b;
    --accent-yellow: #fff9c4;
    --accent-green: #f0fdf4;  
    --accent-border-y: #fde68a;
    --accent-border-g: #bbf7d0;
}

/* ==========================================================================
   2. GLOBALNI SETUP
   ========================================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { 
    height: 100vh; 
    width: 100vw; 
    font-family: 'Lato', sans-serif;
    overflow: hidden; 
}

/* Font za Ilmihal I - dječiji */
.ilmihal1-font,
.ilmihal1-font * {
    font-family: 'Itim', cursive !important;
}

/* Font za Ilmihal II, III i kvizove - ozbiljniji */
.ilmihal2-font,
.ilmihal3-font,
.quiz-font,
.ilmihal2-font *,
.ilmihal3-font *,
.quiz-font * {
    font-family: 'Lato', sans-serif !important;
}

/* ==========================================================================
   3. LAYOUT SISTEM (Sidebar i Viewer) - OPTIMIZIRANO ZA SAFARI
   ========================================================================== */
#ilmihal-sustav { 
    display: flex; 
    height: 100dvh; 
    width: 100vw; 
    position: relative;
    background: var(--bg-creamy);
    overflow: hidden; 
    fixed: top 0 left 0;
}

#ilmihal-sidebar { 
    width: 340px; 
    height: 100%; 
    background: white; 
    display: flex; 
    flex-direction: column; 
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    border-right: none;
    overflow: hidden;
}

#ilmihal-sidebar.closed { 
    transform: translateX(-340px); 
    margin-right: -340px; 
}

#meni-lista { 
    flex: 1 1 auto; 
    overflow-y: auto !important; 
    background: white; 
    -webkit-overflow-scrolling: touch;
}

#viewer-container { 
    flex: 1; 
    height: 100%; 
    background: var(--bg-creamy); 
    position: relative; 
    overflow: hidden; 
}

#ilmihal_frame { 
    width: 100%; 
    height: 100%; 
    border: none; 
    background: transparent;
    overflow: auto;
}

/* ==========================================================================
   4. NAVIGACIJA (Header, Tabovi, Hamburger, Dugmad)
   ========================================================================== */
.ilmihal-header { 
    background: var(--primary); 
    padding: 20px; 
    color: white; 
    display: flex; 
    flex-direction: column; /* Promjena u kolonu zbog tabova */
    justify-content: center;
    height: 120px; /* Povećana visina za tabove */
}

/* TABOVI ZA IZBOR KNJIGE I, II, III */
.knjiga-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
    margin-left: 35px; /* Razmak zbog hamburgera */
}

.tab-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    font-family: 'Kalam', cursive;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab-btn.active {
    background: var(--accent-yellow);
    color: var(--primary);
    border-color: var(--accent-yellow);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.ilmihal-header h2 { 
    margin-left: 35px; 
    font-family: 'Kalam', cursive; 
    font-size: 24px;
    text-align: center;
}

.hamburger-btn { 
    position: fixed; 
    top: 15px; 
    left: 20px; 
    z-index: 2000; 
    background: var(--primary); 
    border: none; 
    color: white; 
    font-size: 32px; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.accordion-trigger { 
    padding: 18px 20px; 
    background: #fef9c3; 
    border-bottom: 2px solid #fde68a; 
    font-weight: 900; 
    font-size: 14px; 
    color: var(--primary); 
    cursor: pointer; 
    font-family: 'Itim', cursive;
}

.accordion-trigger.active { background: var(--primary); color: white; }

.ilmihal-btn { 
    padding: 15px 30px; 
    font-size: 15px; 
    font-weight: 700; 
    border-bottom: 1px solid #f1f5f9; 
    cursor: pointer; 
    font-family: 'Itim', cursive;
    transition: 0.2s;
    position: relative;
}

/* OZNAKA NAUČENIH LEKCIJA U MENIJU */
.ilmihal-btn.completed {
    color: #2e7d32 !important;
    background-color: #f0fdf4;
    border-left: 6px solid #2e7d32;
}

.ilmihal-btn.active { 
    border-left: 10px solid var(--primary); 
    background: var(--bg-creamy); 
    color: var(--primary); 
    font-weight: 900;
}

/* ==========================================================================
   5. LEKCIJA (Body, Text, Hero Image)
   ========================================================================== */
.lesson-body { 
    font-family: 'Itim', cursive !important; 
    background: var(--bg-creamy) !important; 
    padding: 60px 40px; 
    line-height: 1.8;
    height: 100vh;
    overflow-y: auto !important; 
}

.lesson-container { max-width: 850px; margin: 0 auto; }

h1 { 
    font-family: 'Kalam', cursive; 
    color: var(--primary); 
    font-size: 52px; 
    text-align: center; 
    margin-bottom: 15px; 
}

.hero-box { 
    border: 12px solid white; 
    border-radius: 45px; 
    box-shadow: 0 15px 45px rgba(0,0,0,0.08); 
    overflow: hidden; 
    margin-bottom: 30px; 
}

.hero-box img { width: 100%; display: block; }

.lesson-text { 
    font-family: 'Itim', cursive; 
    font-size: 1.6rem; 
    color: var(--text-main); 
    margin-bottom: 25px; 
}

/* ==========================================================================
   6. UNUTRAŠNJI ACCORDION LEKCIJE
   ========================================================================== */
.lesson-accordion {
    margin-top: 20px;
    border-radius: 20px; 
    margin-bottom: 20px;
    background: white;
}

.lesson-section-btn {
    width: 100%;
    padding: 20px;
    background: white;
    border: 3px solid var(--accent-border-y); 
    border-radius: 20px; 
    font-family: 'Kalam', cursive;
    font-size: 1.8rem;
    color: var(--primary);
    cursor: pointer;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.3s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.lesson-section-btn:hover { 
    background: var(--accent-yellow); 
    border-color: var(--accent-border-y);
}

.lesson-content {
    display: none; 
    padding: 30px;
    background: white;
    border-left: 3px solid var(--accent-border-y);
    border-right: 3px solid var(--accent-border-y);
    border-bottom: 3px solid var(--accent-border-y);
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    margin-top: -10px; 
}

.lesson-content.active {
    display: block;
}

.section-icon { 
    font-size: 1.2rem; 
    transition: transform 0.3s;
}

/* ==========================================================================
   7. MULTIMEDIJA I BOXOVI (Play, Info, Arabic)
   ========================================================================== */
.audio-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.play-main-btn, .pause-btn, .stop-btn {
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    font-family: 'Kalam', cursive;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
    font-size: 1.1rem;
}

.play-main-btn { background: var(--primary); }
.pause-btn { background: #d97706; }
.stop-btn { background: #dc2626; }

.info-box, .arabic-card { 
    font-family: 'Itim', cursive; 
    padding: 20px; 
    border-radius: 25px; 
    margin: 20px 0; 
    font-size: 1.5rem; 
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}

.info-box { background: var(--accent-yellow); border: 3px solid var(--accent-border-y); color: #854d0e; }
.arabic-card {
    background-color: var(--accent-green); /* Tvoja varijabla za svijetlo zelenu */
    border: 2px solid var(--accent-border-g);
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    text-align: center; /* DODANO: Centriranje teksta */
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

/* Osiguraj da i arapski tekst unutar boxa bude centriran */
.arabic-text {
    display: block;
    text-align: center;
    font-size: 32px; /* Smanjeno prema prethodnom zahtjevu */
    line-height: 1.8;
    margin: 10px 0;
    direction: rtl; /* Arapski se piše s desna na lijevo */
}
.trans-text { font-size: 1.4rem; font-style: italic; display: block; margin-top: 10px; }

/* ==========================================================================
   8. RESPONZIVNOST (Prilagođavanje za mobitele)
   ========================================================================== */
#mobile-hamburger, .btn-wow, [href*="kviz"], .group-container { display: none; }
.group-container.show { display: block !important; }

@media (max-width: 768px) {
    .lesson-body { padding: 20px 15px !important; }
    h1 { font-size: 32px; margin-bottom: 15px; }
    .lesson-text { font-size: 1.25rem; line-height: 1.5; margin-bottom: 20px; }
    .info-box, .arabic-card { padding: 20px; margin: 20px 0; font-size: 1.2rem; border-radius: 15px; }
    .lesson-section-btn { padding: 15px; font-size: 1.4rem; }
    .arabic-text { font-size: 38px; }
    .trans-text { font-size: 1.1rem; }

    #ilmihal-sidebar { position: fixed; left: -340px; }
    #ilmihal-sidebar.open { transform: translateX(340px); }
    .ilmihal-header h2 { font-size: 20px; }
    .knjiga-tabs { margin-left: 20px; }
}
/* Stil za pojmove iz rječnika */
.pojam {
    position: relative;
    display: inline-block;
    text-decoration: none;
}

/* Osiguravamo da se kursor promijeni u upitnik kad se pređe preko riječi */
.pojam:hover {
    cursor: help;
    background-color: rgba(46, 125, 50, 0.1);
}
/* Stil za naš prilagođeni Popup prozor */
#pojam-modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Zatamnjena pozadina */
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-sadrzaj {
    background: #fdfbf0; /* Tvoja bež boja */
    padding: 30px;
    border-radius: 25px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    border: 5px solid #145234;
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
    animation: iskoci 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes iskoci {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
/* POBOLJŠANI STIL ZA KVIZ */
.quiz-container { background: white; padding: 25px; border-radius: 25px; border: 4px solid var(--primary); margin: 20px 0; box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
.quiz-title { font-family: 'Kalam', cursive; color: var(--primary); font-size: 2.2rem; text-align: center; margin-bottom: 20px; border-bottom: 3px dashed var(--accent-yellow); padding-bottom: 10px; }
.quiz-question { font-weight: bold; margin-bottom: 20px; color: var(--primary); font-size: 1.6rem; line-height: 1.4; }
.quiz-options { display: flex; flex-direction: column; gap: 12px; }

.quiz-option { 
    padding: 16px; 
    border: 2px solid #e2e8f0; 
    border-radius: 15px; 
    cursor: pointer; 
    transition: all 0.2s ease; 
    font-size: 1.3rem; 
    background: #f8fafc;
    position: relative;
}

.quiz-option:hover { 
    background: var(--accent-green); 
    border-color: var(--primary); 
    transform: translateY(-2px);
}

/* Stanja nakon klika */
.quiz-option.correct { 
    background: #dcfce7 !important; 
    border-color: #22c55e !important; 
    color: #166534 !important; 
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}

.quiz-option.wrong { 
    background: #fee2e2 !important; 
    border-color: #ef4444 !important; 
    color: #991b1b !important;
}

.quiz-results { 
    margin-top: 25px; 
    text-align: center; 
    font-size: 1.8rem; 
    font-family: 'Kalam', cursive;
    color: var(--primary);
    padding: 15px;
    border-radius: 15px;
    background: var(--accent-yellow);
    display: none; 
}

.retry-btn { 
    margin-top: 15px; 
    background: #dc2626; 
    color: white; 
    border: none; 
    padding: 12px 30px; 
    border-radius: 50px; 
    cursor: pointer; 
    font-family: 'Itim', cursive; 
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.3);
}
/* --- STIL ZA TABELE (Zekat i Podjela namaza) --- */
.zekat-table, .sorting-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    margin-bottom: 20px;
    background-color: #ffffff; /* Bijela pozadina unutar ćelija radi čitljivosti */
}

.zekat-table th, .zekat-table td, 
.sorting-table th, .sorting-table td {
    border: 2px solid #2e7d32; /* Tamnozeleni okvir */
    padding: 12px;
    text-align: center;
    vertical-align: middle;
}

.zekat-table th, .sorting-table th {
    background-color: #fff9c4; /* Tvoja definisana žuta za isticanje */
    color: #000;
    text-transform: uppercase;
    font-weight: normal; /* Isključujemo bold jer se ne vidi u tvom fontu */
}

/* Posebno poravnanje za tabelu Zekata (tekst u redovima lijevo) */
.zekat-table td {
    text-align: left;
}

/* --- STIL ZA LISTE (Pitanja i nabrajanja) --- */
.lesson-content ol, .lesson-content ul {
    padding-left: 50px; 
    margin-right: 20px;
    margin-top: 15px;
    margin-bottom: 15px;
}

.lesson-content li {
    margin-bottom: 12px;
    line-height: 1.6;
}

/* --- DODATNA POMOĆNA FORMATIRANJA --- */

/* Naslov sekcije unutar akordiona (kao "Pitanja", "Zadaci") */
.section-subtitle {
    background-color: #fff9c4;
    text-transform: uppercase;
    display: inline-block;
    padding: 2px 8px;
    margin-top: 10px;
    margin-bottom: 10px;
}

/* Poravnanje za arapski tekst u dovi */
.arabic-text-large {
    text-align: center;
    font-size: 1.8rem;
    line-height: 2.2;
    direction: rtl;
}

/* Transkripcija (ispod arapskog teksta) */
.transliteration {
    font-size: 1.2rem;
    line-height: 1.5;
    margin-top: 15px;
    color: #333;
}
/* =============================
   DODATAK ZA KVIZOVE -
   ============================= */

/* Stilovi za kviz dugmad */
.quiz-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-family: 'Itim', cursive;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin: 10px;
}

.quiz-btn:hover {
    background: #2d8659;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.quiz-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Kontejner za kontrole kviza */
#quiz-controls {
    margin-top: 30px;
    margin-bottom: 30px;
    text-align: center;
    padding: 20px 0;
}

/* Responzivnost za mobilne uređaje */
@media (max-width: 768px) {
    .quiz-btn {
        padding: 12px 24px;
        font-size: 1.1rem;
        margin: 8px;
    }
}


/* ==========================================================================
   SIDEBAR FOOTER - Logo i tekst na dnu sidebara
   ========================================================================== */

.sidebar-footer {
    flex-shrink: 0;
    background: white;
    padding: 15px;
    text-align: center;
    border-top: 2px solid #e5e7eb;
}

.footer-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-bottom: 5px;
}

.footer-text {
    color: #145234;
    font-family: 'Kalam', cursive;
    font-size: 1.1rem;
    margin: 0;
    font-weight: bold;
}

/* Responzivnost za sidebar footer */
@media (max-width: 768px) {
    .sidebar-footer {
        padding: 15px;
    }
    
    .footer-logo {
        width: 60px;
        height: 60px;
    }
    
    .footer-text {
        font-size: 1.2rem;
    }
}
