/**
 * CADverter - Professional Stylesheet
 * Modern, responsive design for CAD to PDF converter
 * Version: 2.0.0
 * Author: MiniMax Agent
 */

/* ========== CSS Variables ========== */
:root {
    /* Primary Colors */
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    
    /* Secondary Colors */
    --secondary: #8b5cf6;
    --secondary-dark: #7c3aed;
    --secondary-gradient: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    
    /* Status Colors */
    --success: #10b981;
    --success-dark: #059669;
    --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --warning: #f59e0b;
    --warning-dark: #d97706;
    --error: #ef4444;
    --error-dark: #dc2626;
    
    /* Dark Theme Colors */
    --dark: #0f172a;
    --dark-light: #1e293b;
    --dark-lighter: #334155;
    
    /* Light Theme Colors */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --white: #ffffff;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Transitions */
    --transition: all 0.3s ease;
    --transition-fast: all 0.15s ease;
    --transition-slow: all 0.5s ease;
    
    /* Typography - Default (English/LTR) */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-family-ar: 'Cairo', 'Tajawal', 'Almarai', sans-serif;
}

/* ========== RTL Specific Typography ========== */
body.rtl {
    --font-family: 'Cairo', 'Tajawal', 'Almarai', sans-serif;
}

body.ltr {
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ========== Language Toggle Button ========== */
.language-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--white);
    border: 2px solid var(--primary);
    border-radius: 50px;
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.language-toggle:hover {
    background: var(--primary);
    color: var(--white);
}

.language-toggle svg {
    width: 20px;
    height: 20px;
}

.language-toggle .lang-text {
    font-weight: 600;
}

/* RTL adjustments for language toggle */
body.rtl .language-toggle {
    right: auto;
    left: 20px;
}

/* ========== Reset & Base Styles ========== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background: var(--gray-50);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    direction: ltr;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
}

input, select, textarea {
    font-family: inherit;
    outline: none;
}

/* ========== Header Styles ========== */
header {
    background: var(--white);
    padding: 16px 24px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: var(--transition);
}

.logo:hover {
    color: var(--primary);
}

.logo svg {
    width: 36px;
    height: 36px;
    transition: var(--transition);
}

.logo:hover svg {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav-link {
    color: var(--gray-600);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    padding: 8px 0;
    background: none;
    font-size: 1rem;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary);
}

.nav-link:hover::after {
    width: 100%;
}

/* ========== Main Content ========== */
main {
    flex: 1;
    padding: 48px 24px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

/* ========== Hero Section ========== */
.hero {
    text-align: center;
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 16px;
    line-height: 1.3;
}

.hero h1 .highlight {
    color: var(--primary);
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.2rem;
    color: var(--gray-500);
    max-width: 600px;
    margin: 0 auto;
}

/* ========== Card Styles ========== */
.card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 32px;
}

/* ========== Upload Zone ========== */
.upload-zone {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--gray-50);
    position: relative;
    overflow: hidden;
}

.upload-zone::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    opacity: 0;
    transition: var(--transition);
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.upload-zone:hover::before, .upload-zone.dragover::before {
    opacity: 1;
}

.upload-zone.dragover {
    transform: scale(1.02);
}

.upload-icon {
    width: 80px;
    height: 80px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    position: relative;
    z-index: 1;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
}

.upload-icon svg {
    width: 40px;
    height: 40px;
    color: var(--white);
}

.upload-zone h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.upload-zone p {
    color: var(--gray-500);
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.file-types {
    display: inline-block;
    background: var(--white);
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.9rem;
    color: var(--gray-600);
    border: 1px solid var(--gray-200);
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.supported-formats {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.format-badge {
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 600;
    transition: var(--transition);
}

.format-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.format-badge.premium {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
    border-color: var(--warning);
    color: var(--warning);
}

.format-badge.premium:hover {
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

/* ========== Files List ========== */
.files-list {
    margin-top: 24px;
}

.files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
}

.files-header h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark);
}

.files-count {
    background: var(--primary);
    color: var(--white);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-right: 8px;
}

.clear-all-btn {
    background: none;
    border: none;
    color: var(--error);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
}

.clear-all-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 12px;
    transition: var(--transition);
    border: 1px solid var(--gray-100);
}

