/**
 * ==============================================================================
 * OmniSearch - Scientific Masonry Stylesheet
 * Architecture: Scientific Dark Obsidian & Creative Responsive Infinity Grid
 * Design Language: Awwwards / ThemeForest High-Tech Neuro-Scientific Aesthetic
 * ==============================================================================
 */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,300;0,400;0,500;0,700;1,400&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    /* --------------------------------------------------------------------------
     * 1. SCIENTIFIC DARK OBSIDIAN PALETTE
     * -------------------------------------------------------------------------- */
    --sci-bg-obsidian-deep: #070c14;
    --sci-bg-obsidian: #0b111e;
    --sci-bg-surface-glass: rgba(15, 23, 42, 0.75);
    --sci-bg-surface-elevated: rgba(30, 41, 59, 0.85);
    --sci-bg-glass-subtle: rgba(255, 255, 255, 0.03);
    
    /* Subtle Glass Borders */
    --sci-border-subtle: rgba(255, 255, 255, 0.08);
    --sci-border-hover: rgba(255, 255, 255, 0.22);
    --sci-border-active: rgba(6, 182, 212, 0.45);

    /* Scientific High-Tech Accent Colors (Neon Spectra) */
    --sci-neon-cyan: #06b6d4;
    --sci-neon-cyan-glow: rgba(6, 182, 212, 0.45);
    --sci-neon-cyan-dim: rgba(6, 182, 212, 0.12);

    --sci-neon-amber: #f59e0b;
    --sci-neon-amber-glow: rgba(245, 158, 11, 0.45);
    --sci-neon-amber-dim: rgba(245, 158, 11, 0.12);

    --sci-neon-emerald: #10b981;
    --sci-neon-emerald-glow: rgba(16, 185, 129, 0.45);
    --sci-neon-emerald-dim: rgba(16, 185, 129, 0.12);

    --sci-neon-violet: #8b5cf6;
    --sci-neon-violet-glow: rgba(139, 92, 246, 0.45);
    --sci-neon-violet-dim: rgba(139, 92, 246, 0.12);

    --sci-neon-rose: #f43f5e;
    --sci-neon-rose-glow: rgba(244, 63, 94, 0.45);
    --sci-neon-rose-dim: rgba(244, 63, 94, 0.12);

    /* Typography & Hierarchy */
    --sci-font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
    --sci-font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --sci-text-bright: #f8fafc;
    --sci-text-primary: #e2e8f0;
    --sci-text-muted: #94a3b8;
    --sci-text-dim: #64748b;

    /* Grid Configuration */
    --sci-masonry-gap: 1.5rem;
    --sci-card-radius: 1.15rem;
    --sci-blur-strength: 16px;
}

/* ------------------------------------------------------------------------------
 * 2. SCIENTIFIC DARK OBSIDIAN ENVIRONMENT & CONTAINER
 * ------------------------------------------------------------------------------ */
.sci-obsidian-theme,
body.sci-obsidian {
    background-color: var(--sci-bg-obsidian-deep) !important;
    background-image: 
        radial-gradient(circle at 18% 12%, rgba(6, 182, 212, 0.07) 0%, transparent 40%),
        radial-gradient(circle at 82% 80%, rgba(139, 92, 246, 0.06) 0%, transparent 45%),
        linear-gradient(180deg, var(--sci-bg-obsidian-deep) 0%, var(--sci-bg-obsidian) 100%) !important;
    background-attachment: fixed;
    color: var(--sci-text-primary);
    min-height: 100vh;
}

/* Subtle Quantum Grid Pattern Overlay */
.sci-grid-pattern {
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 32px 32px;
}

/* ------------------------------------------------------------------------------
 * 3. RESPONSIVE CREATIVE MASONRY INFINITY GRID
 * Breakpoints:
 *   >= 1600px:        5 Spalten (column-count: 5)
 *   1200px - 1599px:  4 Spalten (column-count: 4)
 *   992px - 1199px:   3 Spalten (column-count: 3)
 *   640px - 991px:    2 Spalten (column-count: 2)
 *   < 640px:          1 Spalte  (column-count: 1)
 * ------------------------------------------------------------------------------ */
