* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #64748b;
    --secondary-hover: #475569;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.language-selector {
    display: flex;
    align-items: center;
}

#languageSelect {
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}

#languageSelect:hover {
    border-color: var(--primary-color);
}

#languageSelect:focus {
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

main {
    padding: 60px 0;
}

.hero-section {
    background: var(--surface);
    border-radius: 16px;
    padding: 60px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 60px;
    text-align: center;
}

.upload-area {
    margin-bottom: 40px;
}

#fileInput {
    display: none;
}

.upload-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    border: 2px dashed var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--background);
    min-width: 400px;
}

.upload-btn:hover {
    border-color: var(--primary-color);
    background: #f0fdf4;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.upload-btn span {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.upload-hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.preview-section {
    margin-bottom: 40px;
    display: none;
}

.preview-section.active {
    display: block;
}

.preview-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.preview-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    background: var(--surface);
}

.preview-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.preview-item .remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.preview-item .remove-btn:hover {
    background: rgba(239, 68, 68, 1);
    transform: scale(1.1);
}

.controls {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 24px;
}

.btn {
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-icon {
    font-size: 1.25rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-primary:disabled {
    background: var(--border);
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: var(--secondary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3);
}

.btn-secondary:disabled {
    background: var(--border);
    cursor: not-allowed;
    opacity: 0.6;
}

.progress {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.3s;
}

.features-section {
    margin-bottom: 60px;
}

.features-section h2,
.faq-section h2 {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 40px;
    color: var(--text-primary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 32px;
}

.feature-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 32px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.faq-section {
    margin-bottom: 60px;
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: var(--surface);
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.faq-item h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.faq-item p {
    color: var(--text-secondary);
    line-height: 1.6;
}

footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 40px 0;
    text-align: center;
}

footer p {
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 16px;
    }
    
    .hero-section {
        padding: 40px 20px;
    }
    
    .upload-btn {
        min-width: 100%;
        padding: 40px;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .features-section h2,
    .faq-section h2 {
        font-size: 1.5rem;
    }
}

html[lang="ar"] .header-content {
    flex-direction: row-reverse;
}

html[lang="ar"] .language-selector {
    margin-right: auto;
    margin-left: 0;
}