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

:root {
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    --success: #10b981;
    --danger: #ef4444;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --bg-light: #f9fafb;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-dark);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    font-size: 2.5rem;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-light);
    font-size: 1rem;
}

.controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    padding: 20px;
    background: var(--bg-light);
    border-radius: 12px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-group label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
}

select {
    padding: 10px 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
    min-width: 130px;
}

select:focus {
    outline: none;
    border-color: var(--primary);
}

.arrow {
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: bold;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--bg-gradient);
    color: white;
    padding: 12px 30px;
    font-size: 1.1rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 12px 20px;
}

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

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
    background: var(--primary);
    color: white;
}

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

.btn-small.success {
    background: var(--success);
}

.editor-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.editor-panel {
    display: flex;
    flex-direction: column;
    border: 2px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.panel-header {
    background: var(--bg-light);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--border);
}

.panel-header h3 {
    font-size: 1.1rem;
    color: var(--text-dark);
}

.panel-actions {
    display: flex;
    gap: 8px;
}

textarea {
    flex: 1;
    min-height: 400px;
    padding: 20px;
    border: none;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    background: #fafafa;
}

textarea:focus {
    outline: none;
    background: white;
}

textarea::placeholder {
    color: #9ca3af;
}

#outputCode {
    background: #f0fdf4;
}

.stats {
    padding: 10px 20px;
    background: var(--bg-light);
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-light);
}

.info-box {
    background: #eff6ff;
    border: 2px solid #3b82f6;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.info-box h3 {
    color: #1e40af;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.info-box ul {
    list-style: none;
    padding: 0;
}

.info-box li {
    padding: 6px 0;
    color: #1e40af;
    font-size: 0.95rem;
}

footer {
    text-align: center;
    margin-top: 20px;
    color: white;
    font-size: 0.9rem;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.success-message {
    animation: slideIn 0.3s ease-out;
}

/* Responsive */
@media (max-width: 1024px) {
    .editor-container {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 20px;
    }

    h1 {
        font-size: 2rem;
    }
}

@media (max-width: 640px) {
    .controls {
        flex-direction: column;
        gap: 12px;
    }

    .arrow {
        transform: rotate(90deg);
    }

    textarea {
        min-height: 300px;
        font-size: 12px;
    }

    .panel-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .panel-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

