/* ===================================================
   MEKTEB.NET — Custom Modal System
   Zamjenjuje browser confirm() i alert() dijaloge
   =================================================== */

/* ---- Overlay ---- */
.mekteb-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(2, 36, 22, 0.65);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.mekteb-modal-overlay.active {
    display: flex;
    animation: mektebFadeIn 0.18s ease;
}

/* ---- Modal box ---- */
.mekteb-modal-box {
    background: #ffffff;
    border-radius: 22px;
    padding: 2rem 2rem 1.6rem;
    max-width: 400px;
    width: 100%;
    box-shadow:
        0 24px 60px rgba(0, 40, 20, 0.28),
        0 4px 16px rgba(0, 0, 0, 0.12);
    animation: mektebSlideUp 0.22s cubic-bezier(0.34, 1.5, 0.64, 1);
    text-align: center;
    position: relative;
}

/* ---- Ikona ---- */
.mekteb-modal-icon {
    font-size: 2.6rem;
    line-height: 1;
    margin-bottom: 0.9rem;
}

/* ---- Naslov ---- */
.mekteb-modal-title {
    font-family: 'Playfair Display', 'Lora', serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f3d25;
    margin-bottom: 0.45rem;
}

/* ---- Poruka ---- */
.mekteb-modal-message {
    font-family: 'Lora', serif;
    font-size: 0.97rem;
    color: #4a6658;
    line-height: 1.55;
    margin-bottom: 1.6rem;
    white-space: pre-wrap;
}

/* ---- Dugmad ---- */
.mekteb-modal-btns {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}
.mekteb-modal-btns.single {
    justify-content: center;
}

.mekteb-btn {
    flex: 1;
    max-width: 160px;
    padding: 0.7rem 1.1rem;
    border-radius: 12px;
    font-family: 'Lora', serif;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
    border: none;
    outline: none;
}

