/*
    printo-theme.css
    Sprint UX-5 — Global Dark Theme System
    Design tokens, glass-panel, animations, responsive, micro-interactions
*/

/* ══════════════════════════════════════════════════════════════════
   DEO A1 — CSS VARIJABLE (Design Tokens)
   ══════════════════════════════════════════════════════════════════ */
:root {
    /* ── Surface ──────────────────────────────────────────── */
    --surface-deep:    #0A0F1C;
    --surface-card:    rgba(10, 15, 28, 0.58);
    --surface-hover:   rgba(15, 22, 40, 0.92);
    --surface-overlay: rgba(0, 0, 0, 0.6);

    /* ── Glass ────────────────────────────────────────────── */
    --glass-blur:      none;
    --glass-border:    1px solid rgba(59, 130, 246, 0.3);
    --glass-border-hover: 1px solid rgba(59, 130, 246, 0.5);
    --glass-shadow:    0 8px 40px rgba(0, 0, 0, 0.65),
                       0 0 15px rgba(59, 130, 246, 0.1),
                       0 1px 0 rgba(255, 255, 255, 0.04) inset;
    --glass-radius:    16px;
    --glass-radius-sm: 10px;

    /* ── Typography ───────────────────────────────────────── */
    --text-primary:    #F8FAFC;
    --text-secondary:  #CBD5E1;
    --text-muted:      #64748B;
    --text-accent:     #3B82F6;

    --font-mono:       'JetBrains Mono', 'Fira Code', monospace;
    --font-sans:       'Inter', -apple-system, sans-serif;

    /* ── Accent Colors (per role) ─────────────────────────── */
    --aura-client:     #8B5CF6;  /* violet */
    --aura-worker:     #10B981;  /* emerald */
    --aura-owner:      #F59E0B;  /* amber */
    --aura-admin:      #EF4444;  /* red */
    --aura-printo:     #3B82F6;  /* blue */

    /* ── Status Colors ────────────────────────────────────── */
    --status-success:  #10B981;
    --status-warning:  #F59E0B;
    --status-error:    #EF4444;
    --status-info:     #3B82F6;
    --status-pending:  #6366F1;

    /* ── Spacing ──────────────────────────────────────────── */
    --gap-xs: 4px;
    --gap-sm: 8px;
    --gap-md: 12px;
    --gap-lg: 20px;
    --gap-xl: 32px;

    /* ── Transitions ──────────────────────────────────────── */
    --ease-smooth:   cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce:   cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 150ms;
    --duration-med:  300ms;
    --duration-slow: 500ms;

    /* ── HUD System (Neo-Atelier Command) ─────────────────── */
    --hud-fill:        #0A0F1C;
    --hud-fill-heavy:  #0A0F1C;
    --hud-fill-center: #0A0F1C;
    --hud-blur:        none;
    --hud-bracket:     16px;

    /* ── HUD Slot Colors ─────────────────────────────────── */
    --hud-orders:      #10B981;
    --hud-inquiries:   #EC4899;
    --hud-files:       #8B5CF6;
    --hud-center:      #3B82F6;
    --hud-tool:        #8B5CF6;

    /* ── Worker Terrain (Emerald aura) ───────────────────── */
    --wk-aura:         #10B981;
    --wk-aura-glow:    rgba(16, 185, 129, 0.25);
    --wk-muted:        rgba(100, 116, 139, 0.60);
    --wk-text:         rgba(248, 250, 252, 0.88);
    --wk-divider:      rgba(16, 185, 129, 0.10);
    --wk-surface:      #0A0F1C;
    --wk-glass-border: rgba(16, 185, 129, 0.14);
    --wk-glass-bg:     #0A0F1C;
    --wk-glass-blur:   none;
}

/* ══════════════════════════════════════════════════════════════════
   DEO A3 — GLASS-PANEL GLOBALNO
   ══════════════════════════════════════════════════════════════════ */
.glass-panel {
    background: var(--hud-fill);
    backdrop-filter: var(--hud-blur);
    -webkit-backdrop-filter: var(--hud-blur);
    border-radius: 0;
    border: none;
    box-shadow: none;
    padding: 0;
    transition: background var(--duration-fast) var(--ease-smooth);
}

.glass-panel:hover {
    border: none;
}

/* Light mode override */
html.theme-light .glass-panel {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.10);
}

/* Varijante */
.glass-panel--compact { padding: var(--gap-md); border-radius: var(--glass-radius-sm); }
.glass-panel--flat    { box-shadow: none; }
.glass-panel--glow    { box-shadow: 0 0 30px rgba(59, 130, 246, 0.15); }

/* ══════════════════════════════════════════════════════════════════
   DEO B1 — GLOBALNE ANIMACIJE
   ══════════════════════════════════════════════════════════════════ */

