/* Custom CSS with Premium Aesthetics */
:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-family: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Accessibility */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Header */
.site-header {
    text-align: center;
    padding: 3rem 0 2rem;
}

.site-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 0.5rem;
}

.site-logo {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.site-header p {
    color: #94a3b8;
    font-size: 1.1rem;
}

/* Glassmorphism Panels */
.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #cbd5e1;
    font-size: 0.95rem;
}

textarea, select, input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 1rem;
    color: var(--text-color);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

textarea {
    resize: vertical;
}

select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

select option {
    background: var(--bg-color);
    color: var(--text-color);
}

textarea:focus, select:focus, input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* Dynamic Filters Layout */
.dynamic-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    animation: fadeIn 0.3s ease-in-out;
}

.dynamic-filters.hidden {
    display: none;
}

.half-width {
    flex: 1 1 calc(50% - 0.5rem);
    margin-bottom: 0;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Button */
.btn-primary {
    display: inline-block;
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    margin-top: 0.5rem;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Results Section */
.results-section h2 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
    color: #e2e8f0;
}

.content-box {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 1.5rem;
    min-height: 100px;
}

.hidden {
    display: none !important;
}

/* Markdown Rendering Styles */
.markdown-content {
    color: #e2e8f0;
}

.markdown-content h1, .markdown-content h2, .markdown-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #f8fafc;
}

.markdown-content p {
    margin-bottom: 1rem;
}

.markdown-content ul, .markdown-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.markdown-content li {
    margin-bottom: 0.5rem;
}

.markdown-content strong {
    color: #60a5fa;
    font-weight: 600;
}

.markdown-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin-left: 0;
    color: #94a3b8;
    background: rgba(255,255,255,0.05);
    padding: 1rem;
    border-radius: 4px;
}

/* Streaming Cursor */
.streaming-cursor {
    display: inline-block;
    width: 8px;
    height: 1.1em;
    background-color: var(--primary-color);
    animation: blink 1s step-end infinite;
    vertical-align: middle;
    margin-left: 4px;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.streaming-badge {
    display: inline-block;
    font-size: 0.8rem;
    color: #60a5fa;
    border: 1px solid rgba(96, 165, 250, 0.5);
    background: rgba(96, 165, 250, 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* Responsive */
@media (min-width: 640px) {
    .btn-primary {
        width: auto;
        padding: 0.75rem 2rem;
    }
}
@media (max-width: 639px) {
    .half-width {
        flex: 1 1 100%;
    }
    .glass-panel {
        padding: 1.5rem;
    }
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: auto;
    color: #94a3b8;
    font-size: 0.9rem;
    border-top: 1px solid var(--glass-border);
    margin-top: 3rem;
}
