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

:root {
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --bg: #F8FAFC;
    --card: #FFFFFF;
    --text: #0F172A;
    --muted: #475569;
    --success: #10B981;
    --error: #EF4444;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background: var(--bg);
    color: var(--text);
    direction: rtl;
}

body.english {
    direction: ltr;
    font-family: 'Inter', sans-serif;
}

.page-background {
    min-height: 100vh;
    padding: 24px;
}

.container {
    max-width: 1100px;
    margin: auto;
}

.header {
    text-align: center;
    margin-bottom: 48px;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
}

.language-toggle {
    display: flex;
    justify-content: center;
    margin-bottom: 32px;
}

.toggle-container {
    background: #DBEAFE;
    border-radius: 40px;
    padding: 6px;
    display: flex;
}

.toggle-btn {
    border: none;
    background: transparent;
    padding: 10px 20px;
    cursor: pointer;
    font-weight: 600;
}

.toggle-btn.active {
    background: #fff;
    border-radius: 30px;
}

.converter-card {
    background: var(--card);
    border-radius: 20px;
    padding: 32px;
}

.input-field,
.output-field {
    width: 100%;
    min-height: 160px;
    padding: 16px;
    font-size: 1.1rem;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
}

.output-field {
    font-family: monospace;
    font-size: 1.4rem;
}

.control-bar {
    display: flex;
    justify-content: center;
    margin: 24px 0;
}

.control-buttons {
    display: flex;
    gap: 12px;
}

.control-btn {
    width: 56px;
    height: 56px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
}

.control-btn.playing {
    background: var(--error);
}

.play-icon { display: block; }
.stop-icon { display: none; }

.control-btn.playing .play-icon { display: none; }
.control-btn.playing .stop-icon { display: block; }

.reference-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.reference-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
}

.toast {
    position: fixed;
    bottom: 20px;
    padding: 12px 20px;
    border-radius: 10px;
    background: var(--success);
    color: white;
    opacity: 0;
    transition: .3s;
}

.toast.show {
    opacity: 1;
}

body[dir="rtl"] .toast { left: 20px; }
body[dir="ltr"] .toast { right: 20px; }
