/* Modern Translation Website Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

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

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
}

.main {
    display: grid;
    gap: 30px;
    grid-template-columns: 1fr;
}

.translation-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.language-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.language-dropdown {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

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

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

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

.language-dropdown span {
    font-weight: 600;
    color: #667eea;
    font-size: 1.1rem;
}

.swap-button {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.swap-button:hover {
    background: #5a6fd8;
    transform: rotate(180deg);
}

.translation-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.text-area-container {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

textarea {
    width: 100%;
    height: 200px;
    padding: 20px;
    border: 2px solid #e1e5e9;
    border-radius: 15px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    transition: all 0.3s ease;
    line-height: 1.6;
}

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

textarea::placeholder {
    color: #999;
    font-style: italic;
}

.text-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5px;
}

.copy-btn {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.char-count {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #667eea;
    font-weight: 500;
}

.spinner {
    width: 20px;
    height: 20px;
    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); }
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

.translate-btn, .clear-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.translate-btn {
    background: #667eea;
    color: white;
}

.translate-btn:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.clear-btn {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #e1e5e9;
}

.clear-btn:hover {
    background: #e9ecef;
    color: #333;
}

.error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c00;
    padding: 15px;
    border-radius: 12px;
    margin-top: 20px;
}

.history-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f1f3f4;
}

.history-header h2 {
    color: #333;
    font-size: 1.5rem;
    font-weight: 600;
}

.clear-history-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-history-btn:hover {
    background: #c82333;
}

.history-content {
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    border: 1px solid #f1f3f4;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.history-item:hover {
    background: #f8f9fa;
    border-color: #e1e5e9;
}

.history-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.history-direction {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 500;
}

.history-time {
    color: #666;
    font-size: 0.8rem;
}

.history-content .history-source {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-weight: 500;
}

.history-content .history-target {
    background: #e7f3ff;
    padding: 10px;
    border-radius: 8px;
    color: #0066cc;
    font-weight: 500;
}

.footer {
    text-align: center;
    margin-top: 40px;
    color: white;
    font-size: 0.9rem;
    opacity: 0.8;
}

.footer p {
    margin-bottom: 10px;
}

.footer a {
    color: white;
    text-decoration: underline;
}

.footer a:hover {
    opacity: 0.8;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2.5rem;
    }
    
    .translation-section {
        padding: 20px;
    }
    
    .language-selector {
        flex-direction: row;
        gap: 10px;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
    }
    
    .language-dropdown {
        flex: 1;
        min-width: 0;
    }
    
    .language-dropdown select {
        width: 100%;
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .language-dropdown span {
        font-size: 1rem;
        text-align: center;
    }
    
    .swap-button {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        flex-shrink: 0;
    }
    
    .translation-area {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 20px;
    }
    
    textarea {
        height: 120px;
        padding: 15px;
        font-size: 0.95rem;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 15px;
    }
    
    .translate-btn, .clear-btn {
        width: 100%;
        padding: 12px;
    }
    
    .history-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .clear-history-btn {
        align-self: flex-end;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .translation-section, .history-section {
        padding: 15px;
    }
    
    textarea {
        height: 150px;
        padding: 15px;
    }
    
    .text-controls {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
}