:root {
    --primary-color: #00f2ea;
    --primary-dark: #00d4cc;
    --primary-light: #33f5ee;
    --secondary-color: #fe2c55;
    --bg-color: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --text-color: #ffffff;
    --text-light: #a8a8a8;
    --text-secondary: #666666;
    --card-bg: #161616;
    --border-color: #2a2a2a;
    --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);
    --gradient-primary: linear-gradient(135deg, #00f2ea 0%, #69eaff 100%);
    --gradient-secondary: linear-gradient(135deg, #fe2c55 0%, #ff6b6b 100%);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 400px;
    background: radial-gradient(ellipse at top, rgba(0, 242, 234, 0.15), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.header {
    background: rgba(22, 22, 22, 0.95);
    border-bottom: 1px solid var(--border-color);
    color: white;
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.header h1 {
    font-size: 28px;
    font-weight: 800;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header h1 i {
    font-size: 32px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header p {
    font-size: 14px;
    margin: 6px 0 0 0;
    color: var(--text-light);
    font-weight: 500;
}

.header-nav {
    position: absolute;
    top: 18px;
    right: 24px;
    z-index: 100;
}

.hamburger-menu {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 10px 12px;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hamburger-menu:hover {
    background: rgba(0, 242, 234, 0.2);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.nav-menu {
    position: absolute;
    top: 55px;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 6px 0;
    min-width: 180px;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-menu.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.nav-menu a {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
}

.nav-menu a:hover {
    background: rgba(0, 242, 234, 0.1);
    color: var(--primary-color);
    padding-left: 22px;
}

.nav-menu a i {
    margin-right: 10px;
    width: 18px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 80px;
    position: relative;
    z-index: 1;
}

.translate-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 40px;
    border-radius: 24px;
    box-shadow: var(--shadow-md);
    margin: 40px 0;
    position: relative;
    overflow: hidden;
}

.translate-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(0, 242, 234, 0.1), transparent 70%);
    pointer-events: none;
}

.translate-container {
    max-width: 100%;
    margin: 0 auto;
    position: relative;
}

.language-selector {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
    align-items: center;
}

.language-box {
    flex: 1;
}

.language-box label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-light);
}

.language-box label i {
    color: var(--primary-color);
}

.language-box select {
    width: 100%;
    padding: 16px 18px;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    font-size: 15px;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-secondary);
    color: var(--text-color);
    font-weight: 500;
    cursor: pointer;
}

.language-box select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.language-box select:not(:disabled):hover {
    border-color: var(--primary-color);
}

.language-box select:focus {
    border-color: var(--primary-color);
    background: rgba(0, 242, 234, 0.05);
    box-shadow: 0 0 0 4px rgba(0, 242, 234, 0.1);
}

.swap-btn {
    background: var(--gradient-primary);
    border: none;
    color: white;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 15px rgba(0, 242, 234, 0.3);
    margin-top: 30px;
}

.swap-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.swap-btn:not(:disabled):hover {
    transform: rotate(180deg) scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 242, 234, 0.4);
}

.swap-btn:not(:disabled):active {
    transform: rotate(180deg) scale(1);
}

.text-areas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.text-box {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 18px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.text-box:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 242, 234, 0.1);
}

.text-header {
    background: linear-gradient(135deg, rgba(0, 242, 234, 0.05) 0%, rgba(0, 0, 0, 0) 100%);
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.text-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.text-label i {
    color: var(--primary-color);
}

.text-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.action-btn:hover {
    background: rgba(0, 242, 234, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.action-btn.copied {
    background: rgba(0, 242, 234, 0.2);
    color: var(--primary-color);
}

.char-count {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.text-box textarea {
    width: 100%;
    min-height: 300px;
    padding: 20px;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-color);
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    line-height: 1.8;
}

.text-box textarea::placeholder {
    color: var(--text-secondary);
}

.result-box {
    position: relative;
}

.result-content {
    position: relative;
}

.loader-inline {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    text-align: center;
}

.loader-inline.active {
    display: block;
}

.loader-spinner-small {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 12px;
}

.loader-inline p {
    color: var(--text-light);
    font-size: 14px;
    font-weight: 600;
}

.translate-actions {
    text-align: center;
}

.translate-btn {
    padding: 18px 48px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(0, 242, 234, 0.3);
}

.translate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 30px rgba(0, 242, 234, 0.4);
}

.translate-btn:active {
    transform: translateY(-1px);
}

.translate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.error-message {
    background: var(--card-bg);
    border: 2px solid rgba(254, 44, 85, 0.3);
    border-radius: 20px;
    padding: 60px 30px;
    text-align: center;
    margin: 40px 0;
    display: none;
    box-shadow: var(--shadow-md);
}

.error-message.active {
    display: block;
    animation: slideUp 0.4s ease;
}

.error-message i {
    font-size: 64px;
    color: var(--secondary-color);
    margin-bottom: 20px;
}

.error-message h3 {
    color: var(--secondary-color);
    font-size: 26px;
    margin-bottom: 12px;
    font-weight: 700;
}

.error-message p {
    color: var(--text-light);
    font-size: 16px;
}

.features-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 60px 40px;
    border-radius: 24px;
    box-shadow: var(--shadow-md);
    margin-bottom: 40px;
}

.features-section h2 {
    text-align: center;
    font-size: 32px;
    margin-bottom: 48px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.feature-card {
    text-align: center;
    padding: 36px 24px;
    border-radius: 18px;
    transition: opacity 0.6s ease, transform 0.6s ease;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    opacity: 0;
    transform: translateY(30px);
}

.feature-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.feature-card:hover {
    background: rgba(0, 242, 234, 0.05);
    border-color: var(--primary-color);
    transform: translateY(-6px);
    box-shadow: 0 8px 30px rgba(0, 242, 234, 0.15);
}

.feature-card i {
    font-size: 52px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 18px;
}

.feature-card h3 {
    font-size: 19px;
    margin-bottom: 10px;
    font-weight: 700;
}

.feature-card p {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.6;
}

.how-to-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 60px 40px;
    border-radius: 24px;
    box-shadow: var(--shadow-md);
}

.how-to-section h2 {
    text-align: center;
    font-size: 32px;
    margin-bottom: 48px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.steps-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.step-card {
    text-align: center;
    padding: 36px 28px;
    border-radius: 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    transition: opacity 0.6s ease, transform 0.6s ease;
    opacity: 0;
    transform: translateY(30px);
}

.step-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.step-card:hover {
    background: rgba(0, 242, 234, 0.05);
    border-color: var(--primary-color);
    transform: translateY(-6px);
    box-shadow: 0 8px 30px rgba(0, 242, 234, 0.15);
}

.step-number {
    width: 70px;
    height: 70px;
    margin: 0 auto 24px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 800;
    box-shadow: 0 6px 25px rgba(0, 242, 234, 0.4);
}

.step-card h3 {
    font-size: 21px;
    margin-bottom: 14px;
    font-weight: 700;
}

.step-card p {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.7;
}

footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    color: var(--text-light);
    padding: 40px 0;
    text-align: center;
}

.footer-content p {
    font-size: 14px;
    margin-bottom: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1024px) {
    .features-grid,
    .steps-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
    
    .text-areas {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 18px 0;
    }

    .header h1 {
        font-size: 24px;
    }

    .header h1 i {
        font-size: 28px;
    }

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

    .header-nav {
        top: 16px;
        right: 20px;
    }

    .translate-section {
        padding: 32px 24px;
        margin: 30px 0;
    }

    .language-selector {
        flex-direction: column;
        gap: 20px;
    }

    .swap-btn {
        width: 48px;
        height: 48px;
        margin-top: 0;
        transform: rotate(90deg);
    }

    .swap-btn:not(:disabled):hover {
        transform: rotate(270deg) scale(1.1);
    }

    .text-areas {
        gap: 20px;
    }

    .features-section,
    .how-to-section {
        padding: 48px 28px;
    }

    .features-section h2,
    .how-to-section h2 {
        font-size: 28px;
        margin-bottom: 40px;
    }

    .features-grid,
    .steps-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px 60px;
    }

    .header h1 {
        font-size: 20px;
    }

    .header h1 i {
        font-size: 24px;
    }

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

    .translate-section {
        padding: 28px 20px;
        border-radius: 20px;
    }

    .translate-btn {
        padding: 16px 36px;
        font-size: 15px;
    }

    .features-section h2,
    .how-to-section h2 {
        font-size: 24px;
    }

    .features-section,
    .how-to-section {
        padding: 40px 20px;
    }

    .feature-card,
    .step-card {
        padding: 28px 20px;
    }

    .step-number {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }

    .text-box textarea {
        min-height: 250px;
    }
}
