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

:root {
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    color: #f8fafc;
    background: #070b16;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(
            circle at 15% 15%,
            rgba(99, 102, 241, 0.18),
            transparent 32%
        ),
        radial-gradient(
            circle at 85% 80%,
            rgba(168, 85, 247, 0.16),
            transparent 35%
        ),
        #070b16;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px 18px;
    overflow-x: hidden;
}

.background-glow {
    position: fixed;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: rgba(79, 70, 229, 0.08);
    filter: blur(100px);
    pointer-events: none;
}

.app {
    width: 100%;
    max-width: 1100px;
    position: relative;
    z-index: 1;
}

.header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 25px;
}

.logo {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: linear-gradient(
        135deg,
        #4f46e5,
        #9333ea
    );
    font-size: 32px;
    box-shadow:
        0 15px 40px rgba(79, 70, 229, 0.3);
}

h1 {
    font-size: clamp(28px, 5vw, 42px);
    line-height: 1.1;
    letter-spacing: -1.5px;
}

.header p {
    color: #94a3b8;
    margin-top: 7px;
    font-size: 15px;
}

.translator-card {
    padding: 25px;
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 25px;
    background: rgba(15, 23, 42, 0.82);
    backdrop-filter: blur(20px);
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.35);
}

.language-bar {
    display: grid;
    grid-template-columns: 1fr 60px 1fr;
    align-items: end;
    gap: 15px;
    margin-bottom: 20px;
}

.language-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.language-box label {
    color: #94a3b8;
    font-size: 13px;
    font-weight: 600;
}

select {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid #334155;
    outline: none;
    color: #f8fafc;
    background: #111827;
    font-size: 15px;
    cursor: pointer;
}

select:focus {
    border-color: #818cf8;
    box-shadow:
        0 0 0 3px rgba(99, 102, 241, 0.15);
}

.swap-btn {
    width: 50px;
    height: 48px;
    border-radius: 12px;
    border: 1px solid #334155;
    color: white;
    background: #1e293b;
    font-size: 25px;
    cursor: pointer;
    transition: 0.2s;
}

.swap-btn:hover {
    background: #312e81;
    transform: rotate(180deg);
}

.text-area-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.text-panel {
    min-width: 0;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid #334155;
    background: #0b1120;
}

.output-panel {
    background: #0f172a;
}

.panel-title {
    height: 48px;
    padding: 0 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #1e293b;
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 600;
}

textarea {
    width: 100%;
    height: 270px;
    display: block;
    padding: 18px;
    resize: vertical;
    outline: none;
    border: none;
    color: #f8fafc;
    background: transparent;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.7;
}

textarea::placeholder {
    color: #64748b;
}

textarea:focus {
    background: rgba(30, 41, 59, 0.25);
}

.character-count {
    padding: 0 15px 12px;
    color: #64748b;
    font-size: 11px;
}

.small-btn {
    padding: 6px 10px;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #cbd5e1;
    background: #111827;
    cursor: pointer;
    font-size: 12px;
}

.small-btn:hover {
    color: white;
    background: #1e293b;
}

.translate-btn {
    width: 100%;
    height: 54px;
    margin-top: 20px;
    border: 0;
    border-radius: 14px;
    color: white;
    background:
        linear-gradient(
            135deg,
            #4f46e5,
            #7c3aed
        );
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow:
        0 12px 30px rgba(79, 70, 229, 0.25);
    transition:
        transform 0.2s,
        box-shadow 0.2s,
        opacity 0.2s;
}

.translate-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 16px 40px rgba(79, 70, 229, 0.35);
}

.translate-btn:disabled {
    opacity: 0.65;
    cursor: wait;
    transform: none;
}

.status {
    text-align: center;
    min-height: 22px;
    margin-top: 13px;
    color: #94a3b8;
    font-size: 13px;
}

footer {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
    color: #64748b;
    font-size: 12px;
}

footer strong {
    color: #a5b4fc;
}

@media (max-width: 760px) {
    body {
        padding: 18px 12px;
        align-items: flex-start;
    }

    .header {
        margin-top: 10px;
    }

    .translator-card {
        padding: 16px;
        border-radius: 20px;
    }

    .language-bar {
        grid-template-columns: 1fr 48px 1fr;
        gap: 8px;
    }

    .swap-btn {
        width: 48px;
    }

    .text-area-container {
        grid-template-columns: 1fr;
    }

    textarea {
        height: 220px;
    }
}

@media (max-width: 480px) {
    .logo {
        width: 52px;
        height: 52px;
        font-size: 26px;
        border-radius: 15px;
    }

    h1 {
        font-size: 25px;
    }

    .header p {
        font-size: 12px;
    }

    .language-bar {
        grid-template-columns: 1fr;
    }

    .swap-btn {
        width: 100%;
        height: 40px;
    }
}