:root {
    --bg-dark: #0f172a;
    --card-bg: #1e293b;
    --accent: #3b82f6;
    --text-main: #f1f5f9;
    --text-dim: #94a3b8;
    --success: #4ade80;
    --border: #334155;
}

body {
    font-family: 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    margin: 0;
    padding: 10px; /* Reduced for mobile */
    line-height: 1.6;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 10px;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

header h1 {
    font-size: 1.8rem; /* Scalable title */
}

/* Controls Section - Now wraps on mobile */
.controls {
    display: flex;
    flex-wrap: wrap; /* Allows items to drop to next line */
    gap: 10px;
    background: var(--card-bg);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 25px;
    align-items: center;
    border: 1px solid var(--border);
}

.divider-icon {
    color: var(--text-dim);
}

select {
    flex: 1; /* Selects grow to fill space */
    min-width: 120px;
    padding: 10px;
    background: #0f172a;
    color: white;
    border: 1px solid var(--border);
    border-radius: 8px;
}

#translateBtn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: bold;
    flex-basis: 100%; /* Button takes full width on small screens */
    order: 4; /* Moves button to bottom of controls on mobile */
    cursor: pointer;
}

/* Editor Grid - Critical for Responsiveness */
.editor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Desktop default */
    gap: 20px;
}

.editor-container {
    background: var(--card-bg);
    padding: 15px;
    border-radius: 15px;
    border: 1px solid var(--border);
}

textarea {
    width: 100%;
    height: 300px; /* Adjusted height */
    background: #020617;
    color: var(--success);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    resize: none;
    box-sizing: border-box;
}

/* Console Section */
.system-report {
    margin-top: 20px;
    background: #020617;
    border-radius: 12px;
    padding: 15px;
    border: 1px solid var(--border);
}

/* --- MEDIA QUERIES (The Magic) --- */

/* For Tablets (Screens smaller than 900px) */
@media (max-width: 900px) {
    .editor-grid {
        grid-template-columns: 1fr; /* Stack editors vertically */
    }
    
    textarea {
        height: 250px; /* Slightly shorter for smaller screens */
    }
}

/* For Mobile Phones (Screens smaller than 600px) */
@media (max-width: 600px) {
    body {
        padding: 5px;
    }

    .controls {
        flex-direction: column; /* Stack all controls vertically */
        align-items: stretch;
    }

    .divider-icon {
        display: none; /* Hide arrow on mobile to save space */
    }

    header h1 {
        font-size: 1.5rem;
    }
    
    #translateBtn {
        font-size: 16px;
        padding: 15px;
    }
}