﻿/* ===== ACT 18.1 MODAL FIX ===== */

/* Spreči text-size-adjust bug u Firefox */
html {
    -moz-text-size-adjust: none;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Kad je modal otvoren */
body.modal-active {
    overflow: hidden !important;
    position: static !important;
    height: 100vh;
    width: 100vw;
}

/* ACT 18.1 koristi ovu klasu automatski */
.modalBackground {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100vh !important;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 10000 !important;
    touch-action: none;
}

/* Popup panel */
.modalPopup {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 10001 !important;
    /* Mobilni scroll unutar modala */
    max-width: 94vw !important;
    max-height: 88vh !important;
    overflow: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-x pan-y pinch-zoom;
    /* Izgled */
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* Firefox Mobile specifično */
@supports (-moz-appearance: none) {
    .modalPopup {
        scrollbar-width: thin;
    }

    .modalBackground {
        backdrop-filter: none; /* Firefox ima bug sa ovim */
    }
}

/* Spreči iOS bounce scroll */
@supports (-webkit-touch-callout: none) {
    .modalPopup {
        -webkit-overflow-scrolling: touch;
    }
}
