:root {
    --primary: #4e54c8;
    --secondary: #8f94fb;
    --accent: #ff7e5f;
    --light: #f8f9fa;
    --dark: #343a40;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.card {
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border: none;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card-header {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    color: white;
    padding: 20px;
    font-weight: 600;
}

.progress {
    height: 10px;
    border-radius: 5px;
    margin: 15px 0;
}

.settings-panel {
    background-color: rgba(248, 249, 250, 0.7);
    border-radius: 10px;
    padding: 15px;
    margin-top: 20px;
}

.btn-primary {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    border: none;
    padding: 10px 20px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(to right, var(--secondary), var(--primary));
    transform: scale(1.05);
}

.btn-download {
    background: linear-gradient(to right, #00b09b, #96c93d);
    color: white;
}

.btn-download:hover {
    background: linear-gradient(to right, #96c93d, #00b09b);
}

.result-container {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    max-height: 300px;
    overflow-y: auto;
    font-family: 'Noto Sans Sinhala', sans-serif;
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 15px;
}

.feature-card {
    text-align: center;
    padding: 20px;
    height: 100%;
}

.language-badge {
    background: linear-gradient(to right, #ff7e5f, #feb47b);
    color: white;
    font-size: 0.9rem;
    padding: 5px 12px;
    border-radius: 20px;
}

footer {
    text-align: center;
    margin-top: 30px;
    color: var(--dark);
    font-size: 0.9rem;
}

.step {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
}

.step-number {
    background: var(--primary);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-weight: bold;
}

.preview-text {
    font-family: 'Noto Sans Sinhala', sans-serif;
    font-size: 1.1rem;
    padding: 10px;
    border-left: 3px solid var(--accent);
    background-color: rgba(255, 255, 255, 0.5);
    margin-top: 15px;
}

.sinhala-text {
    font-family: 'Noto Sans Sinhala', sans-serif;
    font-size: 1.2rem;
    line-height: 1.6;
}

.file-info {
    background: rgba(255, 255, 255, 0.7);
    padding: 10px;
    border-radius: 8px;
    margin-top: 10px;
}

.translation-item {
    padding: 8px;
    border-bottom: 1px dashed #ddd;
}

.translation-item:last-child {
    border-bottom: none;
}

.original-text {
    color: #666;
    font-size: 0.9rem;
}

.translated-text {
    font-weight: 500;
}

.upload-area {
    border: 2px dashed #8f94fb;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: #4e54c8;
}

.upload-icon {
    font-size: 3rem;
    color: #4e54c8;
    margin-bottom: 15px;
}

.status-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
}

.rate-limit-warning {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 10px;
    margin-top: 15px;
    font-size: 0.9rem;
}

/* Language selector styles */
.language-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    background: rgba(255,255,255,0.2);
    padding: 12px;
    border-radius: 10px;
}

.language-flag {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.language-label {
    font-weight: 600;
    color: white;
    min-width: 80px;
}

.language-arrow {
    color: white;
    font-size: 1.2rem;
}

.language-select {
    flex: 1;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-weight: 500;
}

/* New UI Improvements */
.language-flag-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-preview {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    max-height: 150px;
    overflow-y: auto;
    font-size: 0.9rem;
    border: 1px solid #eee;
}

.file-preview-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: 500;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.clear-btn {
    background: linear-gradient(to right, #ff7e5f, #feb47b);
    color: white;
    border: none;
}

.language-card {
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    background: rgba(255,255,255,0.7);
}

.language-card h5 {
    margin-bottom: 15px;
    color: var(--primary);
}

.language-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.lang-option {
    padding: 10px;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    border: 2px solid transparent;
}

.lang-option:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-color: var(--primary);
}

.lang-option.selected {
    background: #eef2ff;
    border-color: var(--primary);
}

.lang-flag {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.lang-name {
    font-size: 0.85rem;
    margin-top: 3px;
}

.preview-item {
    padding: 8px;
    margin-bottom: 5px;
    border-left: 3px solid #8f94fb;
    background: rgba(143, 148, 251, 0.05);
}

.translation-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.time-estimate {
    background: rgba(0,0,0,0.05);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .language-selector {
        flex-wrap: wrap;
    }

    .language-label {
        min-width: 100%;
        text-align: center;
    }

    .language-arrow {
        display: none;
    }
}