.file-item:hover {
    background: var(--white);
    border-color: var(--gray-200);
    box-shadow: var(--shadow);
}

.file-item-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.file-item-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--white);
    transition: var(--transition);
}

.file-item-icon.dwg {
    background: linear-gradient(135deg, var(--error) 0%, #dc2626 100%);
}

.file-item-icon.dxf {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
}

.file-item-icon svg {
    width: 24px;
    height: 24px;
}

.file-item-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-item-name {
    font-weight: 600;
    color: var(--dark);
    font-size: 0.95rem;
}

.file-item-size {
    font-size: 0.85rem;
    color: var(--gray-500);
}

.file-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    background: var(--gray-100);
}

.icon-btn svg {
    width: 18px;
    height: 18px;
}

.icon-btn.preview {
    background: rgba(59, 130, 246, 0.1);
}

.icon-btn.preview svg {
    color: var(--primary);
}

.icon-btn.preview:hover {
    background: var(--primary);
}

.icon-btn.preview:hover svg {
    color: var(--white);
}

.icon-btn.remove {
    background: rgba(239, 68, 68, 0.1);
}

.icon-btn.remove svg {
    color: var(--error);
}

.icon-btn.remove:hover {
    background: var(--error);
}

.icon-btn.remove:hover svg {
    color: var(--white);
}

/* ========== Settings Section ========== */
.settings {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--gray-200);
}

.settings h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings h3 svg {
    width: 22px;
    height: 22px;
    color: var(--primary);
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-item label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-600);
}

.setting-item select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    color: var(--dark);
    background: var(--white);
    cursor: pointer;
    transition: var(--transition);
}

.setting-item select:hover {
    border-color: var(--primary);
}

.setting-item select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.scale-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(59, 130, 246, 0.03) 100%);
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--primary-dark);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border: 1px solid rgba(59, 130, 246, 0.15);
}

.scale-info svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
    flex-shrink: 0;
    margin-top: 2px;
}

/* ========== Action Buttons ========== */
.action-buttons {
    display: flex;
    gap: 16px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.btn {
    flex: 1;
    min-width: 180px;
    padding: 16px 28px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
}

.btn svg {
    width: 22px;
    height: 22px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: var(--primary-gradient);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.45);
}

.btn-secondary {
    background: var(--secondary-gradient);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
}

.btn-secondary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.45);
}

.btn-success {
    background: var(--success-gradient);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.45);
}

/* ========== Progress Section ========== */
.progress {
    margin-top: 32px;
    padding: 24px;
    background: var(--gray-50);
    border-radius: var(--radius);
    display: none;
    border: 1px solid var(--gray-200);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.progress-text {
    font-weight: 700;
    color: var(--dark);
}

.progress-percent {
    font-weight: 800;
    color: var(--primary);
    font-size: 1.2rem;
}

.progress-bar {
    height: 10px;
    background: var(--gray-200);
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 5px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-status {
    font-size: 0.9rem;
    color: var(--gray-500);
    margin-top: 12px;
}

.batch-info {
    font-size: 0.9rem;
    color: var(--gray-500);
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-200);
}

/* ========== Result Section ========== */
.result {
    margin-top: 32px;
    text-align: center;
    display: none;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: var(--success-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
}

.success-icon svg {
    width: 40px;
    height: 40px;
    color: var(--white);
}

.result h3 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 8px;
}

.result p {
    color: var(--gray-500);
    margin-bottom: 24px;
}

.result-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.result-btn {
    padding: 16px 28px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
    min-width: 180px;
}

.result-btn svg {
    width: 20px;
    height: 20px;
}

.result-btn.download {
    background: var(--success-gradient);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.result-btn.download:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.45);
}

.result-btn.zip {
    background: var(--secondary-gradient);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
}

.result-btn.zip:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.45);
}

.new-file-btn {
    width: 100%;
    max-width: 400px;
    margin-top: 20px;
    padding: 16px 28px;
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.new-file-btn:hover {
    background: rgba(59, 130, 246, 0.05);
    transform: translateY(-2px);
}

/* ========== Features Section ========== */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-top: 48px;
}

