/* Modern Professional Industrial Palette - Blue Tier */
:root {
    --bg-dark: #0f172a;          /* Deep Navy Obsidian */
    --panel-bg: #1e293b;        /* Slate Blue-Gray */
    --accent: #38bdf8;           /* Sky Blue (Professional Technical) */
    --accent-hover: #0ea5e9;     /* Deepened Sky Blue */
    --text-primary: #f8fafc;     /* Ice White */
    --text-secondary: #94a3b8;   /* Muted Steel */
    --border-color: #334155;     /* Dark Steel Slate */
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    padding: 40px 20px;
}

/* Header Styling */
header {
    /* max-width: 1000px; */
    margin: 0 auto 40px;
    border-left: 4px solid var(--accent);
    padding: 10px 0 10px 20px; 
}

h1 {
    font-size: 1.6rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--text-primary);
}

h1 span {
    display: block;
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 3px;
    margin-top: 4px;
}

/* Professional Industrial Panel */
.industrial-panel {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    overflow: visible !important; /* Prevents the panel from cutting off the dropdown */
}

h2 {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent);
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
}

h2::before {
    content: "///";
    margin-right: 10px;
    opacity: 0.5;
}

/* Form Elements */
.grid-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    align-items: end;
}

input, select {
    background: #0f172a; /* Contrast against panel */
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    padding: 12px 16px;
    font-family: var(--font-main);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15);
}

/* Buttons */
.btn-industrial {
    background: var(--accent);
    color: #0f172a;
    border: none;
    border-radius: 6px;
    padding: 12px 24px;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-industrial:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

/* Result Display */
.result-display {
    margin-top: 24px;
    padding: 24px;
    background: rgba(56, 189, 248, 0.05);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--accent);
    text-align: center;
}

/* Table Styling for Batch CSV */
.table-container {
    overflow-x: auto;
    margin-top: 10px;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.85rem;
}

th {
    text-align: left;
    padding: 12px 16px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    text-transform: uppercase;
    font-size: 0.7rem;
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

tr:last-child td { border-bottom: none; }

tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.terminal-container {
    padding: 0 !important; /* Flush edges for the terminal look */
    overflow: hidden; 
}

/* 1. Remove the default browser arrow */
.terminal-header {
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
}

.terminal-header::-webkit-details-marker {
    display: none;
}

/* 2. Create the minimalist indicator */
.terminal-header::after {
    content: '';
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--accent); /* Uses your professional blue accent */
    border-bottom: 2px solid var(--accent);
    transform: rotate(-45deg); /* Points Right (Closed) */
    transition: transform 0.2s ease-in-out; /* Smooth industrial transition */
    margin-right: 5px;
}

/* 3. Rotate the indicator when the panel is open */
details[open] .terminal-header::after {
    transform: rotate(45deg); /* Points Down (Open) */
}

.terminal-body {
    height: 180px;
    overflow-y: auto;
    padding: 15px;
    background: #050a14; /* Darker than the panel for depth */
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.4;
}

.log-entry {
    margin-bottom: 4px;
    border-left: 2px solid transparent;
    padding-left: 8px;
}

/* Color coding for log types */
.log-entry.system { color: var(--text-secondary); }
.log-entry.api-call { color: var(--accent); }
.log-entry.success { color: #4ade80; border-left-color: #4ade80; }
.log-entry.error { color: #f87171; border-left-color: #f87171; }

.btn-terminal-clear {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    padding: 2px 8px;
    cursor: pointer;
}

.input-wrapper {
    position: relative; /* Necessary to position the dropdown correctly */
    width: 100%;
}

.custom-results-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1e293b; /* Matches your --panel-bg */
    border: 1px solid var(--accent);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

.result-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-primary);
    transition: background 0.2s;
}

.result-item:hover {
    background: rgba(56, 189, 248, 0.15); /* Subtle blue highlight */
    color: var(--accent);
}

.result-item:last-child {
    border-bottom: none;
}

