/* =================================
   1. CORE SYSTEM VARIABLES
================================= */
:root {
    /* Brand Palette */
    --glow-primary: #58a6ff;
    --glow-secondary: #00a2ff;
    --accent-glow: rgba(88, 166, 255, 0.4);
    
    /* Neutral & Backgrounds */
    --dark-bg: #0d1117;
    --card-elevated: #161b22;
    --nav-bg: rgba(13, 17, 23, 0.95);

    /* Typography Hierarchy */
    --text-bright: #f0f6fc;   /* Headers, Titles, Focus */
    --text-main: #c9d1d9;     /* Standard readable text */
    --text-muted: #8b949e;    /* Comments, placeholders, secondary info */
    --label-color: #79c0ff;   /* Logical parameter labels */

    /* UI Elements */
    --border-subtle: #30363d;
    --border-strong: #484f58;
    --transition-speed: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =================================
   2. GLOBAL RESET & READABILITY
================================= */
body {
    background-color: var(--dark-bg);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* Subtle Grid Background */
    background-image: 
        linear-gradient(rgba(88, 166, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(88, 166, 255, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

#uplot-target {
    background: #000;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* =================================
   3. NAVIGATION (CYBER-STEALTH)
================================= */
.custom-navbar {
    background: var(--nav-bg) !important;
    backdrop-filter: blur(12px);
    border-bottom: 2px solid var(--glow-primary);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.navbar-brand h7 {
    color: var(--glow-primary) !important;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 0 10px var(--accent-glow);
}

.nav-link h7 {
    color: var(--text-main) !important;
    font-weight: 700;
    transition: var(--transition-speed);
}

.nav-link:hover h7 {
    color: var(--glow-primary) !important;
}

/* Active State Polygon */
.nav-item.active .nav-link h7 {
    color: var(--dark-bg) !important;
    background: var(--glow-primary);
    padding: 4px 12px;
    clip-path: polygon(10% 0%, 100% 0%, 90% 100%, 0% 100%);
}

/* =================================
   4. CARDS & EXECUTION INTERFACE
================================= */
.card, .modal-content {
    background: var(--card-elevated) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.card-header {
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-subtle) !important;
    color: var(--text-bright);
    font-weight: 700;
}

.form-label {
    color: var(--label-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
}

/* Description Box Styling */
#op-description-box {
    background: rgba(88, 166, 255, 0.07) !important;
    border-left: 3px solid var(--glow-primary) !important;
    color: var(--text-main) !important;
}

/* =================================
   5. INPUTS & TERMINAL (READABILITY FIRST)
================================= */
.form-control, .form-select, .select2-container--bootstrap-5 .select2-selection {
    background-color: var(--dark-bg) !important;
    border: 1px solid var(--border-strong) !important;
    color: var(--text-bright) !important;
}

.form-control:focus, .form-select:focus {
    border-color: var(--glow-primary) !important;
    box-shadow: 0 0 0 3px var(--accent-glow) !important;
}

#terminal-outputs, #assets-gallery {
    font-family: 'Fira Code', 'JetBrains Mono', monospace;
    background-color: #080b10 !important; /* Slightly darker for contrast */
    color: #a5d6ff;
    font-size: 0.9rem;
    padding: 1rem;
    border-radius: 0 0 8px 8px;
}
#terminal-outputs {
    white-space: pre-wrap;       /* Respect line breaks but wrap text */
    word-wrap: break-word;       /* Legacy support */
    overflow-wrap: break-word;   /* Modern standard for breaking long words */
    word-break: break-all;       /* Forces breaks at any character to prevent overflow */
    max-width: 100%;             /* Ensure it never exceeds parent container */
    display: block;              /* Ensure block-level behavior */
}

.console-header {
    background: #1c2128;
    color: var(--text-bright);
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

/* =================================
   6. BUTTONS (UNIFORM ACTION)
================================= */
.btn-execute {
    background: var(--glow-primary) !important;
    color: var(--dark-bg) !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none !important;
    transition: var(--transition-speed);
}

.btn-execute:hover {
    background: var(--glow-secondary) !important;
    box-shadow: 0 0 15px var(--accent-glow);
    transform: translateY(-1px);
}

/* Logout Override */
button[style*="background-color: #dc3545"] {
    background-color: #da3633 !important;
    color: #fff !important;
}

/* =================================
   7. SCROLLBAR & UTILITIES
================================= */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--glow-primary);
}

.alert-secondary.border-info {
    background: rgba(88, 166, 255, 0.05);
    border: 1px solid var(--glow-primary) !important;
    color: var(--text-main);
}

/* High-contrast for the selected option in the dropdown */
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    color: var(--text-bright) !important; /* Makes the visible text pop */
    font-weight: 600;
}

/* Fix the 'dim' look when the dropdown is open */
.select2-container--bootstrap-5 .select2-results__option--highlighted[aria-selected] {
    background-color: var(--glow-primary) !important;
    color: var(--dark-bg) !important; /* Dark text on bright blue background */
}

/* Fix for the 'dim' pre-selected text in the box */
#operation-select option:checked {
    color: var(--glow-primary) !important;
    background-color: var(--border-strong);
}
/* Standardize the Feed container for maximum readability */
#feed-container .card-body {
    background: #0d1117 !important; /* Force a solid dark background to prevent grid-clutter */
	/*pointer-events: none; I*/
}

#feed-container {
    /* Prevents mouse interaction */
    /*pointer-events: none; */
    
    
}

.feed-description {
    color: #b1bac4 !important; /* Shifting from blue-gray to neutral-gray for text clarity */
    font-size: 0.85rem;
    line-height: 1.5;
    text-shadow: none; /* Remove any glow that causes blurring on small text */
}

.feed-title-link {
    color: var(--glow-primary) !important;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 4px;
}
/* Target only the buttons in your focus flow */
.btn-execute:focus, 
#operation-select:focus,
.dynamic-param:focus {
    outline: none; /* Remove the default ugly blue ring */
    border-color: #00ffff !important; /* Fermitronics Cyan */
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5); /* Neon Glow */
    background-color: rgba(0, 255, 255, 0.1);
    transition: all 0.2s ease-in-out;
}

.plot-container {
    position: relative;
    overflow: hidden; /* Prevents SVG lines/boxes from spilling out */
    cursor: crosshair;
    display: inline-block; /* Wraps tightly around the image */
}

.plot-img {
    display: block;
    max-width: 100%;
    height: auto;
}