.feature {
    background: var(--white);
    padding: 28px;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--gray-100);
}

.feature:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.feature-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.feature-icon svg {
    width: 32px;
    height: 32px;
    color: var(--primary);
}

.feature h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
}

.feature p {
    font-size: 0.9rem;
    color: var(--gray-500);
    line-height: 1.6;
}

/* ========== Info Banner ========== */
.info-banner {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid var(--warning);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.info-banner-icon {
    width: 48px;
    height: 48px;
    background: var(--warning);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.info-banner-icon svg {
    width: 28px;
    height: 28px;
    color: var(--white);
}

.info-banner-content h4 {
    color: #92400e;
    margin-bottom: 6px;
    font-size: 1.05rem;
    font-weight: 700;
}

.info-banner-content p {
    color: #b45309;
    font-size: 0.9rem;
    line-height: 1.7;
}

.info-banner-content strong {
    color: #92400e;
}

/* ========== Error Message ========== */
.error-msg {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: var(--error);
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin-top: 20px;
    font-size: 0.95rem;
    font-weight: 500;
    display: none;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== Modal Styles ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 24px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--dark-light);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 1200px;
    max-height: calc(100vh - 48px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--dark);
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-header h3 svg {
    width: 24px;
    height: 24px;
    color: var(--primary-light);
}

.modal-header h3 span {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--gray-400);
    opacity: 0.9;
}

.modal-close {
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--error);
}

.modal-close svg {
    width: 22px;
    height: 22px;
    color: var(--white);
}

.modal-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    background: #1a1a1a;
}

.canvas-container {
    flex: 1;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
}

#previewCanvas {
    background: #1a1a1a;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    cursor: grab;
}

#previewCanvas:active {
    cursor: grabbing;
}

.modal-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--dark);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-wrap: wrap;
    gap: 16px;
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toolbar-btn {
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.toolbar-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.toolbar-btn svg {
    width: 20px;
    height: 20px;
    color: var(--gray-300);
}

.toolbar-btn:hover svg {
    color: var(--white);
}

.zoom-level {
    font-weight: 700;
    color: var(--white);
    min-width: 70px;
    text-align: center;
    font-size: 0.95rem;
}

.view-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.view-btn {
    padding: 10px 18px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--white);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.view-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.view-btn svg {
    width: 16px;
    height: 16px;
}

.modal-info {
    display: flex;
    gap: 24px;
    font-size: 0.9rem;
    color: var(--gray-400);
}

.modal-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-info-item svg {
    width: 18px;
    height: 18px;
    color: var(--primary-light);
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.modal-btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.modal-btn svg {
    width: 18px;
    height: 18px;
}

.modal-btn.primary {
    background: var(--primary-gradient);
    color: var(--white);
}

.modal-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.modal-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ========== Loading Spinner ========== */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: var(--white);
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 16px;
    font-size: 1rem;
    color: var(--gray-300);
}

/* ========== History Modal ========== */
.history-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    display: none;
    padding: 24px;
}

.history-content {
    background: var(--white);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 500px;
    max-height: 70vh;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

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

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
}

.history-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--dark);
}

.close-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.close-btn:hover {
    background: var(--gray-200);
}

.close-btn svg {
    width: 20px;
    height: 20px;
    color: var(--gray-600);
}

.history-list {
    padding: 20px 24px;
    max-height: 350px;
    overflow-y: auto;
}

.empty-history {
    text-align: center;
    color: var(--gray-500);
    padding: 40px 20px;
}

.empty-history svg {
    width: 48px;
    height: 48px;
    color: var(--gray-300);
    margin-bottom: 12px;
}

.history-item {
    padding: 14px 18px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    border: 1px solid var(--gray-100);
    transition: var(--transition);
}

.history-item:hover {
    background: var(--white);
    border-color: var(--gray-200);
    box-shadow: var(--shadow);
}

