:root {
    --primary-color: #4a90e2;
    --background-color: #f4f7f6;
    --text-color: #333;
    --container-bg: #ffffff;
    --border-color: #d1d5da;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
    box-sizing: border-box;
}

.translator-container {
    width: 100%;
    max-width: 900px;
    background-color: var(--container-bg);
    border-radius: 12px;
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

h1 {
    text-align: center;
    color: var(--primary-color);
    padding: 1.5rem 1rem;
    margin: 0;
    font-size: 1.8rem;
    background-color: #e9eff8;
    letter-spacing: 1px;
}

.main-content {
    padding: 1.5rem;
}

.io-container {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.textarea-container {
    flex: 1;
    position: relative;
}

textarea {
    width: 100%;
    height: 200px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1.05rem;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

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

#translated-text {
    background-color: #f9f9f9;
}

.controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.language-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

label {
    font-weight: 500;
}

select, button {
    font-family: inherit;
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

select {
    border: 1px solid var(--border-color);
}

#translate-btn {
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
    border: none;
    min-width: 150px;
}

#translate-btn:hover {
    filter: brightness(1.1);
}

#translate-btn:active {
    filter: brightness(0.9);
}

#listen-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background-color: transparent;
    border: none;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
}

#listen-btn:hover {
    background-color: #e0e0e0;
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    font-size: 28px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .io-container {
        flex-direction: column;
        gap: 1rem;
    }

    textarea {
        height: 150px;
    }
}

@media (max-width: 600px) {
    body {
        padding: 0;
        align-items: flex-start;
    }

    .translator-container {
        border-radius: 0;
        min-height: 100vh;
    }

    .main-content {
        padding: 1rem;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    select, button {
        width: 100%;
    }
}
