/* ── Google Font: Orbitron (tech headings) ─────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;600;700;900&family=Roboto:wght@300;400;500;700&display=swap');

/* ── Root variables ────────────────────────────────────────────────────── */
:root {
    --se-cyan:     #00b4d8;
    --se-blue:     #0077b6;
    --se-dark:     #090e1a;
    --se-surface:  #0d1b2a;
    --se-card:     #111d2e;
    --se-border:   rgba(0,180,216,0.18);
    --se-glow:     rgba(0,180,216,0.35);
    --se-glow-sm:  rgba(0,180,216,0.15);
    --se-red:      #ef233c;
    --se-teal:     #00f5d4;
    --se-text:     #ccd6f6;
    --se-text-dim: #8892b0;
}

/* ── Global ─────────────────────────────────────────────────────────────── */
html, body {
    font-family: 'Roboto', sans-serif;
    background: var(--se-dark);
    color: var(--se-text);
    overflow-x: hidden;
}

/* ── Circuit board background ───────────────────────────────────────────── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(0,180,216,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,180,216,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

/* ── Scan line animation ────────────────────────────────────────────────── */
@keyframes scanline {
    0%   { transform: translateY(-100%); }
    100% { transform: translateY(100vh); }
}
body::after {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--se-cyan), transparent);
    opacity: 0.15;
    animation: scanline 8s linear infinite;
    pointer-events: none;
    z-index: 9999;
}

/* ── Glowing text ───────────────────────────────────────────────────────── */
.tech-title {
    font-family: 'Orbitron', monospace !important;
    letter-spacing: 0.08em;
    text-shadow: 0 0 20px var(--se-cyan), 0 0 40px var(--se-blue);
}
.glow-text {
    text-shadow: 0 0 10px currentColor;
}

/* ── Glowing cards ───────────────────────────────────────────────────────────
   ÖNEMLİ: ":not(.mud-popover):not(.mud-list)" — bu dekoratif kurallar açılır
   menülere (MudSelect/MudDatePicker/MudMenu popover'ları) UYGULANMAMALI; aksi
   halde popover'ın konumlandırması/overflow'u bozuluyor (liste açılmıyor/kayboluyor). */
.mud-card, .mud-paper:not(.mud-popover):not(.mud-list) {
    border: 1px solid var(--se-border) !important;
    backdrop-filter: blur(4px);
    transition: border-color 0.3s, box-shadow 0.3s !important;
    position: relative;
    overflow: hidden;
}
.mud-card::before, .mud-paper:not(.mud-popover):not(.mud-list)::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--se-glow-sm) 0%, transparent 60%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}
.mud-card:hover::before, .mud-paper:not(.mud-popover):not(.mud-list):hover::before {
    opacity: 1;
}
.mud-card:hover, .mud-paper:not(.mud-popover):not(.mud-list):hover {
    border-color: rgba(0,180,216,0.4) !important;
    box-shadow: 0 0 20px var(--se-glow-sm), inset 0 0 20px var(--se-glow-sm) !important;
}

/* ── Stat card border accent ────────────────────────────────────────────── */
[style*="border-left"] {
    position: relative;
}
[style*="border-left"]::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    filter: blur(4px);
    background: inherit;
}

/* ── Pulsing dot (online indicator) ─────────────────────────────────────── */
@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0,245,212,0.6); }
    50%       { box-shadow: 0 0 0 6px rgba(0,245,212,0); }
}
.status-online {
    animation: pulse-dot 2s ease-in-out infinite;
    border-radius: 50%;
}

/* ── Neon button ────────────────────────────────────────────────────────── */
.mud-button-filled-primary {
    background: linear-gradient(135deg, var(--se-blue), var(--se-cyan)) !important;
    box-shadow: 0 0 15px var(--se-glow) !important;
    transition: box-shadow 0.2s !important;
    font-family: 'Roboto', sans-serif !important;
    letter-spacing: 0.04em !important;
}
.mud-button-filled-primary:hover {
    box-shadow: 0 0 30px var(--se-glow), 0 0 60px var(--se-glow-sm) !important;
}

/* ── AppBar glow line ───────────────────────────────────────────────────── */
.mud-appbar {
    border-bottom: 1px solid var(--se-border) !important;
    box-shadow: 0 2px 20px rgba(0,0,0,0.5) !important;
    backdrop-filter: blur(10px) !important;
}

/* ── Drawer ─────────────────────────────────────────────────────────────── */
.mud-drawer {
    border-right: 1px solid var(--se-border) !important;
}
.mud-nav-link.active {
    background: linear-gradient(90deg, rgba(0,180,216,0.15), transparent) !important;
    border-left: 3px solid var(--se-cyan) !important;
    color: var(--se-cyan) !important;
}

/* ── Table ──────────────────────────────────────────────────────────────── */
.mud-table-row:hover {
    background: rgba(0,180,216,0.06) !important;
}

/* ── Chip glow ──────────────────────────────────────────────────────────── */
.mud-chip-color-success {
    box-shadow: 0 0 8px rgba(0,245,212,0.4) !important;
}
.mud-chip-color-error {
    box-shadow: 0 0 8px rgba(239,35,60,0.4) !important;
}

/* ── Input fields ───────────────────────────────────────────────────────── */
.mud-input-outlined:focus-within .mud-input-outlined-border {
    border-color: var(--se-cyan) !important;
    box-shadow: 0 0 10px var(--se-glow-sm) !important;
}