.history-item-name {
    font-weight: 600;
    color: var(--dark);
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.history-item-date {
    font-size: 0.85rem;
    color: var(--gray-500);
}

.clear-history-btn {
    width: calc(100% - 48px);
    margin: 16px 24px 20px;
    padding: 14px;
    background: var(--white);
    border: 1px solid var(--error);
    color: var(--error);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.clear-history-btn:hover {
    background: var(--error);
    color: var(--white);
}

/* ========== Footer ========== */
footer {
    background: var(--dark);
    color: var(--white);
    padding: 32px 24px;
    text-align: center;
    margin-top: auto;
}

footer p {
    font-size: 0.95rem;
    opacity: 0.9;
}

.privacy-note {
    margin-top: 8px;
    font-size: 0.9rem;
    opacity: 0.7;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.privacy-note svg {
    width: 16px;
    height: 16px;
}

/* ========== Responsive Design ========== */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 16px;
    }

    .nav-links {
        gap: 20px;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .card {
        padding: 24px 20px;
    }

    .upload-zone {
        padding: 40px 24px;
    }

    .upload-icon {
        width: 64px;
        height: 64px;
    }

    .upload-icon svg {
        width: 32px;
        height: 32px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        min-width: unset;
    }

    .modal-toolbar {
        flex-direction: column;
        gap: 16px;
    }

    .modal-info {
        display: none;
    }

    .modal-actions {
        width: 100%;
    }

    .modal-btn {
        flex: 1;
        justify-content: center;
    }

    .info-banner {
        flex-direction: column;
        text-align: center;
    }

    .info-banner-icon {
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    main {
        padding: 32px 16px;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .supported-formats {
        flex-direction: column;
        align-items: center;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .file-item {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .file-item-info {
        flex-direction: column;
    }

    .file-item-actions {
        width: 100%;
        justify-content: center;
    }
}

/* ========== Print Styles ========== */
@media print {
    header, footer, .action-buttons, .settings, .upload-zone {
        display: none !important;
    }

    body {
        background: white;
    }

    .card {
        box-shadow: none;
        padding: 0;
    }
}

/* ========== Accessibility ========== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible styles */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: var(--white);
    padding: 8px 16px;
    z-index: 10000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* ========== RTL (Right-to-Left) Specific Styles ========== */
body.rtl {
    /* Text alignment for RTL */
    text-align: right;
}

body.rtl .header-container {
    flex-direction: row-reverse;
}

body.rtl .nav-links {
    margin-right: auto;
    margin-left: 0;
}

body.rtl .upload-zone {
    text-align: right;
}

body.rtl .upload-icon {
    margin-left: auto;
    margin-right: 0;
}

body.rtl .supported-formats {
    justify-content: flex-start;
}

body.rtl .files-header {
    flex-direction: row-reverse;
}

body.rtl .file-item-info {
    flex-direction: row-reverse;
}

body.rtl .file-item-actions {
    margin-right: auto;
    margin-left: 0;
}

body.rtl .settings h3 svg {
    margin-left: 12px;
    margin-right: 0;
}

body.rtl .settings-grid {
    direction: rtl;
}

body.rtl .setting-item label {
    text-align: right;
}

body.rtl .setting-item select {
    text-align: right;
    direction: rtl;
}

body.rtl .action-buttons {
    flex-direction: row-reverse;
}

body.rtl .btn svg {
    margin-left: 8px;
    margin-right: 0;
}

body.rtl .modal-header h3 svg {
    margin-left: 12px;
    margin-right: 0;
}

body.rtl .modal-header {
    flex-direction: row-reverse;
}

body.rtl .modal-close {
    margin-right: auto;
    margin-left: 0;
}

body.rtl .zoom-controls {
    flex-direction: row-reverse;
}

body.rtl .modal-info {
    flex-direction: row-reverse;
}

body.rtl .modal-info-item svg {
    margin-left: 8px;
    margin-right: 0;
}

body.rtl .modal-actions {
    flex-direction: row-reverse;
}

body.rtl .modal-btn svg {
    margin-left: 8px;
    margin-right: 0;
}

body.rtl .history-header {
    flex-direction: row-reverse;
}

body.rtl .close-btn {
    margin-right: auto;
    margin-left: 0;
}

body.rtl .result-actions {
    flex-direction: row-reverse;
}

body.rtl .result-btn svg {
    margin-left: 8px;
    margin-right: 0;
}

body.rtl .features {
    direction: rtl;
}

body.rtl .feature {
    text-align: right;
}

body.rtl .feature-icon {
    margin-left: auto;
    margin-right: 0;
}

body.rtl .info-banner {
    flex-direction: row-reverse;
    text-align: right;
}

body.rtl .info-banner-icon {
    margin-left: 16px;
    margin-right: 0;
}

body.rtl .hero {
    text-align: center;
}

body.rtl .skip-link {
    left: auto;
    right: 0;
}

body.rtl .language-toggle {
    right: auto;
    left: 20px;
}

/* RTL specific border radius adjustments */
body.rtl .format-badge:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

body.rtl .format-badge:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Fix for select dropdown arrow in RTL */
body.rtl select {
    background-position: left 12px center;
    padding-left: 32px;
    padding-right: 12px;
}

/* Progress bar RTL fix */
body.rtl .progress-fill {
    animation: slideInRTL 0.3s ease;
}

@keyframes slideInRTL {
    from {
        width: 0;
    }
}

/* Ensure proper stacking context for modals in RTL */
body.rtl .modal-overlay {
    direction: rtl;
}

/* History modal RTL adjustments */
body.rtl .history-content {
    text-align: right;
}

body.rtl .clear-history-btn {
    margin-left: auto;
    margin-right: 0;
}

/* Footer RTL adjustments */
body.rtl footer {
    text-align: center;
}

body.rtl .privacy-note {
    justify-content: center;
}

/* Preview button tooltip position adjustment for RTL */
body.rtl [data-tooltip]::before {
    left: 0;
    right: auto;
}

/* Ensure proper flex behavior for form elements in RTL */
body.rtl input,
body.rtl select,
body.rtl textarea {
    text-align: right;
}

/* Scrollbar position for RTL */
body.rtl ::-webkit-scrollbar-thumb {
    border-radius: 0 8px 8px 0;
}

body.rtl ::-webkit-scrollbar-corner {
    border-radius: 0 8px 8px 0;
}
/* المتغيرات الأساسية */
:root {
    --primary-dark: #0F172A;
    --primary-blue: #3B82F6;
    --primary-hover: #2563EB;
    --success-green: #10B981;
    --warning-orange: #F59E0B;
    --error-red: #EF4444;
    --bg-light: #F8FAFC;
    --bg-white: #FFFFFF;
    --text-dark: #1E293B;
    --text-gray: #64748B;
    --border-light: #E2E8F0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* إعادة التعيين */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* الرأس */
.header {
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--primary-blue);
}

.nav-links {
    display: flex;
    gap: 25px;
}

.nav-link {
    color: var(--text-gray);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
    font-size: 0.95rem;
    cursor: pointer;
}

.nav-link:hover {
    color: var(--primary-blue);
}

/* المحتوى الرئيسي */
.main-content {
    flex: 1;
    padding: 40px 0;
}

.hero-section {
    text-align: center;
    margin-bottom: 40px;
}

.hero-section h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.hero-section p {
    font-size: 1.1rem;
    color: var(--text-gray);
}

/* بطاقة المحول */
.converter-card {
    background: var(--bg-white);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
}

/* منطقة الرفع */
.upload-zone {
    border: 2px dashed var(--border-light);
    border-radius: 16px;
    padding: 50px 30px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    background: var(--bg-light);
}

.upload-zone:hover {
    border-color: var(--primary-blue);
    background: rgba(59, 130, 246, 0.03);
}

.upload-zone.drag-over {
    border-color: var(--primary-blue);
    background: rgba(59, 130, 246, 0.08);
    transform: scale(1.01);
}

.upload-zone.disabled {
    opacity: 0.6;
    pointer-events: none;
}

.upload-content {
    pointer-events: none;
}

.upload-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-hover));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.upload-icon svg {
    width: 40px;
    height: 40px;
    color: white;
}

.upload-content h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.upload-content p {
    color: var(--text-gray);
    margin-bottom: 15px;
}

.file-types {
    display: inline-block;
    background: var(--bg-white);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-gray);
    border: 1px solid var(--border-light);
}

.batch-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--success-green), #059669);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 15px;
    animation: pulse 2s ease-in-out infinite;
}

.batch-badge svg {
    width: 18px;
    height: 18px;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* قائمة الملفات المرفوعة */
.files-list {
    margin-top: 20px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-light);
}

.files-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-dark);
}