/* Potvrdi / OK */
.mekteb-btn-ok {
    background: linear-gradient(135deg, #1a5c3a, #0f3d25);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(15, 61, 37, 0.3);
}
.mekteb-btn-ok:hover {
    background: linear-gradient(135deg, #216b44, #164d2f);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(15, 61, 37, 0.38);
}
.mekteb-btn-ok:active { transform: translateY(0); }

/* Odustani / Cancel */
.mekteb-btn-cancel {
    background: transparent;
    color: #2d6a4a;
    border: 2px solid #b7ddc8;
}
.mekteb-btn-cancel:hover {
    background: #f0f8f3;
    border-color: #2d6a4a;
}

/* ---- Varijante po tipu ---- */

/* Upozorenje */
.mekteb-modal-box.warning .mekteb-btn-ok {
    background: linear-gradient(135deg, #d97706, #b45309);
    box-shadow: 0 4px 14px rgba(180, 83, 9, 0.3);
}
.mekteb-modal-box.warning .mekteb-btn-ok:hover {
    background: linear-gradient(135deg, #e88a1a, #c45e0a);
}

/* Greška */
.mekteb-modal-box.error .mekteb-btn-ok {
    background: linear-gradient(135deg, #dc2626, #991b1b);
    box-shadow: 0 4px 14px rgba(185, 28, 28, 0.3);
}
.mekteb-modal-box.error .mekteb-btn-ok:hover {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
}

/* Uspjeh */
.mekteb-modal-box.success .mekteb-btn-ok {
    background: linear-gradient(135deg, #059669, #047857);
    box-shadow: 0 4px 14px rgba(4, 120, 87, 0.3);
}
.mekteb-modal-box.success .mekteb-btn-ok:hover {
    background: linear-gradient(135deg, #10b981, #059669);
}

/* ---- Linija razdvajanja ispod ikone (ukras) ---- */
.mekteb-modal-box::before {
    content: '';
    display: block;
    width: 48px;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    margin: 0 auto 1.2rem;
}

/* ---- Animacije ---- */
@keyframes mektebFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes mektebSlideUp {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.94);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ---- Responzivno ---- */
@media (max-width: 440px) {
    .mekteb-modal-box {
        padding: 1.5rem 1.3rem 1.3rem;
        border-radius: 18px;
    }
    .mekteb-modal-btns { flex-direction: column; }
    .mekteb-btn { max-width: 100%; }
}

/* ===================================================
   KVIZ POPUP — Feedback (tačno / netačno / info)
   =================================================== */

.popup-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(2, 36, 22, 0.65);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1.5rem;
}
.popup-overlay.active {
    display: flex;
    animation: mektebFadeIn 0.18s ease;
}

.popup-content {
    background: #ffffff;
    border-radius: 22px;
    padding: 2.2rem 2rem 1.8rem;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow:
        0 24px 60px rgba(0, 40, 20, 0.28),
        0 4px 16px rgba(0, 0, 0, 0.12);
    border: 4px solid #d0e8d8;
    animation: mektebSlideUp 0.22s cubic-bezier(0.34, 1.5, 0.64, 1);
    position: relative;
}

/* Žuta traka na vrhu — kao u modal.css */
.popup-content::before {
    content: '';
    display: block;
    width: 48px;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    margin: 0 auto 1.2rem;
}

/* Tačno — zeleni okvir */
.popup-content.correct {
    border-color: #059669;
}
.popup-content.correct::before {
    background: linear-gradient(90deg, #059669, #6ee7b7);
}

/* Netačno — crveni okvir */
.popup-content.incorrect {
    border-color: #dc2626;
}
.popup-content.incorrect::before {
    background: linear-gradient(90deg, #dc2626, #fca5a5);
}

/* Info / neutral — žuti okvir */
.popup-content.info {
    border-color: #fbbf24;
}
.popup-content.info::before {
    background: linear-gradient(90deg, #fbbf24, #fde68a);
}

.popup-icon {
    font-size: 3.5rem;
    line-height: 1;
    margin-bottom: 0.8rem;
}

.popup-title {
    font-family: 'Playfair Display', 'Lora', serif;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    color: #0f3d25;
}
.popup-title.correct  { color: #047857; }
.popup-title.incorrect { color: #dc2626; }
.popup-title.info      { color: #92400e; }

.popup-explanation {
    font-family: 'Lora', serif;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.6rem;
    color: #4a6658;
}

.popup-next-btn {
    background: linear-gradient(135deg, #1a5c3a, #0f3d25);
    color: #ffffff;
    border: none;
    padding: 0.85rem 2.5rem;
    border-radius: 50px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Lora', serif;
    box-shadow: 0 4px 14px rgba(15, 61, 37, 0.3);
}
.popup-next-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 61, 37, 0.38);
    background: linear-gradient(135deg, #216b44, #164d2f);
}

/* Tačno dugme — zeleno */
.popup-content.correct .popup-next-btn {
    background: linear-gradient(135deg, #059669, #047857);
    box-shadow: 0 4px 14px rgba(4, 120, 87, 0.3);
}
.popup-content.correct .popup-next-btn:hover {
    background: linear-gradient(135deg, #10b981, #059669);
}

/* Netačno dugme — zadržava zeleno (nastavak učenja) */
.popup-content.incorrect .popup-next-btn {
    background: linear-gradient(135deg, #1a5c3a, #0f3d25);
}

/* Info dugme — žuto */
.popup-content.info .popup-next-btn {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #064e3b;
    box-shadow: 0 4px 14px rgba(251, 191, 36, 0.3);
}
.popup-content.info .popup-next-btn:hover {
    box-shadow: 0 8px 20px rgba(251, 191, 36, 0.45);
}

/* Responzivno */
@media (max-width: 480px) {
    .popup-content {
        padding: 1.6rem 1.3rem 1.4rem;
        border-radius: 18px;
    }
    .popup-title { font-size: 1.5rem; }
    .popup-icon  { font-size: 2.8rem; }
}