/* ── Enter/Exit ───────────────────────────────────────────── */
@keyframes fadeIn     { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut    { from { opacity: 1; } to { opacity: 0; } }
@keyframes slideUp    { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown  { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideLeft  { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideRight { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes scaleIn    { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }

/* ── Looping ──────────────────────────────────────────────── */
@keyframes pulse      { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes glow       { 0%, 100% { box-shadow: 0 0 12px rgba(59, 130, 246, 0.2); } 50% { box-shadow: 0 0 28px rgba(59, 130, 246, 0.45); } }

/* ── Utility classes ──────────────────────────────────────── */
.anim-fade-in     { animation: fadeIn     var(--duration-med) var(--ease-smooth); }
.anim-slide-up    { animation: slideUp    var(--duration-med) var(--ease-smooth); }
.anim-slide-down  { animation: slideDown  var(--duration-med) var(--ease-smooth); }
.anim-slide-left  { animation: slideLeft  var(--duration-med) var(--ease-smooth); }
.anim-slide-right { animation: slideRight var(--duration-med) var(--ease-smooth); }
.anim-scale-in    { animation: scaleIn    var(--duration-med) var(--ease-bounce); }
.anim-pulse       { animation: pulse 2s ease-in-out infinite; }
.anim-glow        { animation: glow  2s ease-in-out infinite; }
.order-card.highlighted-update {
    animation: pulseRemote 1s ease-in-out;
    border: 2px solid #3B82F6 !important;
}
@keyframes pulseRemote {
    0%, 100% { transform: scale(1); border-color: transparent; }
    50% { transform: scale(1.03); border-color: #3B82F6; box-shadow: 0 0 20px rgba(59, 130, 246, 0.6); }
}

/* ══════════════════════════════════════════════════════════════════
   DEO C1 — BREAKPOINTS
   ══════════════════════════════════════════════════════════════════ */

/* Mobile: < 768px */
@media (max-width: 767px) {
    .printo-universe {
        grid-template-areas:
            "topbar"
            "center"
            "feed";
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
        padding: var(--gap-sm);
        gap: var(--gap-sm);
    }

    /* Skriveni slotovi na mobile — Printo dominira */
    .pu-top-left, .pu-top-right,
    .pu-bottom-left, .pu-bottom-right { display: none; }

    /* Tool mode na mobile: full screen tool, Printo skriveno */
    .printo-universe.tool-mode {
        grid-template-areas:
            "topbar"
            "tool"
            "feed";
        grid-template-columns: 1fr;
    }
    .pu-tool-printo { display: none; }

    /* Gate kartice: vertikalno */
    .gate-cards { flex-direction: column; gap: 12px; padding: 16px; height: auto; }
    .gate-card  { width: 100%; }

    /* Printo active: full screen */
    .printo-active { width: 100vw; height: 100vh; border-radius: 0; }
}

/* Tablet: 768px — 1024px */
@media (min-width: 768px) and (max-width: 1024px) {
    .printo-universe {
        grid-template-columns: 1fr minmax(240px, 1.2fr) 1fr;
        gap: var(--gap-sm);
    }

    /* Tool mode: 65/35 umesto 75/25 */
    .printo-universe.tool-mode {
        grid-template-columns: 2fr 1fr;
    }

    .gate-card { width: 170px; padding: 24px 16px; }
}

/* ── DEO C2 — MOBILE NAV ──────────────────────────────────── */
@media (max-width: 767px) {
    .tool-nav-strip {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 50;
        display: flex;
        justify-content: space-around;
        background: var(--surface-card);
        backdrop-filter: var(--glass-blur);
        border-top: var(--glass-border);
        padding: var(--gap-sm) 0;
    }
}

/* ── DEO C3 — SCROLLBAR STYLING ───────────────────────────── */
::-webkit-scrollbar         { width: 6px; height: 6px; }
::-webkit-scrollbar-track   { background: transparent; }
::-webkit-scrollbar-thumb   {
    background: rgba(100, 116, 139, 0.3);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(100, 116, 139, 0.5); }

/* ══════════════════════════════════════════════════════════════════
   DEO D1 — KARTICE I DUGMAD (Micro-interactions)
   ══════════════════════════════════════════════════════════════════ */
.glass-panel[onclick], .glass-panel a, button.glass-btn {
    cursor: pointer;
    transition: transform var(--duration-fast) var(--ease-smooth),
                box-shadow var(--duration-fast) var(--ease-smooth);
}

.glass-panel[onclick]:hover, button.glass-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.75);
}

.glass-panel[onclick]:active, button.glass-btn:active {
    transform: translateY(0);
    transition-duration: 50ms;
}

/* ── DEO D2 — PRINTO GLOW (HUD blue nucleus) ─────────────── */
.pu-center {
    box-shadow: 0 0 32px rgba(59, 130, 246, 0.07),
                0 0 60px rgba(59, 130, 246, 0.04);
}

/* ── DEO D3 — STATUS BADGE BOJE ──────────────────────────── */
.status-pending   { color: var(--status-pending); }
.status-accepted  { color: var(--status-info); }
.status-printing  { color: var(--status-info); }
.status-done      { color: var(--status-success); }
.status-cancelled { color: var(--status-error); }

/* ══════════════════════════════════════════════════════════════════
   DEO E1 — DASHBOARD GRID LAYOUT (Universal 3-Column)
   Sprint UX-6 | Applies to Worker / Owner / Client dashboards
   ══════════════════════════════════════════════════════════════════ */

/* ── Root + Map Background ──────────────────────────────────── */
.dash-root    { position: relative; height: 100vh; overflow: hidden; }
.dash-bg      { position: absolute; inset: 0; z-index: 0; opacity: 0.35; pointer-events: none; }
.dash-overlay { position: relative; z-index: 10; height: 100vh; }

/* ── Grid Container ─────────────────────────────────────────── */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    grid-template-rows: auto 1fr auto;
    gap: 12px;
    padding: 12px;
    height: 100vh;
    box-sizing: border-box;
}

/* Right column hidden → 2-col (Printo gets more space) */
.dashboard-grid--no-right { grid-template-columns: 1fr 2fr; }

/* Tool mode → tool 75%, Printo 25% */
.dashboard-grid--tool { grid-template-columns: 3fr 1fr; }

/* ── Full-width rows ─────────────────────────────────────────── */
.dash-topbar  { grid-column: 1 / -1; }
.dash-toolbar { grid-column: 1 / -1; }

/* ── Column flex stacking ────────────────────────────────────── */
.dash-left, .dash-right {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: auto;
}

/* Components in columns share height equally */
.dash-left > *, .dash-right > * {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

.dash-center, .dash-tool {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ── Neon Solid Panels (Cyberpunk) ────────────────────────────── */
.dash-left, .dash-right, .dash-center, .dash-tool, .dash-toolbar {
    background: #0A0F1C;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 4px;
    border: 1px solid rgba(59, 130, 246, 0.12);
    box-shadow: none;
    padding: 12px;
    position: relative;
}

/* Neon Top-Left Brackets per slot */
.dash-left {
    border-top: 2px solid #F59E0B;
    border-left: 2px solid #F59E0B;
}

.dash-center {
    border-top: 2px solid #8B5CF6;
    border-left: 2px solid #8B5CF6;
}

.dash-right {
    border-top: 2px solid #EC4899;
    border-left: 2px solid #EC4899;
}

.dash-tool {
    border-top: 2px solid #00d2ff;
    border-left: 2px solid #00d2ff;
}

.dash-toolbar {
    border-top: 2px solid #10B981;
    border-left: 2px solid #10B981;
}

/* ── Toolbar row layout ──────────────────────────────────────── */
.dash-toolbar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

/* ── Printo center internal structure ────────────────────────── */
.dash-tabs {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(59, 130, 246, 0.1);
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.dash-chat {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ══════════════════════════════════════════════════════════════════
   DEO F1 — ROLE AURA (prolazi kroz ceo dashboard)
   ══════════════════════════════════════════════════════════════════ */
.map-layer[data-role],
.dashboard-page[data-role] {
    --aura:      var(--aura-printo);
    --aura-glow: rgba(59, 130, 246, 0.22);
}
.map-layer[data-role="client"],
.dashboard-page[data-role="client"] { --aura: var(--aura-client); --aura-glow: rgba(139, 92, 246, 0.22); }
.map-layer[data-role="worker"],
.dashboard-page[data-role="worker"] { --aura: var(--aura-worker); --aura-glow: rgba(16, 185, 129, 0.22); }
.map-layer[data-role="owner"],
.dashboard-page[data-role="owner"]  { --aura: var(--aura-owner);  --aura-glow: rgba(245, 158, 11, 0.22); }
.map-layer[data-role="admin"],
.dashboard-page[data-role="admin"]  { --aura: var(--aura-admin);  --aura-glow: rgba(239, 68, 68, 0.22); }

/* Aura nijansa na map pozadini (zadržava mrežu) */
.map-layer[data-role] {
    background:
        radial-gradient(ellipse 80% 60% at 50% 40%, var(--aura-glow) 0%, transparent 65%),
        radial-gradient(ellipse 50% 40% at 20% 80%, rgba(245, 158, 11, 0.04) 0%, transparent 55%),
        repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(255, 255, 255, 0.025) 40px),
        repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(255, 255, 255, 0.025) 40px),
        #0A0F1C;
}

/* Top aura linija na topbaru */
.dashboard-page[data-role] .topbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 8%;
    right: 8%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--aura-glow), transparent);
    pointer-events: none;
}

/* Aura linija na vrhu bottom bara */
.dashboard-page[data-role] .bottom-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 8%;
    right: 8%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--aura-glow), transparent);
    pointer-events: none;
}

/* Aktivna akcija u bottom baru prati auru uloge */
.dashboard-page[data-role] .action-card.glow-blue {
    border-color: var(--aura);
    box-shadow: 0 0 20px var(--aura-glow), inset 0 0 20px var(--aura-glow);
}
