* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

header h1 i {
    margin-right: 15px;
    color: #ffd700;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.translator-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    flex: 1;
    margin-bottom: 20px;
}

.language-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.language-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.language-group label {
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
}

select {
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.swap-btn {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    margin-top: 20px;
}

.swap-btn:hover {
    background: #5a6fd8;
    transform: rotate(180deg);
}

.text-areas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.input-section, .output-section {
    display: flex;
    flex-direction: column;
}

.text-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.section-title {
    font-weight: 600;
    color: #555;
    font-size: 1rem;
}

.clear-btn, .copy-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.clear-btn:hover, .copy-btn:hover {
    color: #667eea;
    background: #f8f9fa;
}

textarea {
    width: 100%;
    height: 200px;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    resize: none;
    transition: all 0.3s ease;
    background: #fafbfc;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: white;
}

textarea::placeholder {
    color: #aab0b5;
}

#output-text {
    background: #f8f9fa;
    color: #333;
}

.char-count {
    text-align: right;
    font-size: 0.85rem;
    color: #999;
    margin-top: 5px;
}

.translation-info {
    text-align: left;
    font-size: 0.85rem;
    color: #999;
    margin-top: 5px;
    min-height: 20px;
}

.action-buttons {
    text-align: center;
}

.translate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.translate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.translate-btn:active {
    transform: translateY(0);
}

.translate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.translate-btn i {
    margin-right: 8px;
}

footer {
    text-align: center;
    color: white;
    opacity: 0.8;
    font-size: 0.9rem;
    margin-top: 20px;
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background: #28a745;
}

.toast.error {
    background: #dc3545;
}

/* Loading animation */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .translator-container {
        padding: 20px;
    }
    
    .language-selector {
        flex-direction: column;
        gap: 15px;
    }
    
    .swap-btn {
        margin-top: 0;
        transform: rotate(90deg);
    }
    
    .swap-btn:hover {
        transform: rotate(270deg);
    }
    
    .text-areas {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    textarea {
        height: 150px;
    }
    
    select {
        min-width: 200px;
    }
    
    .translate-btn {
        padding: 12px 30px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .translator-container {
        padding: 15px;
    }
    
    select {
        min-width: 180px;
    }
    
    .translate-btn {
        padding: 10px 25px;
        font-size: 0.95rem;
    }
}

/* Scoped login page styles (matches existing login.html markup) */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 40px);
    padding-top: 20px;
    padding-bottom: 20px;
}

.login-box {
    width: 100%;
    max-width: 420px;
    background: rgba(255,255,255,0.98);
    border-radius: 14px;
    padding: 28px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.12);
    color: #222;
}

.login-box header {
    text-align: left;
    margin-bottom: 12px;
}

.login-box label {
    display: block;
    font-weight: 600;
    margin-top: 12px;
    margin-bottom: 6px;
    color: #444;
}

.login-box input[type="text"],
.login-box input[type="password"],
.login-box input[type="email"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e6e9ee;
    border-radius: 10px;
    background: #fbfdff;
    font-size: 1rem;
    color: #222;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.login-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 6px 20px rgba(102,126,234,0.12);
}

.login-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 16px;
}

.link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    background: transparent;
    border-radius: 8px;
    color: #667eea;
    text-decoration: none;
    border: 1px solid transparent;
}

.link-btn:hover {
    background: #f4f6ff;
    border-color: #e6e9ee;
}

.login-box .translate-btn {
    flex: 1 1 auto;
    padding: 10px 18px;
    border-radius: 8px;
    background: linear-gradient(90deg, #6b8cff 0%, #9b63ff 100%);
    color: #fff;
    border: none;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(107,140,255,0.18);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.login-box .translate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(107,140,255,0.22);
}

@media (max-width: 480px) {
    .login-box { padding: 18px; }
    .login-box header h1 { font-size: 1.4rem; }
    .login-actions { flex-direction: column; gap: 10px; }
    .login-actions .link-btn { width: 100%; text-align: center; }
}