.sci-masonry-grid,
.masonry-container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    column-gap: var(--sci-masonry-gap);
    column-fill: balance;
    transition: column-count 0.3s ease;
}

/* < 640px: 1 Spalte */
@media (max-width: 639.98px) {
    .sci-masonry-grid,
    .masonry-container {
        column-count: 1 !important;
        column-gap: 1rem;
    }
}

/* 640px - 991px: 2 Spalten */
@media (min-width: 640px) and (max-width: 991.98px) {
    .sci-masonry-grid,
    .masonry-container {
        column-count: 2 !important;
        column-gap: 1.25rem;
    }
}

/* 992px - 1199px: 3 Spalten */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .sci-masonry-grid,
    .masonry-container {
        column-count: 3 !important;
        column-gap: 1.25rem;
    }
}

/* 1200px - 1599px: 4 Spalten */
@media (min-width: 1200px) and (max-width: 1599.98px) {
    .sci-masonry-grid,
    .masonry-container {
        column-count: 4 !important;
        column-gap: 1.5rem;
    }
}

/* >= 1600px: 5 Spalten */
@media (min-width: 1600px) {
    .sci-masonry-grid,
    .masonry-container {
        column-count: 5 !important;
        column-gap: 1.5rem;
    }
}

/* Masonry Tile Item Architecture */
.sci-masonry-item,
.masonry-tile {
    display: inline-block;
    width: 100%;
    margin-bottom: var(--sci-masonry-gap);
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    position: relative;
    vertical-align: top;
    will-change: transform, opacity;
}

/* ------------------------------------------------------------------------------
 * 4. GLASMORPHISMUS-KARTEN (.sci-card-glass) & SCIENTIFIC CARDS
 * Spec:
 *   - Background: rgba(15, 23, 42, 0.75)
 *   - Backdrop-filter: blur(16px)
 *   - 1px subtile Border: rgba(255, 255, 255, 0.08)
 *   - Hover: translateY(-4px) scale(1.008)
 *   - Glow: Neon Cyan, Amber, Emerald, Violet
 * ------------------------------------------------------------------------------ */
.sci-card-glass {
    position: relative;
    background: var(--sci-bg-surface-glass);
    backdrop-filter: blur(var(--sci-blur-strength));
    -webkit-backdrop-filter: blur(var(--sci-blur-strength));
    border: 1px solid var(--sci-border-subtle);
    border-radius: var(--sci-card-radius);
    padding: 1.35rem;
    color: var(--sci-text-primary);
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.45);
}

/* Hover-Glow & Sanfter Auftrieb: translateY(-4px) scale(1.008) */
.sci-card-glass:hover,
.sci-masonry-item:hover .sci-card-glass,
.masonry-tile:hover .sci-card-glass {
    transform: translateY(-4px) scale(1.008);
    border-color: var(--sci-border-hover);
    box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.75),
                0 0 28px -4px var(--sci-card-glow, rgba(6, 182, 212, 0.35));
    z-index: 5;
}

/* Subtiler Reflektions-Glanz im Header der Karte */
.sci-card-glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.15) 30%, 
        rgba(255, 255, 255, 0.25) 50%, 
        rgba(255, 255, 255, 0.15) 70%, 
        transparent 100%);
    pointer-events: none;
}

/* Spektrale Neon Hover-Glow Varianten */
/* 1. Neon Cyan */
.sci-glow-cyan,
.sci-card-glass.sci-cyan {
    --sci-card-glow: var(--sci-neon-cyan-glow);
}
.sci-glow-cyan:hover,
.sci-card-glass.sci-cyan:hover,
.masonry-tile:hover .sci-glow-cyan {
    border-color: rgba(6, 182, 212, 0.5) !important;
    box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.75), 0 0 30px -4px var(--sci-neon-cyan-glow) !important;
}