/* ── Scrollbar ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--se-surface); }
::-webkit-scrollbar-thumb {
    background: var(--se-border);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--se-cyan); }

/* ── Blazor error UI ────────────────────────────────────────────────────── */
#blazor-error-ui {
    background: #1a0012;
    color: #ff6b9d;
    border-top: 1px solid #ff6b9d;
    padding: 0.6rem 1.25rem;
    display: none;
    position: fixed;
    bottom: 0; left: 0; width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem; top: 0.5rem;
}

/* ── ARIA AI Assistant ──────────────────────────────────────────────────── */
.aria-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9000;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d1b2a, #1a3a5c);
    border: 2px solid var(--se-cyan);
    box-shadow: 0 0 20px var(--se-glow), 0 0 60px rgba(0,180,216,0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}
.aria-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px var(--se-glow), 0 0 80px rgba(0,180,216,0.3);
}
.aria-fab.open {
    border-color: var(--se-teal);
    box-shadow: 0 0 30px rgba(0,245,212,0.4), 0 0 80px rgba(0,245,212,0.2);
}

@keyframes eye-pulse {
    0%, 100% { r: 6; opacity: 1; }
    50%       { r: 8; opacity: 0.8; }
}
@keyframes iris-scan {
    0%   { transform: translateX(0); }
    25%  { transform: translateX(3px); }
    75%  { transform: translateX(-3px); }
    100% { transform: translateX(0); }
}
@keyframes blink {
    0%, 90%, 100% { transform: scaleY(1); }
    95%           { transform: scaleY(0.1); }
}
.aria-eye-iris { animation: iris-scan 4s ease-in-out infinite; }
.aria-eye-lid  { animation: blink 5s ease-in-out infinite; transform-origin: 50% 50%; }

/* ARIA Chat panel */
.aria-panel {
    position: fixed;
    bottom: 100px;
    right: 28px;
    width: 380px;
    max-height: 560px;
    background: linear-gradient(180deg, #0d1b2a 0%, #090e1a 100%);
    border: 1px solid var(--se-border);
    border-radius: 16px;
    box-shadow: 0 0 40px rgba(0,180,216,0.2), 0 20px 60px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 8999;
    animation: panel-slide-in 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes panel-slide-in {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.aria-panel-header {
    background: linear-gradient(90deg, #0d1b2a, #1a3a5c);
    border-bottom: 1px solid var(--se-border);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.aria-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 200px;
}

.aria-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.875rem;
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-wrap;
}
.aria-msg-user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--se-blue), #023e8a);
    border-bottom-right-radius: 4px;
    color: #e0f7fa;
}
.aria-msg-aria {
    align-self: flex-start;
    background: linear-gradient(135deg, #1a3a5c, #0d2137);
    border: 1px solid var(--se-border);
    border-bottom-left-radius: 4px;
    color: var(--se-text);
}

/* Typing dots */
@keyframes typing-dot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30%           { transform: translateY(-6px); opacity: 1; }
}
.typing-dots { display: flex; gap: 4px; padding: 6px 4px; align-items: center; }
.typing-dots span {
    width: 6px; height: 6px;
    background: var(--se-cyan);
    border-radius: 50%;
    animation: typing-dot 1.2s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

.aria-input-area {
    border-top: 1px solid var(--se-border);
    padding: 10px 12px;
    display: flex;
    gap: 8px;
    align-items: flex-end;
    background: rgba(9,14,26,0.8);
}
.aria-input {
    flex: 1;
    background: rgba(0,180,216,0.07);
    border: 1px solid var(--se-border);
    border-radius: 8px;
    color: var(--se-text);
    padding: 8px 12px;
    font-size: 0.875rem;
    resize: none;
    outline: none;
    font-family: 'Roboto', sans-serif;
    min-height: 38px;
    max-height: 100px;
    overflow-y: auto;
    transition: border-color 0.2s;
}
.aria-input:focus { border-color: var(--se-cyan); box-shadow: 0 0 8px var(--se-glow-sm); }
.aria-input::placeholder { color: var(--se-text-dim); }
.aria-send-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--se-blue), var(--se-cyan));
    border: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: white;
    flex-shrink: 0;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 0 10px var(--se-glow-sm);
}
.aria-send-btn:hover { transform: scale(1.1); box-shadow: 0 0 16px var(--se-glow); }
.aria-send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* Responsive */
@media (max-width: 480px) {
    .aria-panel { width: calc(100vw - 24px); right: 12px; bottom: 90px; }
    .aria-fab   { right: 16px; bottom: 16px; }
}

/* ── h1-h6 font override for tech feel ────────────────────────────────── */
h1, h2, h3 { letter-spacing: 0.02em; }

/* ── Loading animation override ─────────────────────────────────────────── */
.loading-progress circle:last-child { stroke: var(--se-cyan); }

/* ── Mud chip outlined primary ───────────────────────────────────────────── */
.mud-chip-outlined-primary {
    border-color: var(--se-cyan) !important;
    color: var(--se-cyan) !important;
}

/* ── fw-bold util ────────────────────────────────────────────────────────── */
.fw-bold { font-weight: 600 !important; }

/* ── Select popover: sayfa akışını bozmasın, sabit yükseklik ─────────────── */
.se-select-popover {
    max-height: 320px;
    overflow-y: auto;
}

/* Açılır menü (popover): dekoratif .mud-paper kuralları yukarıda zaten
   ":not(.mud-popover)" ile dışlandı, MudBlazor'ın kendi konumlandırması bozulmuyor.
   Yalnızca blur'u kapatıyoruz (dropdown arkası net görünsün). */
.mud-popover {
    backdrop-filter: none !important;
}
