/* ==========================================================================
   SELECTION STUDIO COMPOSER — style.css (Production Stable V3.0.0)
   ========================================================================== */

:root {
    --admin-bg: #0f171e;
    --admin-card: rgba(28, 42, 57, 0.95);
    --admin-sidebar: #0a1015;
    --admin-accent: #d4b483;
    --admin-accent-hover: #f3cf65;
    --admin-text: #eee;
    --admin-muted: #a0acb8;
    --admin-border: rgba(255, 255, 255, 0.08);
    --btn-glass: rgba(255, 255, 255, 0.06);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    overflow: hidden !important;
    background-color: var(--admin-bg);
    font-family: 'Segoe UI', Roboto, sans-serif;
    color: var(--admin-text);
}

/* --- 🛡️ SHIELD SYSTEM (Gvozdeni ugovor o vidljivosti radnog prostora) --- */
.main-workspace-container {
    display: none;
    width: 100vw;
    height: 100vh;
}

.main-workspace-container[data-status="approved"] {
    display: flex !important;
    flex-direction: row !important;
    width: 100vw !important;
    height: 100vh !important;
    overflow: hidden !important;
}

/* --- ⏳ GLOBAL SPLASH LOCK SCREEN --- */
.global-splash-lockout {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: #0f171e !important;
    z-index: 999999 !important;
}

.global-splash-wrapper {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    width: 100%;
    max-width: 600px;
    padding: 20px;
    margin: 0 auto !important;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* --- LEVI PANEL: KONTROLNA TABLA (FIKSNO 320px) --- */
.sidebar {
    width: 320px !important;
    min-width: 320px !important;
    max-width: 320px !important;
    background-color: var(--admin-sidebar);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    height: 100%;
    border-right: 1px solid var(--admin-border);
}

.admin-brand {
    text-align: center;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.brand-main {
    display: block;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--admin-accent);
    background: linear-gradient(to right, #d4b483 20%, #fff 50%, #d4b483 80%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;

}

.brand-sub {
    display: block;
    font-size: 10px;
    color: #fff;
    letter-spacing: 1px;
    margin-top: 2px;
    opacity: 0.7;
}

.tenant-pill {
    display: inline-block;
    margin-top: 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--admin-accent);
    background-color: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.25);
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.sidebar h2 {
    font-size: 0.75rem;
    color: var(--admin-accent);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-bottom: 1px solid var(--admin-border);
    padding-bottom: 5px;
    margin-top: 8px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-size: 0.65rem;
    color: var(--admin-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.color-picker-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.color-picker-wrapper input[type="color"] {
    width: 45px;
    height: 32px;
    border: 1px solid var(--admin-border);
    background: none;
    cursor: pointer;
    border-radius: 6px;
}

.form-group select,
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--admin-border);
    color: white;
    border-radius: 8px;
    font-size: 0.85rem;
    outline: none;
}

.sidebar-drop-zone {
    border: 1px dashed var(--admin-border);
    padding: 12px;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.01);
    transition: 0.2s;
    font-size: 0.8rem;
}

/* --- 🧱 SREDNJI PANEL: RADNI PROSTOR --- */
.main-workspace {
    flex: 1 !important;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100vh;
    background-color: var(--admin-bg);
    border-right: 1px solid var(--admin-border);
    overflow: hidden;
}

.toolbar {
    background-color: rgba(28, 42, 57, 0.4);
    border-bottom: 1px solid var(--admin-border);
    padding: 15px 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    backdrop-filter: blur(10px);
}

.toolbar-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--admin-accent);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-add {
    background: var(--btn-glass);
    border: 1px solid var(--admin-border);
    color: white;
    padding: 8px 14px;
    font-size: 0.75rem;
    cursor: pointer;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-add:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--admin-accent);
}

.btn-action-edge {
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

#btn-edge-publish:hover {
    background-color: var(--admin-accent-hover) !important;
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.3);
}

#btn-edge-save:hover {
    background-color: #2c3e50 !important;
}