/* 2. Neon Amber */
.sci-glow-amber,
.sci-card-glass.sci-amber {
    --sci-card-glow: var(--sci-neon-amber-glow);
}
.sci-glow-amber:hover,
.sci-card-glass.sci-amber:hover,
.masonry-tile:hover .sci-glow-amber {
    border-color: rgba(245, 158, 11, 0.5) !important;
    box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.75), 0 0 30px -4px var(--sci-neon-amber-glow) !important;
}

/* 3. Neon Emerald */
.sci-glow-emerald,
.sci-card-glass.sci-emerald {
    --sci-card-glow: var(--sci-neon-emerald-glow);
}
.sci-glow-emerald:hover,
.sci-card-glass.sci-emerald:hover,
.masonry-tile:hover .sci-glow-emerald {
    border-color: rgba(16, 185, 129, 0.5) !important;
    box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.75), 0 0 30px -4px var(--sci-neon-emerald-glow) !important;
}

/* 4. Neon Violet */
.sci-glow-violet,
.sci-card-glass.sci-violet {
    --sci-card-glow: var(--sci-neon-violet-glow);
}
.sci-glow-violet:hover,
.sci-card-glass.sci-violet:hover,
.masonry-tile:hover .sci-glow-violet {
    border-color: rgba(139, 92, 246, 0.5) !important;
    box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.75), 0 0 30px -4px var(--sci-neon-violet-glow) !important;
}

/* 5. Neon Rose */
.sci-glow-rose,
.sci-card-glass.sci-rose {
    --sci-card-glow: var(--sci-neon-rose-glow);
}
.sci-glow-rose:hover,
.sci-card-glass.sci-rose:hover,
.masonry-tile:hover .sci-glow-rose {
    border-color: rgba(244, 63, 94, 0.5) !important;
    box-shadow: 0 16px 36px -8px rgba(0, 0, 0, 0.75), 0 0 30px -4px var(--sci-neon-rose-glow) !important;
}

/* Akzent-Randkanten (Top Accent Bar) */
.sci-accent-border-top-cyan { border-top: 3px solid var(--sci-neon-cyan) !important; }
.sci-accent-border-top-amber { border-top: 3px solid var(--sci-neon-amber) !important; }
.sci-accent-border-top-emerald { border-top: 3px solid var(--sci-neon-emerald) !important; }
.sci-accent-border-top-violet { border-top: 3px solid var(--sci-neon-violet) !important; }
.sci-accent-border-top-rose { border-top: 3px solid var(--sci-neon-rose) !important; }

/* ------------------------------------------------------------------------------
 * 5. MICRO-STAGGER ANIMATIONEN FÜR KACHELN
 * ------------------------------------------------------------------------------ */
