:root {
    --bg-color: #0f172a;
    --text-color: #e2e8f0;
    --accent-color: #818cf8;
    --accent-glow: rgba(129, 140, 248, 0.5);
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-main: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

.background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 15% 50%, rgba(76, 29, 149, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(14, 165, 233, 0.15), transparent 25%);
    z-index: -1;
}

.container {
    width: 100%;
    max-width: 900px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

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

h1 {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -0.05em;
    margin-bottom: 0.5rem;
}

.gradient-text {
    background: linear-gradient(135deg, #a5b4fc, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.1rem;
    color: #94a3b8;
    font-weight: 300;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.editor-container {
    display: flex;
    flex-direction: column;
    min-height: 500px;
}

.editor-header {
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
}

.dots {
    display: flex;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red {
    background-color: #ef4444;
}

.dot.yellow {
    background-color: #eab308;
}

.dot.green {
    background-color: #22c55e;
}

.status {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Header Controls */
.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.icon-button {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.icon-button:hover {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.1);
}

/* Settings Panel */
.settings-panel {
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid var(--glass-border);
    padding: 1.5rem;
    transition: all 0.3s ease;
    max-height: 200px;
    overflow: hidden;
}

.settings-panel.hidden {
    padding: 0 1.5rem;
    max-height: 0;
    border-bottom: none;
    opacity: 0;
}

.settings-panel h3 {
    margin-bottom: 1rem;
    font-size: 1rem;
    color: var(--accent-color);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-size: 0.85rem;
    color: #94a3b8;
}

.input-group input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    padding: 0.75rem;
    border-radius: 6px;
    color: var(--text-color);
    font-family: var(--font-mono);
    outline: none;
    transition: border-color 0.2s;
}

.input-group input:focus {
    border-color: var(--accent-color);
}

.hint {
    font-size: 0.75rem;
    color: #64748b;
}

.hint a {
    color: var(--accent-color);
    text-decoration: none;
}

.hint a:hover {
    text-decoration: underline;
}

/* Textarea Wrapper */
.textarea-wrapper {
    flex-grow: 1;
    position: relative;
    padding: 1.5rem;
    display: flex;
    /* Make the wrapper a flex container */
    flex-direction: column;
}

textarea {
    width: 100%;
    flex-grow: 1;
    /* Allow textarea to fill the wrapper */
    height: 100%;
    /* Ensure it takes height if flex fails in some browsers */
    background: transparent;
    border: none;
    color: var(--text-color);
    font-family: var(--font-mono);
    font-size: 1.1rem;
    line-height: 1.6;
    resize: none;
    outline: none;
}

textarea::placeholder {
    color: #475569;
}

.controls {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    /* changed from flex-end */
    align-items: center;
    background: rgba(0, 0, 0, 0.1);
}

.secondary-controls {
    display: flex;
    gap: 1rem;
}

.icon-button-text {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-main);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.icon-button-text:hover {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.05);
}

.glow-button {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-main);
    transition: all 0.2s ease;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

.glow-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 25px rgba(99, 102, 241, 0.5);
}

.glow-button:active {
    transform: translateY(1px);
}

.glow-button svg {
    transition: transform 0.5s ease;
}

.glow-button:hover svg {
    transform: rotate(180deg);
}

footer {
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
}

/* Animations */
@keyframes pulse {
    0% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.5;
    }
}

.loading .status {
    color: var(--accent-color);
    animation: pulse 1.5s infinite;
}