:root {
    --bg: #f4f4f9;
    --card: #ffffff;
    --primary: #3b82f6;
    --text: #333;
    --text-muted: #666;
    --border: #e2e8f0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

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

header h1 { margin: 0 0 10px 0; }
header p { margin: 0; color: var(--text-muted); }

.control-panel {
    background: var(--card);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.input-group {
    display: flex;
    gap: 10px;
}

input, select, button {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 16px;
}

input { flex: 2; }
select { flex: 1; }
button { 
    background: var(--primary); 
    color: white; 
    border: none; 
    cursor: pointer; 
    font-weight: bold;
    transition: background 0.2s;
}
button:hover { background: #2563eb; }
button:disabled { background: #93c5fd; cursor: wait; }

.output-window {
    background: #1e293b;
    color: #a5b4fc;
    padding: 0;
    border-radius: 8px;
    height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.status-bar {
    background: #0f172a;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #334155;
    position: sticky;
    top: 0;
}

.loader {
    width: 16px;
    height: 16px;
    border: 2px solid #a5b4fc;
    border-bottom-color: transparent;
    border-radius: 50%;
    display: none;
    animation: spin 1s linear infinite;
}

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

pre {
    margin: 0;
    padding: 15px;
    white-space: pre-wrap;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    line-height: 1.5;
}

.saved-area {
    background: var(--card);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: opacity 0.3s, transform 0.3s;
}

.saved-area.hidden {
    display: none;
    opacity: 0;
    transform: translateY(20px);
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.file-name { font-weight: 500; }
.file-actions button {
    padding: 6px 12px;
    font-size: 14px;
    background: white;
    color: var(--text);
}
.file-actions button:hover { background: #f1f5f9; }

.actions { display: flex; gap: 10px; }
.btn.secondary { background: #64748b; }
.btn.danger { background: #ef4444; }

@media (max-width: 600px) {
    .input-group { flex-direction: column; }
}