@keyframes sciTileEntrance {
    0% {
        opacity: 0;
        transform: translateY(22px) scale(0.975);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.sci-animate-in,
.sci-masonry-item,
.masonry-tile {
    animation: sciTileEntrance 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Micro-Staggering via nth-child Selektoren (bis zu 24 Elemente) */
.sci-masonry-grid > *:nth-child(1), .masonry-container > *:nth-child(1)  { animation-delay: 0.03s; }
.sci-masonry-grid > *:nth-child(2), .masonry-container > *:nth-child(2)  { animation-delay: 0.06s; }
.sci-masonry-grid > *:nth-child(3), .masonry-container > *:nth-child(3)  { animation-delay: 0.09s; }
.sci-masonry-grid > *:nth-child(4), .masonry-container > *:nth-child(4)  { animation-delay: 0.12s; }
.sci-masonry-grid > *:nth-child(5), .masonry-container > *:nth-child(5)  { animation-delay: 0.15s; }
.sci-masonry-grid > *:nth-child(6), .masonry-container > *:nth-child(6)  { animation-delay: 0.18s; }
.sci-masonry-grid > *:nth-child(7), .masonry-container > *:nth-child(7)  { animation-delay: 0.21s; }
.sci-masonry-grid > *:nth-child(8), .masonry-container > *:nth-child(8)  { animation-delay: 0.24s; }
.sci-masonry-grid > *:nth-child(9), .masonry-container > *:nth-child(9)  { animation-delay: 0.27s; }
.sci-masonry-grid > *:nth-child(10), .masonry-container > *:nth-child(10) { animation-delay: 0.30s; }
.sci-masonry-grid > *:nth-child(11), .masonry-container > *:nth-child(11) { animation-delay: 0.33s; }
.sci-masonry-grid > *:nth-child(12), .masonry-container > *:nth-child(12) { animation-delay: 0.36s; }
.sci-masonry-grid > *:nth-child(13), .masonry-container > *:nth-child(13) { animation-delay: 0.39s; }
.sci-masonry-grid > *:nth-child(14), .masonry-container > *:nth-child(14) { animation-delay: 0.42s; }
.sci-masonry-grid > *:nth-child(15), .masonry-container > *:nth-child(15) { animation-delay: 0.45s; }
.sci-masonry-grid > *:nth-child(16), .masonry-container > *:nth-child(16) { animation-delay: 0.48s; }
.sci-masonry-grid > *:nth-child(17), .masonry-container > *:nth-child(17) { animation-delay: 0.51s; }
.sci-masonry-grid > *:nth-child(18), .masonry-container > *:nth-child(18) { animation-delay: 0.54s; }
.sci-masonry-grid > *:nth-child(19), .masonry-container > *:nth-child(19) { animation-delay: 0.57s; }
.sci-masonry-grid > *:nth-child(20), .masonry-container > *:nth-child(20) { animation-delay: 0.60s; }
.sci-masonry-grid > *:nth-child(21), .masonry-container > *:nth-child(21) { animation-delay: 0.63s; }
.sci-masonry-grid > *:nth-child(22), .masonry-container > *:nth-child(22) { animation-delay: 0.66s; }
.sci-masonry-grid > *:nth-child(23), .masonry-container > *:nth-child(23) { animation-delay: 0.69s; }
.sci-masonry-grid > *:nth-child(24), .masonry-container > *:nth-child(24) { animation-delay: 0.72s; }

/* ------------------------------------------------------------------------------
 * 6. MONOSPACE HUD BADGES & TELEMETRIE
 * ------------------------------------------------------------------------------ */
.sci-hud-badge {
    font-family: var(--sci-font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 0.28rem 0.65rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid var(--sci-border-subtle);
    color: var(--sci-text-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    line-height: 1;
    white-space: nowrap;
}

/* Vektor-Distanz Badge */
.sci-badge-vector {
    font-family: var(--sci-font-mono);
    color: var(--sci-neon-cyan);
    border-color: rgba(6, 182, 212, 0.3);
    background: rgba(6, 182, 212, 0.08);
}
.sci-badge-vector::before {
    content: '◈';
    font-size: 0.8em;
    color: var(--sci-neon-cyan);
}

/* RTT Telemetrie Badge */
.sci-badge-telemetry {
    font-family: var(--sci-font-mono);
    color: var(--sci-neon-emerald);
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.08);
}

/* Pulsierender Telemetrie-Punkt */
.sci-telemetry-indicator,
.sci-pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--sci-neon-emerald);
    box-shadow: 0 0 8px var(--sci-neon-emerald);
    position: relative;
    display: inline-block;
}
.sci-pulse-dot::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    border: 1px solid var(--sci-neon-emerald);
    animation: sciPulseRing 1.8s infinite ease-out;
}

@keyframes sciPulseRing {
    0% { transform: scale(0.9); opacity: 1; }
    100% { transform: scale(2.4); opacity: 0; }
}

/* Cosinus-Ähnlichkeits-Ringe */
.sci-cosine-ring {
    width: 32px;
    height: 32px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.sci-cosine-ring svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}
.sci-cosine-ring circle.bg {
    stroke: rgba(255, 255, 255, 0.08);
    fill: none;
}
.sci-cosine-ring circle.meter {
    fill: none;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.8s ease;
    filter: drop-shadow(0 0 4px var(--sci-neon-cyan));
}
.sci-cosine-ring .ring-label {
    position: absolute;
    font-family: var(--sci-font-mono);
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--sci-text-bright);
}

