:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg: #f3f4f6;
    --surface: #ffffff;
    --text: #1f2937;
    --border: #e5e7eb;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 2rem;
}

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

h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

/* Main Layout */
.converter-container {
    display: flex;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    flex: 1;
    width: 100%;
}

/* Flex Columns */
.text-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid var(--border);
}

.column-header {
    padding: 1rem;
    background: #f9fafb;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: #6b7280;
}

textarea {
    flex: 1;
    width: 100%;
    border: none;
    resize: none;
    padding: 1rem;
    font-size: 1rem;
    line-height: 1.5;
    outline: none;
    min-height: 300px; /* Default height */
}

/* The Control Panel (Middle) */
.controls {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    justify-content: center;
    min-width: 180px;
}

button {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
    color: var(--text);
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

button:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #eef2ff;
}

button.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Utility buttons (Copy/Clear) */
.utility-btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: white;
    cursor: pointer;
}
.utility-btn:hover {
    background: #f3f4f6;
}

/* Responsive Design */
@media (max-width: 850px) {
    .converter-container {
        flex-direction: column;
    }
    
    .controls {
        flex-direction: row;
        flex-wrap: wrap;
        width: 100%;
    }
    
    button {
        flex: 1 1 120px; /* Grow, shrink, basis */
        text-align: center;
        justify-content: center;
    }
    
    textarea {
        min-height: 150px;
    }
}