/* =============================================================
   GLOBALNE NOTIFIKACIJE (toast) + CONFIRM MODAL
   Jedinstven stil za celu aplikaciju. Font: Rubik (kao ostatak app-a).
   Uključuje se preko app-header partiala; markup/JS su u app-footer.
   ============================================================= */

/* ---------- TOAST KONTEJNER ---------- */
.toast-container {
    position: fixed;
    top: 100px;             /* ispod header-a */
    right: 0;               /* skroz uz desnu ivicu */
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    max-width: min(92vw, 360px);
    pointer-events: none;
}

/* Mobilni: manji toast, simetrično uz obe ivice, ispod nižeg header-a */
@media (max-width: 600px) {
    .toast-container {
        top: 70px;
        left: 12px;
        right: 12px;
        max-width: none;
        align-items: stretch;
    }
    .toast {
        font-size: 13px;
        padding: 12px 34px 12px 12px;
        border-radius: 9px;
    }
    .toast__icon {
        width: 26px;
        height: 26px;
        font-size: 13px;
    }
    .toast__close {
        top: 7px;
        right: 7px;
    }
}

/* ---------- TOAST ---------- */
.toast {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 40px 14px 16px;
    border-radius: 10px;
    background: var(--surface);
    color: #ffffff;
    font-family: 'Rubik', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    pointer-events: auto;
    animation: toastIn 0.28s cubic-bezier(0.21, 1.02, 0.73, 1);
}

.toast.toast--hide {
    animation: toastOut 0.25s ease forwards;
}

/* Ikonica u krugu */
.toast__icon {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.25);
    font-size: 15px;
}

.toast__message {
    flex: 1;
    padding-right: 4px;
}

/* X dugme za zatvaranje */
.toast__close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    color: inherit;
    opacity: 0.75;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    transition: opacity 0.15s, background 0.15s;
}

.toast__close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

/* Traka za odbrojavanje (skuplja se do 0) */
.toast__progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: rgba(255, 255, 255, 0.55);
    transform-origin: left center;
    animation: toastProgress linear forwards;
}

/* ---------- VARIJANTE (zelena / crvena) ---------- */
.toast.success {
    background: #17c964;   /* zelena */
}

.toast.error {
    background: #f31260;   /* crvena */
}

.toast.info {
    background: #009EF7;   /* plava (primarna) */
}

.toast.warning {
    background: #f5a524;   /* narandžasta */
    color: #4a2e00;
}

.toast.warning .toast__icon {
    background: rgba(0, 0, 0, 0.12);
}

.toast.warning .toast__progress {
    background: rgba(0, 0, 0, 0.25);
}

@keyframes toastIn {
    from { transform: translateX(120%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

@keyframes toastOut {
    from { transform: translateX(0);    opacity: 1; }
    to   { transform: translateX(120%); opacity: 0; }
}

@keyframes toastProgress {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

/* =============================================================
   CONFIRM MODAL (stil kao "otkazivanje rezervacije" popup)
   ============================================================= */
.confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.confirm-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.confirm-modal {
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    border-radius: 12px;
    font-family: 'Rubik', sans-serif;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transform: translateY(12px) scale(0.98);
    transition: transform 0.2s ease;
}

.confirm-overlay.is-open .confirm-modal {
    transform: translateY(0) scale(1);
}

.confirm-modal__body {
    display: flex;
    gap: 16px;
    padding: 24px 24px 20px 24px;
}

/* Ikonica u obojenom krugu, boja zavisi od tipa */
.confirm-modal__icon {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: #fff5f5;
    color: #f56565;
}

.confirm-modal__content {
    flex: 1;
}

.confirm-modal__title {
    margin: 2px 0 6px 0;
    font-size: 17px;
    font-weight: 600;
    color: var(--text-strong);
}

.confirm-modal__text {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #5E6278;
    white-space: pre-line;
}

.confirm-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 24px 22px 24px;
}

.confirm-btn {
    font-family: 'Rubik', sans-serif;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.confirm-btn--cancel {
    background: var(--surface);
    color: #3F4254;
    border-color: #E1E3EA;
}

.confirm-btn--cancel:hover {
    background: var(--surface-subtle);
}

.confirm-btn--confirm {
    background: #f56565;
    color: #ffffff;
}

.confirm-btn--confirm:hover {
    box-shadow: 0 6px 18px rgba(245, 101, 101, 0.4);
}

/* Tipovi confirm modala menjaju boju ikonice i potvrdnog dugmeta */
.confirm-modal[data-type="danger"]  .confirm-modal__icon { background: #fff5f5; color: #f56565; }
.confirm-modal[data-type="danger"]  .confirm-btn--confirm { background: #f56565; }
.confirm-modal[data-type="danger"]  .confirm-btn--confirm:hover { box-shadow: 0 6px 18px rgba(245,101,101,0.4); }

.confirm-modal[data-type="success"] .confirm-modal__icon { background: #e9fbf1; color: #17c964; }
.confirm-modal[data-type="success"] .confirm-btn--confirm { background: #17c964; }
.confirm-modal[data-type="success"] .confirm-btn--confirm:hover { box-shadow: 0 6px 18px rgba(23,201,100,0.4); }

.confirm-modal[data-type="primary"] .confirm-modal__icon { background: #e8f6fe; color: #009EF7; }
.confirm-modal[data-type="primary"] .confirm-btn--confirm { background: #009EF7; }
.confirm-modal[data-type="primary"] .confirm-btn--confirm:hover { box-shadow: 0 6px 18px rgba(0,158,247,0.4); }

.confirm-modal[data-type="warning"] .confirm-modal__icon { background: #fff8ec; color: #f5a524; }
.confirm-modal[data-type="warning"] .confirm-btn--confirm { background: #f5a524; }
.confirm-modal[data-type="warning"] .confirm-btn--confirm:hover { box-shadow: 0 6px 18px rgba(245,165,36,0.4); }

@media (max-width: 480px) {
    .confirm-modal__actions { flex-direction: column-reverse; }
    .confirm-btn { width: 100%; }
}