/* Cosinus Conic Ring (CSS Only Version) */
.sci-cosine-conic-ring {
    --similarity: 88%;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: conic-gradient(
        var(--sci-neon-cyan) var(--similarity),
        rgba(255, 255, 255, 0.08) 0
    );
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}
.sci-cosine-conic-ring::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--sci-bg-surface-glass);
}
.sci-cosine-conic-ring span {
    position: relative;
    font-family: var(--sci-font-mono);
    font-size: 0.58rem;
    font-weight: 700;
    color: var(--sci-text-bright);
    z-index: 1;
}

/* ------------------------------------------------------------------------------
 * 7. SCIENTIFIC SEARCH CONTROL CONSOLE & INPUTS
 * ------------------------------------------------------------------------------ */
.sci-console-glass {
    background: rgba(15, 23, 42, 0.82) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--sci-border-subtle) !important;
    border-radius: 1.25rem !important;
    box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.6);
}

.sci-input-glass {
    background: rgba(7, 12, 20, 0.7) !important;
    border: 1px solid var(--sci-border-subtle) !important;
    color: var(--sci-text-bright) !important;
    backdrop-filter: blur(10px);
    transition: all 0.25s ease;
}
.sci-input-glass:focus {
    border-color: var(--sci-neon-cyan) !important;
    box-shadow: 0 0 16px rgba(6, 182, 212, 0.35) !important;
    background: rgba(11, 17, 30, 0.9) !important;
}
.sci-input-glass::placeholder {
    color: var(--sci-text-dim) !important;
}

/* Range Slider Styling (Scientific Biases) */
.sci-range {
    accent-color: var(--sci-neon-cyan);
}
.sci-range::-webkit-slider-runnable-track {
    background: rgba(255, 255, 255, 0.08);
    height: 6px;
    border-radius: 3px;
}
.sci-range::-webkit-slider-thumb {
    box-shadow: 0 0 10px var(--sci-neon-cyan);
}

/* Scientific Suggestion Pill Buttons */
.sci-pill-btn {
    font-family: var(--sci-font-sans);
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 9999px;
    padding: 0.35rem 0.9rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--sci-border-subtle);
    color: var(--sci-text-muted);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.sci-pill-btn:hover {
    background: rgba(6, 182, 212, 0.12);
    border-color: rgba(6, 182, 212, 0.4);
    color: var(--sci-neon-cyan);
    transform: translateY(-1px);
}
.sci-pill-btn.active {
    background: var(--sci-neon-cyan);
    color: #070c14;
    font-weight: 700;
    box-shadow: 0 0 14px var(--sci-neon-cyan-glow);
}

/* Scientific Action Button */
.sci-btn-action {
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    border: none;
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 18px rgba(6, 182, 212, 0.4);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.sci-btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(6, 182, 212, 0.6);
    color: #ffffff;
}

/* ------------------------------------------------------------------------------
 * 8. CODE & SYNTHESIS TERMINAL CONTAINER
 * ------------------------------------------------------------------------------ */
.sci-terminal-window {
    background: #05080f;
    border: 1px solid var(--sci-border-subtle);
    border-radius: 0.75rem;
    font-family: var(--sci-font-mono);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.8);
}
.sci-terminal-header {
    background: rgba(255, 255, 255, 0.03);
    padding: 0.4rem 0.8rem;
    border-bottom: 1px solid var(--sci-border-subtle);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.sci-terminal-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.sci-terminal-dot.red { background: #ef4444; }
.sci-terminal-dot.yellow { background: #eab308; }
.sci-terminal-dot.green { background: #22c55e; }

/* ------------------------------------------------------------------------------
 * 9. RESPONSIVE SCROLLBAR & SYSTEM UTILITIES
 * ------------------------------------------------------------------------------ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--sci-bg-obsidian-deep);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--sci-neon-cyan);
}
