:root {
    --bg-color: #0b0f19;
    --panel-bg: rgba(20, 25, 40, 0.7);
    --text-color: #e2e8f0;
    --accent: #8b5cf6;
    --accent-glow: rgba(139, 92, 246, 0.5);
    --border-color: rgba(255, 255, 255, 0.1);
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(76, 29, 149, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(15, 23, 42, 0.2), transparent 25%);
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 5vh;
}

h1, h2, h3 {
    font-family: 'Cinzel', serif;
    font-weight: 600;
}

.container {
    width: 100%;
    max-width: 800px;
    padding: 2rem;
    z-index: 10;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

h1 {
    font-size: 3rem;
    margin: 0 0 0.5rem 0;
    background: linear-gradient(to right, #c4b5fd, #a78bfa, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

.subtitle {
    color: #94a3b8;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

section {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

details {
    color: #cbd5e1;
}

summary {
    cursor: pointer;
    font-weight: 600;
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    outline: none;
}

.api-warning {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-top: 1rem;
    line-height: 1.4;
}

input[type="password"], textarea {
    width: 100%;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

input[type="password"]:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}

textarea {
    min-height: 120px;
    resize: vertical;
    margin-top: 0.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-family: 'Cinzel', serif;
    color: #c4b5fd;
    font-size: 1.2rem;
}

.glowing-btn {
    width: 100%;
    margin-top: 1.5rem;
    padding: 1.2rem;
    font-size: 1.2rem;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    background: transparent;
    color: #fff;
    border: 2px solid var(--accent);
    border-radius: 8px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 0 15px var(--accent-glow) inset, 0 0 15px var(--accent-glow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.glowing-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #475569;
    box-shadow: none;
    color: #94a3b8;
}

.glowing-btn:not(:disabled):hover {
    background: rgba(139, 92, 246, 0.2);
    box-shadow: 0 0 30px var(--accent-glow) inset, 0 0 30px var(--accent-glow);
    text-shadow: 0 0 10px #fff;
}

/* Terminal output */
.output-container {
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 2rem;
    border: 1px solid #333;
}

.terminal-header {
    background: #1e1e1e;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #333;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}
.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.terminal-title {
    margin-left: 1rem;
    color: #888;
    font-size: 0.9rem;
    font-family: monospace;
}

.output {
    padding: 1.5rem;
    font-family: 'Inter', sans-serif;
    color: #e2e8f0;
    line-height: 1.8;
    white-space: pre-wrap;
    min-height: 150px;
    max-height: 500px;
    overflow-y: auto;
    font-size: 1.05rem;
    position: relative;
}

.output.typing::after {
    content: '▋';
    animation: blink 1s step-start infinite;
    color: var(--accent);
}

@keyframes blink {
    50% { opacity: 0; }
}

/* Loader */
.loader-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-color);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

.loader-content {
    text-align: center;
    font-family: 'Cinzel', serif;
    color: #c4b5fd;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(139, 92, 246, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent);
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto 1.5rem auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