.clear-all-btn {
    background: transparent;
    border: none;
    color: var(--error-red);
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
    padding: 5px 10px;
    border-radius: 6px;
    transition: all var(--transition-fast);
}

.clear-all-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

.files-items {
    max-height: 300px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: var(--bg-light);
    border-radius: 10px;
    margin-bottom: 10px;
    transition: all var(--transition-fast);
}

.file-item:hover {
    background: rgba(59, 130, 246, 0.05);
}

.file-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.file-item-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-blue);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-item-icon svg {
    width: 20px;
    height: 20px;
    color: white;
}

.file-item-details {
    display: flex;
    flex-direction: column;
}

.file-item-name {
    font-weight: 500;
    color: var(--primary-dark);
    font-size: 0.9rem;
}

.file-item-size {
    font-size: 0.8rem;
    color: var(--text-gray);
}

.file-item-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-item-remove {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.file-item-remove:hover {
    background: var(--error-red);
}

.file-item-remove:hover svg {
    color: white;
}

.file-item-remove svg {
    width: 16px;
    height: 16px;
    color: var(--error-red);
}

.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-pending {
    background: rgba(100, 116, 139, 0.1);
    color: var(--text-gray);
}

.status-converting {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-blue);
}

.status-done {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-green);
}

.status-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-red);
}