.blocks-container {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* --- 🧱 CMS LEGO KOCKICE --- */
.cms-block-card {
    background-color: var(--admin-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 18px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    cursor: grab;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    width: 100%;
    user-select: none;
}

.cms-block-card:active {
    cursor: grabbing;
}

.cms-block-card.drag-over-active {
    box-shadow: 0 -4px 0 0 var(--admin-accent), 0 8px 20px rgba(0, 0, 0, 0.4) !important;
    transform: scale(1.005);
}

.cms-block-card.active-block {
    border-color: var(--admin-accent) !important;
    background: rgba(28, 42, 57, 0.99);
    box-shadow: 0 0 15px rgba(212, 180, 131, 0.15);
}

.block-info-side {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.block-num {
    font-size: 0.8rem;
    color: var(--admin-accent);
    font-weight: 700;
    min-width: 110px;
}

.block-meta-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.block-type-tag {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--admin-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.block-summary-text {
    font-size: 0.9rem;
    color: #fff;
    font-weight: 600;
}

.block-media-indicators {
    display: flex;
    gap: 10px;
    font-size: 0.75rem;
    color: var(--admin-muted);
    margin-top: 2px;
}

.block-media-indicators span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.block-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-action {
    background: var(--btn-glass);
    border: 1px solid var(--admin-border);
    color: var(--admin-text);
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.8rem;
    border-radius: 8px;
    font-weight: 700;
}

.btn-delete {
    border-color: rgba(184, 29, 36, 0.4);
    color: #b81d24;
}

/* --- 📺 DESNI PANEL: PREVIEW AREA (FIKSNO 420px) --- */
.preview-panel {
    flex: none !important;
    width: 420px !important;
    min-width: 420px !important;
    max-width: 420px !important;
    background-color: #070b0e;
    height: 100%;
    max-height: 100vh;
    overflow-y: auto;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 25px;
}

/* 📱 MOBILNA KAPSULA SIMULATORA */
#live-simulator-screen {
    width: 360px !important;
    height: 82vh !important;
    border-radius: 24px;
    background-color: #0f171e;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

#simulator-content-target {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px 24px 130px 24px;
    box-sizing: border-box;
    overflow-y: auto;
}

#floating-action-holder {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    background: linear-gradient(to top, #0f171e 80%, rgba(15, 23, 30, 0));
    padding: 20px 24px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 999;
    pointer-events: auto;
    box-sizing: border-box;
}

/* --- 🔍 ZOOM INSPEKTOR EDITOR BLOCKA --- */
#zoom-editor-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(10, 16, 21, 0.98) !important;
    backdrop-filter: blur(15px) !important;
    z-index: 10000 !important;
    display: none !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 40px !important;
}

.zoom-window {
    width: 100%;
    max-width: 900px;
    height: 100%;
    max-height: 80vh;
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.zoom-header {
    padding: 18px 25px;
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.zoom-body {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.zoom-body .form-group select,
.zoom-body .form-group input[type="text"],
.zoom-body .form-group input[type="email"],
.zoom-body .form-group input[type="number"],
.zoom-body .form-group textarea {
    width: 100% !important;
    padding: 12px 14px !important;
    background-color: rgba(7, 11, 14, 0.6) !important;
    border: 1px solid var(--admin-border) !important;
    color: white !important;
    border-radius: 8px !important;
    font-size: 0.9rem !important;
    outline: none !important;
}

.zoom-footer {
    padding: 18px 25px;
    border-top: 1px solid var(--admin-border);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
}

.zoom-drop-zone {
    border: 2px dashed var(--admin-border);
    padding: 22px;
    text-align: center;
    border-radius: 10px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.01);
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.text-center {
    text-align: center;
}

/* ==========================================================================
   SELECTION GATEWAY STILOVI (Javni Splash, Čekaonica, Denied)
   ========================================================================== */

.gateway-body {
    background-color: #0f171e !important;
    font-family: 'SF Pro Display', '-apple-system', 'Segoe UI', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    overflow-x: hidden;
}

.gateway-body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(15, 23, 30, 0.88), rgba(15, 23, 30, 0.88)), url('/assets/36.webp'), #0f171e;
    background-size: cover;
    background-position: center;
    filter: blur(4px);
    z-index: -1;
    transform: scale(1.05);
}

.gateway-container {
    background-color: rgba(28, 42, 57, 0.96);
    padding: 45px 35px;
    border-radius: 24px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    width: 420px;
    max-width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-sizing: border-box;
}

.gateway-btn {
    display: block;
    width: 100%;
    padding: 15px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid #d4b483;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s ease;
    box-sizing: border-box;
    margin-bottom: 12px;
    text-align: center;
}

.gateway-btn-primary {
    background: #d4b483;
    color: #0f171e;
}

.gateway-btn-primary:hover {
    background: #e5c594;
    transform: translateY(-1px);
}

.gateway-btn-secondary {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.15);
}

.gateway-btn-secondary:hover {
    border-color: #d4b483;
    color: #d4b483;
    background: rgba(214, 180, 131, 0.03);
}

.gateway-group {
    text-align: left;
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gateway-group label {
    font-size: 11px;
    color: #d4b483;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.gateway-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 13px;
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

/* 🛡️ ANTI-AUTOFILL SHIELD: Sprečava browser da boji inpute u belo */
.gateway-input:-webkit-autofill,
.gateway-input:-webkit-autofill:hover,
.gateway-input:-webkit-autofill:focus,
.gateway-input:-webkit-autofill:active {
    -webkit-text-fill-color: #ffffff !important;
    /* Ubacujemo unutrašnju senku boje pozadine modalne kapsule */
    -webkit-box-shadow: 0 0 0px 1000px rgba(7, 11, 14, 0.95) inset !important;
    box-shadow: 0 0 0px 1000px rgba(7, 11, 14, 0.95) inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

.gateway-input:focus {
    border-color: #d4b483;
    background: rgba(0, 0, 0, 0.5);
}

.gateway-spinner {
    width: 45px;
    height: 45px;
    border: 3px solid rgba(212, 180, 131, 0.1);
    border-radius: 50%;
    border-top-color: #d4b483;
    animation: gateway-spin 1s linear infinite;
    margin: 25px auto;
}

@keyframes gateway-spin {
    to {
        transform: rotate(360deg);
    }
}

/* --- 5. FOOTER --- */
.gateway-footer {
    position: absolute;
    bottom: 0;
    height: 75px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--text-muted);
    opacity: 0.3;
    transition: opacity 0.3s ease;
    z-index: 10;
    text-decoration: none;
    white-space: nowrap;
}

.gateway-footer:hover {
    opacity: 0.7;
}

.gateway-footer img {
    width: 14px;
    height: 14px;
    object-fit: contain;
    vertical-align: middle;
}

.gateway-footer span.footer-shimmer {
    font-weight: 700;
    background: linear-gradient(to right, #ffffff 20%, #d4b483 50%, #ffffff 80%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 5s linear infinite;
}

/* Precizno ciljamo link i njegove unutrašnje spanove da vratimo sivu boju */
a.gateway-reset,
a.gateway-reset span:not(.footer-shimmer) {
    color: var(--text-muted) !important;
    font-size: 11px;
    font-weight: 400;


}



/* --- 6. RESPONSIVE LAYER --- */
@media (max-width: 992px) {
    body {
        padding: 30px 15px;
        justify-content: flex-start;
    }

    .top-balance-spacer {
        display: none;
    }

    .central-container {
        flex: none;
        margin-bottom: 40px;
    }

    .split-container {
        flex-direction: column;
        gap: 20px;
    }

    .gateway-card {
        min-height: auto;
        padding: 40px 25px;
    }

    .gateway-footer {
        position: relative;
        height: auto;
        margin-top: auto;
        padding-top: 20px;
    }
}