:root {
    --primary: #8b5cf6;
    /* Vibrant Purple */
    --primary-hover: #7c3aed;
    --secondary: #ec4899;
    /* Pink accent */
    --bg-color: #0f172a;
    /* Deep slate dark mode */
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.15);
    --input-bg: #0f172a;
    --output-bg: #1e293b;
    --font-family: 'Inter', sans-serif;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    --glow: 0 0 20px rgba(139, 92, 246, 0.4);
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    background-image:
        radial-gradient(circle at top left, rgba(139, 92, 246, 0.15), transparent 40%),
        radial-gradient(circle at bottom right, rgba(236, 72, 153, 0.1), transparent 40%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
}

@keyframes slideUpFade {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseBorder {
    0% {
        border-color: var(--border-color);
    }

    50% {
        border-color: var(--primary);
        box-shadow: var(--glow);
    }

    100% {
        border-color: var(--border-color);
    }
}

.app-container {
    max-width: 1000px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.app-header {
    text-align: center;
}

.app-header h1 {
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, #a855f7, #ec4899);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.app-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.transliteration-card {
    background-color: var(--card-bg);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    animation: slideUpFade 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@media (min-width: 900px) {
    .transliteration-card {
        flex-direction: row;
        align-items: stretch;
    }
}

.output-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border-color);
}

.input-section,
.output-section,
.translation-section {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (max-width: 899px) {
    .output-column {
        border-left: none;
        border-top: 1px solid var(--border-color);
    }
}

.input-section {
    background-color: var(--input-bg);
    flex: 1.2;
    /* Give input slightly more room */
}

.translation-section {
    border-top: 1px solid var(--border-color);
}

@media (max-width: 899px) {
    .output-column {
        border-left: none;
        border-top: 1px solid var(--border-color);
    }
}

.input-section {
    background-color: var(--input-bg);
    flex: 1.2;
    /* Give input slightly more room */
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge {
    background-color: rgba(148, 163, 184, 0.1);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid var(--border-color);
}

.badge.success {
    background-color: var(--success-bg);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.2);
}

.output-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: 100%;
}

textarea,
.output-text {
    width: 100%;
    min-height: 200px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    font-family: var(--font-family);
    font-size: 1.125rem;
    line-height: 1.6;
    resize: none;
    transition: all 0.3s ease;
    background-color: rgba(0, 0, 0, 0.2);
    color: var(--text-main);
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--glow);
    background-color: rgba(0, 0, 0, 0.4);
}

.output-text {
    background-color: var(--output-bg);
    border-color: transparent;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    flex-grow: 1;
}

.output-text:empty::before {
    content: attr(placeholder);
    color: #475569;
}

.actions {
    display: flex;
    justify-content: flex-end;
}

button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(139, 92, 246, 0.39);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}

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

.success-state {
    background-color: var(--success) !important;
    box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.39) !important;
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.2);
    transform: translateY(-2px);
}

.divider {
    display: none;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
}

@media (min-width: 768px) {
    .divider {
        width: 0;
        margin: 0 -20px;
    }
}

.arrow-icon {
    background-color: white;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    transform: rotate(90deg);
}

@media (min-width: 768px) {
    .arrow-icon {
        transform: rotate(0deg);
    }
}

.hidden {
    display: none !important;
}

.app-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}