/* ==========================================================================
   Base Styles
   ========================================================================== */

/* CSS Custom Properties for consistent theming */
:root {
    --color-bg-primary: #1e1e2e;
    --color-bg-secondary: #1f2937;
    --color-bg-tertiary: #313244;
    --color-text-primary: #cdd6f4;
    --color-text-secondary: #d1d5db;
    --color-accent-blue: #3b82f6;
    --color-accent-blue-hover: #2563eb;
    --color-border: #374151;
    --color-border-dark: #45475a;
    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
}

body {
    font-family: 'JetBrains Mono', monospace;
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    overflow: hidden;
}

a:link,
a:visited {
    color: var(--color-text-primary);
    text-decoration: none;
}
label {
    margin-bottom: 10px;
}
/* ==========================================================================
   Component Styles
   ========================================================================== */

/* Terminal Components */
.terminal-header,
.terminal-footer {
    background-color: var(--color-bg-tertiary);
}

.terminal-header {
    border-bottom: 1px solid var(--color-border-dark);
}

.terminal-footer {
    border-top: 1px solid var(--color-border-dark);
}

/* Button Components */
.btn {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.15s ease-in-out;
    border: none;
    cursor: pointer;
}
.replay {
    cursor: pointer;
    color: var(--color-accent-blue);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--color-accent-blue);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--color-accent-blue-hover);
}

.btn-secondary {
    background-color: var(--color-border);
    color: var(--color-text-secondary);
}

.btn-secondary:hover:not(:disabled) {
    background-color: #4b5563;
}

/* Form Components */
.input-field {
    background-color: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    outline: none;
    color: var(--color-text-secondary);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.input-field:focus {
    box-shadow: 0 0 0 2px var(--color-accent-blue);
    border-color: transparent;
}

/* JSON validation states */
.input-field.valid {
    border-color: #22c55e !important;
    box-shadow: 0 0 0 1px #22c55e;
}

.input-field.invalid {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 1px #ef4444;
}

/* Chat Components */
.chat-message {
    padding: 0.75rem;
    border-radius: var(--radius-lg);
    margin-bottom: 0.75rem;
}

.chat-message p {
    margin: 0;
    line-height: 1.5;
}

.user-message {
    background-color: var(--color-border);
    text-align: right;
}

.bot-message {
    background-color: var(--color-bg-secondary);
}

/* Panel Components */
.config-panel {
    background-color: var(--color-bg-secondary);
    padding: 1rem;
    border-radius: var(--radius-lg);
}

.config-panel .relative {
    position: relative;
}

.config-panel .absolute {
    position: absolute;
    z-index: 20;
    min-width: 100%;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Task Configuration Components */
.task-config {
    transition: opacity 0.15s ease-in-out;
}

.task-config.hidden {
    display: none;
}

/* Button Group Components */
.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.btn-option {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background-color: var(--color-bg-secondary);
    color: var(--color-text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    text-align: center;
    min-width: fit-content;
}

.btn-option:hover {
    background-color: var(--color-border);
    border-color: var(--color-accent-blue);
}

.btn-option.active {
    background-color: var(--color-accent-blue);
    border-color: var(--color-accent-blue);
    color: white;
}

.btn-option.active:hover {
    background-color: var(--color-accent-blue-hover);
    border-color: var(--color-accent-blue-hover);
}

/* Schema Components */
.schema-option {
    transition: background-color 0.15s ease-in-out;
    font-size: 0.875rem;
    padding: 0.5rem;
    cursor: pointer;
}

/* ASCII Art */
.ascii-art {
    font-family: 'Courier New', Courier, monospace;
    white-space: pre;
    color: #89b4fa;
}

#title-ascii {
    width: 700px;
    margin: 0 auto;
}

/* Material Icons */
.material-icons {
    transition: transform 0.2s ease-in-out;
}

/* ==========================================================================
   Scrollbar Styles
   ========================================================================== */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: #585b70;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6c7086;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

/* Layout */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-grow { flex-grow: 1; }
.block { display: block; }
.relative { position: relative; }
.absolute { position: absolute; }
.hidden { display: none; }

/* Sizing */
.h-screen { height: 100vh; }
.h-full { height: 100%; }
.h-80 { height: 80%; }
.h-tall { height: 8rem; }
.h-2 { height: 0.5rem; }
.w-full { width: 100%; }
.w-90 { width: 90%; }
.w-1-3 { width: 33.333333%; }
.w-90px { width: 90px; }
.w-100 { width: 150px; }
.max-w-sm { max-width: 24rem; }

/* Spacing */
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.pb-2 { padding-bottom: 0.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-8 { margin-bottom: 2rem; }

.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-4 > * + * { margin-left: 1rem; }
.space-x-6 > * + * { margin-left: 1.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }

/* Typography */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-3xl { font-size: 1.875rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Colors */
.text-green-400 { color: #4ade80; }
.text-red-400 { color: #f87171; }
.text-blue-400 { color: #60a5fa; }
.text-yellow-400 { color: #fbbf24; }
.text-gray-200 { color: #e5e7eb; }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }

.bg-gray-700 { background-color: #374151; }
.bg-gray-800 { background-color: #1f2937; }
.bg-gray-850 { background-color: #1f2937; }
.bg-gray-900 { background-color: #111827; }
.bg-blue-400 { background-color: #60a5fa; }

/* Borders */
.border { border-width: 1px; }
.border-t { border-top-width: 1px; }
.border-b { border-bottom-width: 1px; }
.border-gray-600 { border-color: #4b5563; }
.border-gray-700 { border-color: #374151; }
.rounded { border-radius: var(--radius-sm); }
.rounded-lg { border-radius: var(--radius-lg); }

/* Positioning */
.z-10 { z-index: 10; }
.top-full { top: 100%; }
.left-0 { left: 0; }

/* Alignment */
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }

/* Overflow */
.overflow-y-auto { overflow-y: auto; }
.overflow-x-hidden { overflow-x: hidden; }

/* Interactive States */
.hover\:bg-gray-700:hover { background-color: #374151; }

.mt-4 td {
    padding: 8px;
    min-width: 50px;
    border:1px solid;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (min-width: 768px) {
    .md\:text-5xl {
        font-size: 3rem;
    }
}
