:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-color: #f3f4f6;
    --panel-bg: #ffffff;
    --text-color: #1f2937;
    --border-color: #e5e7eb;
    --secondary-text: #6b7280;
    --success-color: #10b981;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 90vh;
}

/* Header */
.main-header {
    margin-bottom: 30px;
    text-align: center;
}

.header-top {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.lang-switcher select {
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--panel-bg);
    font-size: 14px;
    cursor: pointer;
}

h1 {
    font-size: 28px;
    color: #111827;
    font-weight: 700;
}

/* Main Content */
.main-content {
    flex: 1;
}

.controls-section {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.diagram-select {
    width: 100%;
    max-width: 300px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 16px;
    background-color: var(--panel-bg);
}

/* Grid Layout */
.converter-grid {
    display: grid;
    grid-template-columns: 1fr 60px 1fr;
    gap: 20px;
    align-items: start;
}

.panel {
    background: var(--panel-bg);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    height: 500px;
}

.panel-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-label {
    font-weight: 600;
    color: var(--secondary-text);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

textarea {
    flex: 1;
    width: 100%;
    padding: 16px;
    border: none;
    resize: none;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    outline: none;
    background: transparent;
}

textarea:focus {
    background-color: #f9fafb;
}

/* Buttons */
.action-panel {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding-top: 50px; /* Align with textareas visually */
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.primary-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.3);
}

.primary-btn:active {
    transform: translateY(0);
}

.secondary-btn {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-btn:hover {
    background: rgba(37, 99, 235, 0.1);
}

.text-btn {
    background: none;
    border: none;
    color: var(--secondary-text);
    cursor: pointer;
    font-size: 13px;
}

.text-btn:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Footer & Ads */
.ad-container {
    margin: 40px 0;
    min-height: 100px;
    text-align: center;
}

.main-footer {
    text-align: center;
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--secondary-text);
    font-size: 14px;
}

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

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

/* Responsive */
@media (max-width: 768px) {
    .converter-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .action-panel {
        height: auto;
        padding: 0;
    }
    
    .panel {
        height: 300px;
    }
    
    .primary-btn {
        width: 100%;
    }
}
