/* Aplikacija Foto Moment - isti izgled kao Moj Trenutak. Boje su u MudBlazor temi (FotoTheme.cs);
   ovde su samo okviri koje MudBlazor nema (prijava, kockice za kod, ucitavanje). */
html, body { height: 100%; margin: 0; font-family: 'Inter', 'Segoe UI', Roboto, Arial, sans-serif; }

/* Ucitavanje aplikacije */
#app-preloader { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; background: #F0F1F7; }
.app-dark #app-preloader { background: #202226; }
.app-preloader-box { position: relative; width: 84px; height: 84px; display: flex; align-items: center; justify-content: center; }
.app-preloader-box img { width: 44px; height: 44px; object-fit: contain; }
.app-preloader-spinner { position: absolute; inset: 0; border-radius: 50%; border: 3px solid rgba(132, 90, 223, .18); border-top-color: #845ADF; animation: app-preloader-spin .8s linear infinite; }
@keyframes app-preloader-spin { to { transform: rotate(360deg); } }

.fm-center { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px 16px; }

/* Javne strane naloga (prijava, zaboravljena i nova lozinka): dvodelna kartica - levo brend, desno forma. */
.fm-auth-page {
    min-height: 100vh; min-height: 100svh;
    display: flex; align-items: center; justify-content: center;
    background-color: #F9F3FA;
    background-image:
        radial-gradient(900px circle at 12% 8%, rgba(132, 90, 223, 0.12), transparent 55%),
        radial-gradient(900px circle at 88% 92%, rgba(183, 112, 246, 0.10), transparent 55%);
    padding: 16px;
}
.app-dark .fm-auth-page { background-color: #202226; }
.fm-login-shell { width: 100%; max-width: 980px; min-height: 600px; background: var(--mud-palette-surface, #fff); border-radius: 24px; box-shadow: 0 24px 70px rgba(43, 27, 51, 0.18); display: flex; overflow: hidden; }
.fm-login-brand {
    flex: 0 0 44%; position: relative; overflow: hidden; padding: 40px;
    display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
    background: linear-gradient(160deg, var(--mud-palette-drawer-background, #111C43) 0%, var(--mud-palette-drawer-background, #111C43) 30%, var(--mud-palette-primary) 150%);
}
.fm-login-form { flex: 1 1 auto; padding: 56px 56px 48px; display: flex; flex-direction: column; justify-content: center; }
.fm-login-mobile-logo { display: none; justify-content: center; margin-bottom: 28px; }
.fm-login-mobile-logo img { width: 170px; }
@media (max-width: 760px) {
    .fm-login-shell { min-height: 0; border-radius: 20px; }
    .fm-login-brand { display: none; }
    .fm-login-form { padding: 32px 24px; }
    .fm-login-mobile-logo { display: flex; }
    .fm-login-form .fm-heading, .fm-login-form .fm-heading + .mud-typography { text-align: center; }
    .fm-login-form .fm-auth-head { align-items: center !important; text-align: center; }
    .fm-login-form .fm-auth-icon { margin-left: auto; margin-right: auto; }
}
.fm-heading { font-family: 'Source Serif 4', Georgia, serif !important; font-weight: 600 !important; }
.fm-powered-by { font-size: .72rem; font-weight: 500; color: var(--mud-palette-text-disabled, #9CA3AF); text-align: center; letter-spacing: .02em; }
.fm-legal-link { color: inherit; text-decoration: underline; }
.fm-big-btn { height: 52px; border-radius: 14px !important; font-weight: 700 !important; letter-spacing: .04em; }

/* Zamucena pozadina iza dijaloga (kao na MM). */
.mud-overlay-scrim { background-color: rgba(43, 27, 51, 0.48) !important; backdrop-filter: blur(7px) !important; -webkit-backdrop-filter: blur(7px) !important; }

/* Kockice za 6-cifreni kod */
.fm-otp { display: flex; gap: 10px; justify-content: center; }
.fm-otp-box {
    width: 52px; height: 62px; text-align: center; font-size: 26px; font-weight: 800;
    border: 2px solid #CFC8E3; border-radius: 14px;
    background: #F7F5FC; color: var(--mud-palette-text-primary);
    font-family: inherit; -webkit-appearance: none; appearance: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
.app-dark .fm-otp-box { border-color: rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .06); }
.fm-otp-box:hover { border-color: #A99BD6; }
.fm-otp-box:focus { outline: none; border-color: var(--mud-palette-primary); background: var(--mud-palette-surface); box-shadow: 0 0 0 4px rgba(132, 90, 223, .18); }
.fm-otp-box.is-filled { border-color: var(--mud-palette-primary); background: rgba(132, 90, 223, .07); }
.fm-otp-box:disabled { opacity: .6; }
@media (max-width: 380px) { .fm-otp-box { width: 44px; height: 54px; font-size: 22px; } }

/* Tabele: zaglavlje izdvojeno bojom. */
.mud-table-head .mud-table-cell { background-color: var(--mud-palette-background-gray); font-weight: 700; color: var(--mud-palette-text-primary); }
.mud-table-container { border-radius: 12px; overflow: hidden; border: 1px solid var(--mud-palette-lines-default); }
/* Siroke tabele (spiskovi bez kartica) se na uskom ekranu pomeraju vodoravno unutar okvira, ne odsecaju. */
@media (max-width: 959px) { .mud-table-container { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; } }

/* Zvonce uvek u istoj liniji sa ostalim ikonicama; manji broj obavestenja (kao na MM). */
.mud-badge-root.fm-badge-center { display: inline-flex; align-items: center; justify-content: center; line-height: 0; }
.mud-badge-root.fm-badge-center .mud-badge-wrapper { line-height: 0; }
.mud-badge.fm-badge-small { min-width: 16px; height: 16px; padding: 0 4px; font-size: .62rem; line-height: 16px; inset: auto auto calc(100% - 10px) calc(100% - 10px) !important; }

/* Telefon: meni klizi preko stranice, zaglavlje zbijenije. */
@media (max-width: 599px) {
    .mud-drawer.mud-drawer-mini { display: none; }
    .mud-layout .mud-main-content { margin-left: 0 !important; }
    .mud-layout .mud-appbar { left: 0 !important; width: 100% !important; margin-left: 0 !important; }
    .mud-appbar .mud-toolbar { padding-left: 8px; padding-right: 4px; gap: 0; }
    .mud-appbar .mud-icon-button { padding: 8px; }
    .mud-appbar .fm-user-name { display: none !important; }
    .mud-main-content .mud-typography-h4 { font-size: 1.65rem; line-height: 1.2; }
    .mud-main-content .mud-typography-h5 { font-size: 1.3rem; }
    .mud-main-content .mud-paper.pa-6 { padding: 16px !important; }

    /* Tabele kao kartice (MudTable na telefonu): dugacak mejl, naziv ili cip se prelamaju u sirini ekrana. */
    .mud-xs-table table { table-layout: fixed; width: 100%; }
    .mud-xs-table .mud-table-row { max-width: 100%; }
    /* naziv polja levo, sav sadrzaj celije desno - jedno ispod drugog (tekst, cipovi, napomene) */
    .mud-xs-table .mud-table-body .mud-table-cell[data-label] { display: grid !important; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; row-gap: 2px;
        align-items: center; justify-items: end; text-align: right; white-space: normal !important; overflow-wrap: anywhere; }
    .mud-xs-table .mud-table-body .mud-table-cell[data-label]::before { grid-column: 1; grid-row: 1; justify-self: start; text-align: left; max-width: 42vw; overflow-wrap: normal; word-break: normal; }
    .mud-xs-table .mud-table-body .mud-table-cell[data-label] > * { grid-column: 2; justify-self: end; text-align: right; min-width: 0; max-width: 100%; }
    .mud-xs-table .mud-table-body .mud-table-cell[data-label] > .mud-chip,
    .mud-xs-table .mud-table-body .mud-table-cell[data-label] > .mud-tooltip-root { width: auto !important; }
    .mud-xs-table .mud-table-body .mud-table-cell .mud-chip { height: auto; min-height: 24px; white-space: normal; }
    .mud-xs-table .mud-table-body .mud-table-cell .mud-chip .mud-chip-content { white-space: normal; }
    /* akcije u poslednjoj celiji: u redu, levo poravnate, prelamaju se */
    .mud-xs-table .mud-table-body .mud-table-cell:not([data-label]) { justify-content: flex-start; flex-wrap: wrap; text-align: left !important; }

    /* Dugmad i polja ne smeju da prosire stranu preko ekrana. */
    .mud-main-content .mud-button-root { max-width: 100%; }
    .mud-main-content .mud-button-label { white-space: normal; text-align: center; }
    .mud-dialog { max-width: calc(100vw - 16px) !important; margin: 8px !important; }
    .mud-tabs-tabbar .mud-tab { min-width: 0; padding-left: 12px; padding-right: 12px; }
    /* Sigurnosna mreza: nista ne pravi vodoravno pomeranje cele strane (sticky i dalje radi uz "clip"). */
    html, body { overflow-x: clip; }
}

/* Naslovi strana dobijaju fokus pri promeni strane (citaci ekrana) - bez okvira oko naslova. */
h1:focus, h1:focus-visible, [tabindex="-1"]:focus { outline: none; }

#blazor-error-ui { position: fixed; bottom: 0; left: 0; right: 0; padding: 12px 16px; background: #fff3cd; z-index: 2000; box-shadow: 0 -1px 4px rgba(0, 0, 0, .2); }
#blazor-error-ui[hidden] { display: none; }
#blazor-error-ui .reload { margin-left: 8px; }

/* Kartice na strani galerije: linija ispod naslova kartica, sadrzaj odmaknut od nje. */
.ga-tabs-head { border-bottom: 1px solid var(--mud-palette-lines-default); }

/* Vodic kroz galeriju (fmTour): zatamnjen ekran, osvetljen element, oblacic sa strelicom. */
.fm-tour { position: fixed; inset: 0; z-index: 1500; }
.fm-tour-block { position: fixed; inset: 0; }
.fm-tour-spot { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(17, 28, 67, .62), 0 0 0 3px #fff inset; pointer-events: none;
    transition: left .25s, top .25s, width .25s, height .25s; }
.fm-tour-bubble { position: fixed; width: min(360px, calc(100vw - 16px)); padding: 16px 18px 14px; border-radius: 16px; background: #fff; color: #333335;
    box-shadow: 0 18px 50px rgba(17, 28, 67, .35); font-family: inherit; transition: left .25s, top .25s; }
.fm-tour-bubble::after { content: ""; position: absolute; left: calc(var(--fm-arrow-x, 50%) - 9px); bottom: -9px; width: 18px; height: 18px; background: #fff;
    transform: rotate(45deg); border-radius: 3px; }
.fm-tour-bubble.is-below::after { bottom: auto; top: -9px; }
.fm-tour-step { font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #845ADF; margin-bottom: 4px; }
.fm-tour-title { font-size: 1.08rem; font-weight: 800; margin-bottom: 4px; }
.fm-tour-text { font-size: .9rem; line-height: 1.45; color: #55586a; }
.fm-tour-actions { position: relative; z-index: 1; display: flex; align-items: center; gap: 6px; margin-top: 14px; }
.fm-tour-actions button { border: none; cursor: pointer; font: inherit; font-size: .85rem; font-weight: 700; border-radius: 10px; padding: 8px 14px; white-space: nowrap; }
.fm-tour-next { background: #845ADF; color: #fff; }
.fm-tour-next:hover { background: #7149c9; }
.fm-tour-back { background: #f1effa; color: #845ADF; }
.fm-tour-skip { background: transparent; color: #8A8FA8; padding: 8px 4px !important; }
.fm-tour-skip:hover { color: #333335; }