/* معاينة الملف */
.file-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #F0F9FF, #E0F2FE);
    border: 1px solid #BAE6FD;
    border-radius: 12px;
    padding: 15px 20px;
    margin-top: 20px;
    animation: slideIn 0.3s ease;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.file-icon {
    width: 45px;
    height: 45px;
    background: var(--primary-blue);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.file-details {
    display: flex;
    flex-direction: column;
}

.file-name {
    font-weight: 600;
    color: var(--primary-dark);
    font-size: 0.95rem;
}

.file-size {
    font-size: 0.85rem;
    color: var(--text-gray);
}

.remove-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.remove-btn:hover {
    background: var(--error-red);
}

.remove-btn:hover svg {
    color: white;
}

.remove-btn svg {
    width: 18px;
    height: 18px;
    color: var(--error-red);
}

/* قسم الإعدادات */
.settings-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid var(--border-light);
    animation: fadeIn 0.4s ease;
}

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

.settings-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 20px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-item label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-gray);
}

.setting-item select {
    padding: 12px 15px;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    font-size: 0.95rem;
    color: var(--text-dark);
    background: var(--bg-white);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.setting-item select:hover {
    border-color: var(--primary-blue);
}

.setting-item select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* أزرار التحويل */
.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.convert-btn {
    flex: 1;
    padding: 18px 30px;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-hover));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all var(--transition-normal);
    font-family: inherit;
    position: relative;
    overflow: hidden;
    min-width: 200px;
}

.convert-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.convert-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.convert-btn:not(:disabled):active {
    transform: translateY(0);
}

.convert-btn.loading {
    pointer-events: none;
}

.batch-convert {
    background: linear-gradient(135deg, var(--success-green), #059669);
}

.batch-convert:not(:disabled):hover {
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.btn-icon {
    display: flex;
    align-items: center;
}

.btn-icon svg {
    width: 22px;
    height: 22px;
}

/* قسم التقدم */
.progress-section {
    margin-top: 30px;
    padding: 25px;
    background: var(--bg-light);
    border-radius: 12px;
    animation: slideIn 0.3s ease;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.progress-text {
    font-weight: 500;
    color: var(--primary-dark);
}

.progress-percent {
    font-weight: 700;
    color: var(--primary-blue);
    font-size: 1.1rem;
}

.progress-bar {
    height: 10px;
    background: var(--border-light);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-blue), var(--primary-hover));
    border-radius: 5px;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.batch-convert .progress-fill {
    background: linear-gradient(90deg, var(--success-green), #059669);
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    100% { left: 100%; }
}

.progress-status {
    font-size: 0.9rem;
    color: var(--text-gray);
}

.batch-progress {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-light);
}

#currentFile {
    font-size: 0.9rem;
    color: var(--text-gray);
}

/* قسم النتيجة */
.result-section {
    margin-top: 30px;
    text-align: center;
    animation: scaleIn 0.4s ease;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--success-green), #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.success-icon svg {
    width: 40px;
    height: 40px;
    color: white;
}

