:root {
    --primary-color: #4a90e2;
    --primary-hover: #357abd;
    --secondary-color: #f5f5f5;
    --border-color: #e0e0e0;
    --text-color: #333;
    --text-muted: #666;
    --error-color: #ff5252;
    --success-color: #4caf50;
    --bg-color: #f9f9f9;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --radius: 8px;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
}

.main-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-header {
    background-color: var(--white);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 1rem 0;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    font-size: 24px;
    margin: 0;
    color: var(--primary-color);
    font-weight: 600;
}

.container {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.diagram-select {
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background-color: var(--white);
    font-size: 16px;
    min-width: 200px;
}

.editor-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    height: 600px;
}

.editor-pane {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.pane-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

textarea {
    flex: 1;
    width: 100%;
    box-sizing: border-box;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    background-color: #fafafa;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--white);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.pane-actions {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
}

button {
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
    flex: 2;
}

.primary-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.secondary-btn {
    background-color: var(--secondary-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    flex: 1;
}

.secondary-btn:hover {
    background-color: #e8e8e8;
}

.action-btn {
    width: 100%;
    background-color: var(--white);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.action-btn:hover {
    background-color: rgba(74, 144, 226, 0.05);
}

#errorMessage {
    display: none;
    margin-top: 1rem;
    padding: 12px;
    border-radius: var(--radius);
    background-color: #ffebee;
    color: var(--error-color);
    font-size: 14px;
    border-left: 4px solid var(--error-color);
}

.success-message {
    display: none;
    margin-top: 1rem;
    padding: 12px;
    border-radius: var(--radius);
    background-color: #e8f5e9;
    color: var(--success-color);
    font-size: 14px;
    text-align: center;
    border: 1px solid #c8e6c9;
}

.site-footer {
    background-color: var(--white);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    text-align: center;
    margin-top: auto;
}

.site-footer p {
    margin: 0;
    color: var(--text-muted);
}

.site-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

.lang-switcher select {
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background-color: var(--secondary-color);
    cursor: pointer;
    font-size: 13px;
}

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

    textarea {
        min-height: 300px;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}
