/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 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 styles */
.header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.8s ease-out;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 2.5rem;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.header h1 {
    font-size: 3rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    margin: 0;
}

.subtitle {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.9);
    font-weight: 300;
    margin-top: 10px;
}

/* Main translator container */
.translator-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.translation-panel {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* Language selector */
.language-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.language-select {
    padding: 12px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    background: #fff;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

.language-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.language-select:hover {
    border-color: #667eea;
}

.swap-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.swap-btn:hover {
    transform: rotate(180deg) scale(1.1);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Text areas */
.text-areas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.input-area, .output-area {
    position: relative;
}

.input-area textarea {
    width: 100%;
    height: 200px;
    padding: 20px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s ease;
    background: #fff;
}

.input-area textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.output-area {
    background: #f8f9fa;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    min-height: 200px;
    position: relative;
}

.output-text {
    padding: 20px;
    min-height: 200px;
    font-size: 1rem;
    line-height: 1.6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder {
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 10px;
    font-style: italic;
}

.placeholder i {
    opacity: 0.5;
}

/* Controls */
.input-controls, .output-controls {
    position: absolute;
    bottom: 10px;
    right: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.char-count {
    font-size: 0.85rem;
    color: #6c757d;
}

.clear-btn, .copy-btn {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
}

.clear-btn:hover, .copy-btn:hover {
    background: #e9ecef;
    color: #495057;
}

/* Action buttons */
.action-buttons {
    display: flex;
    justify-content: center;
}

.translate-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: 12px;
    padding: 15px 40px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.translate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

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

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

/* Features section */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.feature {
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.feature:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.feature i {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 20px;
}

.feature h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.feature p {
    color: #6c757d;
    line-height: 1.6;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 0;
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    animation: fadeIn 0.8s ease-out 0.6s both;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    background: #fff;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.loading-spinner i {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 15px;
}

.loading-spinner p {
    font-size: 1.1rem;
    font-weight: 500;
    color: #333;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2.2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .translation-panel {
        padding: 25px;
    }
    
    .text-areas {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .language-selector {
        flex-direction: column;
        gap: 10px;
    }
    
    .language-select {
        min-width: 200px;
    }
    
    .features {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .feature {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .translation-panel {
        padding: 20px;
    }
    
    .input-area textarea {
        height: 150px;
    }
    
    .output-text {
        min-height: 150px;
    }
    
    .translate-btn {
        padding: 12px 30px;
        font-size: 1rem;
    }
}

/* Success and error states */
.success {
    border-color: #28a745 !important;
    background-color: #f8fff9 !important;
}

.error {
    border-color: #dc3545 !important;
    background-color: #fff8f8 !important;
}

.error-message {
    color: #dc3545;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 8px;
}

.success-message {
    color: #28a745;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 8px;
}