.result-section h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 10px;
}

.result-section p {
    color: var(--text-gray);
    margin-bottom: 25px;
}

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.download-btn {
    padding: 18px 30px;
    background: linear-gradient(135deg, var(--success-green), #059669);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all var(--transition-normal);
    font-family: inherit;
    min-width: 200px;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.download-btn svg {
    width: 22px;
    height: 22px;
}

.zip-btn {
    background: linear-gradient(135deg, #8B5CF6, #7C3AED);
}

.zip-btn:hover {
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

.new-file-btn {
    width: 100%;
    max-width: 400px;
    margin-top: 15px;
    padding: 16px 30px;
    background: transparent;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: inherit;
}

.new-file-btn:hover {
    background: rgba(59, 130, 246, 0.05);
}

/* قسم المميزات */
.features-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 50px;
}

.feature-card {
    background: var(--bg-white);
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    border: 1px solid var(--border-light);
    transition: all var(--transition-normal);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-icon svg {
    width: 30px;
    height: 30px;
    color: var(--primary-blue);
}

.feature-card h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 10px;
}

.feature-card p {
    font-size: 0.95rem;
    color: var(--text-gray);
    line-height: 1.6;
}

/* قسم السجل */
.history-section {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.history-card {
    background: var(--bg-white);
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

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

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-light);
}

.history-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-dark);
}

.close-history {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-light);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.close-history:hover {
    background: var(--border-light);
}

.close-history svg {
    width: 20px;
    height: 20px;
    color: var(--text-gray);
}

.history-list {
    padding: 20px 25px;
    max-height: 400px;
    overflow-y: auto;
}

.empty-history {
    text-align: center;
    color: var(--text-gray);
    padding: 40px 20px;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: var(--bg-light);
    border-radius: 10px;
    margin-bottom: 10px;
}

.history-item-info {
    display: flex;
    flex-direction: column;
}

.history-item-name {
    font-weight: 500;
    color: var(--primary-dark);
    font-size: 0.9rem;
}

.history-item-date {
    font-size: 0.8rem;
    color: var(--text-gray);
}

.clear-history {
    width: calc(100% - 50px);
    margin: 0 25px 25px;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--error-red);
    color: var(--error-red);
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.clear-history:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* التذييل */
.footer {
    background: var(--primary-dark);
    color: white;
    padding: 30px 0;
    margin-top: 50px;
}

.footer .container {
    text-align: center;
}

.footer p {
    font-size: 0.95rem;
    opacity: 0.9;
}

.privacy-note {
    margin-top: 10px;
    font-size: 0.9rem;
    opacity: 0.7;
}

/* التجاوب */
@media (max-width: 768px) {
    .header .container {
        padding: 12px 15px;
    }

    .logo {
        font-size: 1.2rem;
    }

    .nav-links {
        gap: 15px;
    }

    .nav-link {
        font-size: 0.85rem;
    }

    .hero-section h1 {
        font-size: 1.6rem;
    }

    .hero-section p {
        font-size: 1rem;
    }

    .converter-card {
        padding: 25px 20px;
        border-radius: 16px;
    }

    .upload-zone {
        padding: 35px 20px;
    }

    .upload-icon {
        width: 65px;
        height: 65px;
    }

    .upload-icon svg {
        width: 32px;
        height: 32px;
    }

    .upload-content h3 {
        font-size: 1.1rem;
    }

    .settings-grid {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .convert-btn {
        width: 100%;
        min-width: unset;
    }

    .result-actions {
        flex-direction: column;
    }

    .download-btn {
        width: 100%;
        min-width: unset;
    }

    .features-section {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .nav-links {
        display: none;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .file-preview {
        padding: 12px 15px;
    }

    .file-info {
        gap: 12px;
    }

    .file-icon {
        width: 38px;
        height: 38px;
    }
}

/* رسائل الخطأ */
.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error-red);
    padding: 15px 20px;
    border-radius: 10px;
    margin-top: 20px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* تأثير التحميل */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}