/* VectorMaster Ultra - تصميم متجاوب وكامل */

/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    --bg-dark: #0f172a;
    --bg-card-dark: #1e293b;
    --text-dark: #f1f5f9;
    --border-dark: #334155;
    
    --bg-light: #ffffff;
    --bg-card-light: #f8fafc;
    --text-light: #1e293b;
    --border-light: #e2e8f0;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    transition: background-color 0.3s, color 0.3s;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Themes */
body.dark-mode {
    background-color: var(--bg-dark);
    color: var(--text-dark);
}

body.light-mode {
    background-color: var(--bg-light);
    color: var(--text-light);
}

/* Smart Navigation */
.smart-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: rgba(15, 23, 42, 0.8);
    border-bottom: 1px solid var(--border-dark);
}

body.light-mode .smart-nav {
    background: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid var(--border-light);
}

.nav-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.logo-icon {
    font-size: 1.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.auto-mode-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-card-dark);
    border-radius: var(--radius-md);
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
}

body.light-mode .toggle-label {
    background: var(--bg-card-light);
}

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

#autoMode {
    display: none;
}

#autoMode:checked + .toggle-label {
    background: var(--primary);
    color: white;
}

.lang-selector, .filter-select, .preset-select {
    padding: 0.5rem 1rem;
    background: var(--bg-card-dark);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-md);
    color: inherit;
    font-size: 0.875rem;
    cursor: pointer;
    min-width: 120px;
}

body.light-mode .lang-selector,
body.light-mode .filter-select,
body.light-mode .preset-select {
    background: var(--bg-card-light);
    border-color: var(--border-light);
}

.nav-btn {
    padding: 0.5rem;
    background: var(--bg-card-dark);
    border: none;
    border-radius: var(--radius-md);
    color: inherit;
    cursor: pointer;
    font-size: 1.25rem;
    transition: background-color 0.2s;
}

body.light-mode .nav-btn {
    background: var(--bg-card-light);
}

.nav-btn:hover {
    background: var(--primary);
    color: white;
}

/* Smart Preview */
.smart-preview {
    max-width: 1440px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.preview-header {
    margin-bottom: 2rem;
    text-align: center;
}

.preview-header h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.preview-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat {
    padding: 0.5rem 1rem;
    background: var(--bg-card-dark);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
}

body.light-mode .stat {
    background: var(--bg-card-light);
}

/* Preview Grid */
.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

@media (max-width: 768px) {
    .preview-grid {
        grid-template-columns: 1fr;
    }
}

/* Preview Cards */
.preview-card {
    background: var(--bg-card-dark);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    border: 1px solid var(--border-dark);
    transition: transform 0.3s, box-shadow 0.3s;
}

body.light-mode .preview-card {
    background: var(--bg-card-light);
    border-color: var(--border-light);
}

.preview-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.card-icon {
    font-size: 1.5rem;
}

.card-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

/* Upload Zone */
.upload-zone {
   position: relative;
 cursor: pointer;
    border: 2px dashed var(--border-dark);
    transition: border-color 0.3s;
}

body.light-mode .upload-zone {
    border-color: var(--border-light);
}

.upload-zone.dragging {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.upload-placeholder {
    text-align: center;
    padding: 3rem 1rem;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.upload-icon.spin {
    animation: spin 1s linear infinite;
}

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

.upload-subtext {
    font-size: 0.875rem;
    opacity: 0.7;
    margin-top: 0.5rem;
}

.hidden-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    z-index: 100;
    cursor: pointer;
    display: block !important;
}



/* Process Steps */
.process-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    background: var(--bg-dark);
    opacity: 0.5;
    transition: all 0.3s;
}

body.light-mode .step {
    background: var(--bg-light);
}

.step.active {
    opacity: 1;
    background: var(--primary);
    color: white;
    transform: scale(1.05);
}

.step.completed {
    opacity: 1;
    background: var(--success);
    color: white;
}

.step-icon {
    font-size: 1.25rem;
}

.step-text {
    font-size: 0.75rem;
    text-align: center;
}

/* Progress Bar */
.progress-container {
    margin: 2rem 0;
    background: var(--bg-dark);
    border-radius: var(--radius-lg);
    padding: 0.25rem;
    position: relative;
}

body.light-mode .progress-container {
    background: var(--bg-light);
}

.progress-bar {
    height: 1rem;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: var(--radius-md);
    width: 0%;
    transition: width 0.5s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Auto Controls */
.auto-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auto-btn {
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: var(--radius-lg);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: transform 0.3s, box-shadow 0.3s;
}

.auto-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.quality-preset {
    width: 100%;
}

/* Smart Canvas */
.smart-canvas {
    width: 100%;
    height: 300px;
    background: var(--bg-dark);
    border-radius: var(--radius-lg);
    display: none;
}

body.light-mode .smart-canvas {
    background: var(--bg-light);
}

.result-placeholder {
    text-align: center;
    padding: 3rem 1rem;
}

.result-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

/* Result Actions */
.result-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.action-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

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

.action-btn.success {
    background: var(--success);
    color: white;
}

.action-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

/* Smart Products */
.smart-products {
    max-width: 1440px;
    margin: 3rem auto;
    padding: 0 1rem;
}

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.products-header h2 {
    font-size: 1.75rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 640px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.product-card {
    background: var(--bg-card-dark);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    border: 1px solid var(--border-dark);
    transition: all 0.3s;
    cursor: pointer;
}

body.light-mode .product-card {
    background: var(--bg-card-light);
    border-color: var(--border-light);
}

.product-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.product-card.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.product-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.product-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.product-desc {
    font-size: 0.875rem;
    opacity: 0.7;
}

/* Advanced Stats */
.advanced-stats {
    max-width: 1440px;
    margin: 3rem auto;
    padding: 0 1rem;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: var(--bg-card-dark);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

body.light-mode .stat-card {
    background: var(--bg-card-light);
}

.stat-icon {
    font-size: 2rem;
    opacity: 0.8;
}

.stat-content {
    flex: 1;
}

.stat-content h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.stat-meter {
    height: 6px;
    background: var(--bg-dark);
    border-radius: 3px;
    overflow: hidden;
    margin: 0.5rem 0;
}

body.light-mode .stat-meter {
    background: var(--bg-light);
}

.meter-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%;
    transition: width 1s ease;
}

.stat-desc {
    font-size: 0.875rem;
    opacity: 0.7;
}

/* Smart Download */
.smart-download {
    max-width: 1440px;
    margin: 3rem auto;
    padding: 0 1rem;
}

.download-header {
    text-align: center;
    margin-bottom: 2rem;
}

.download-header h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.format-info {
    opacity: 0.7;
}

.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.format-card {
    background: var(--bg-card-dark);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

body.light-mode .format-card {
    background: var(--bg-card-light);
    border-color: var(--border-light);
}

.format-card:hover:not(:disabled) {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.format-card:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.format-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.format-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.format-desc {
    font-size: 0.875rem;
    opacity: 0.7;
    margin-bottom: 0.5rem;
}

.format-size {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
}

/* Smart Footer */
.smart-footer {
    margin-top: 4rem;
    padding: 3rem 1rem;
    background: var(--bg-card-dark);
    border-top: 1px solid var(--border-dark);
}

body.light-mode .smart-footer {
    background: var(--bg-card-light);
    border-color: var(--border-light);
}

.footer-content {
    max-width: 1440px;
    margin: 0 auto;
    text-align: center;
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.footer-icon {
    font-size: 1.5rem;
}

.footer-text {
    opacity: 0.7;
    margin-bottom: 1rem;
}

.footer-credits {
    font-size: 0.875rem;
    opacity: 0.5;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.version {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
}

/* Smart Modal */
.smart-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.smart-modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card-dark);
    border-radius: var(--radius-xl);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    animation: modalIn 0.3s ease;
}

body.light-mode .modal-content {
    background: var(--bg-card-light);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

body.light-mode .modal-header {
    border-color: var(--border-light);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: inherit;
    cursor: pointer;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

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

body.light-mode .modal-close:hover {
    background: var(--bg-light);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    max-height: 70vh;
}

/* Smart Notification */
.smart-notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 10001;
    animation: slideInRight 0.3s ease;
    box-shadow: var(--shadow-xl);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Utility Classes */
.spin {
    animation: spin 1s linear infinite;
}

.hidden {
    display: none !important;
}

/* Print Styles */
@media print {
    .smart-nav,
    .smart-footer,
    .auto-controls,
    .result-actions,
    .download-grid {
        display: none !important;
    }
    
    .smart-preview,
    .smart-products,
    .advanced-stats {
        break-inside: avoid;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --primary: #0000ff;
        --success: #008000;
        --warning: #ffa500;
        --danger: #ff0000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .action-btn,
    .auto-btn,
    .format-card {
        min-height: 44px;
    }
    
    .nav-btn,
    .modal-close {
        min-width: 44px;
        min-height: 44px;
    }
    
    select {
        min-height: 44px;
        font-size: 16px; /* Prevents iOS zoom */
    }
}

/* Ultra Wide Screens */
@media (min-width: 1920px) {
    .nav-container,
    .smart-preview,
    .smart-products,
    .advanced-stats,
    .smart-download,
    .footer-content {
        max-width: 1800px;
    }
}

/* Tiny Screens */
@media (max-width: 360px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .preview-stats {
        flex-direction: column;
        align-items: center;
    }
    
    .process-steps {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .download-grid {
        grid-template-columns: 1fr;
    }
}
/* إضافة هذه الأنماط في نهاية الملف */

/* ================ إزالة البيكسيلات وتحسين الجودة ================ */

/* تحسين الكانفاس */
.smart-canvas {
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-crisp-edges;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
    -ms-interpolation-mode: nearest-neighbor;
}

/* تحسين العرض على شاشات عالية الدقة */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .smart-canvas {
        image-rendering: auto;
    }
    
    .preview-card,
    .product-card,
    .format-card {
        transform: translateZ(0);
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* تحسين الخطوط */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* تحسين الصور */
img {
    max-width: 100%;
    height: auto;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* تحسين التحولات */
.preview-card,
.product-card,
.format-card,
.action-btn,
.auto-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* تحسين التمرير */
.preview-grid,
.products-grid,
.download-grid,
.stats-container {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

.preview-grid::-webkit-scrollbar,
.products-grid::-webkit-scrollbar,
.download-grid::-webkit-scrollbar,
.stats-container::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.preview-grid::-webkit-scrollbar-track,
.products-grid::-webkit-scrollbar-track,
.download-grid::-webkit-scrollbar-track,
.stats-container::-webkit-scrollbar-track {
    background: transparent;
}

.preview-grid::-webkit-scrollbar-thumb,
.products-grid::-webkit-scrollbar-thumb,
.download-grid::-webkit-scrollbar-thumb,
.stats-container::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

/* تحسين الـ focus */
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* تحسين الوصول */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* تحسين للشاشات الصغيرة */
@media (max-width: 640px) {
    .smart-canvas {
        image-rendering: optimizeSpeed;
    }
}

/* تحسين لعرض الطباعة */
@media print {
    .smart-canvas {
        image-rendering: optimizeQuality;
    }
}

/* تحسين لغة RTL */
[dir="rtl"] .preview-grid,
[dir="rtl"] .products-grid,
[dir="rtl"] .download-grid {
    direction: rtl;
}

/* تحسين لشاشات اللمس */
@media (hover: none) and (pointer: coarse) {
    .action-btn,
    .auto-btn,
    .format-card {
        min-height: 48px;
        padding: 12px 16px;
    }
    
    .smart-canvas {
        touch-action: manipulation;
    }
}

/* تحسين التحميل */
.upload-placeholder,
.result-placeholder {
    opacity: 0.8;
    transition: opacity 0.3s;
}

.upload-placeholder.loading,
.result-placeholder.loading {
    opacity: 1;
}

/* تحسين الرسائل */
.smart-notification {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* تحسين العداد */
.stat-meter {
    overflow: hidden;
    position: relative;
}

.meter-fill {
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

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

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

/* تحسين الخطوات */
.step {
    position: relative;
    overflow: hidden;
}

.step::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.step.active::before {
    opacity: 1;
    animation: stepShine 2s infinite;
}

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

/* تحسين شريط التقدم */
.progress-container {
    position: relative;
    overflow: hidden;
}

.progress-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 100%
    );
    animation: progressShine 3s infinite;
}

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

/* تحسين حدود البطاقات */
.preview-card,
.product-card,
.format-card,
.stat-card {
    position: relative;
}

.preview-card::before,
.product-card::before,
.format-card::before,
.stat-card::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(45deg, var(--primary), var(--secondary), var(--primary));
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
}

.preview-card:hover::before,
.product-card:hover::before,
.format-card:hover::before,
.stat-card:hover::before {
    opacity: 0.1;
}
/* إضافة في نهاية الملف */

/* تحسينات لوضع النهاري */
body.light-mode {
    background-color: var(--bg-light);
    color: var(--text-light);
}

body.light-mode .smart-nav {
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid var(--border-light);
}

body.light-mode .preview-card,
body.light-mode .product-card,
body.light-mode .format-card,
body.light-mode .stat-card {
    background: var(--bg-card-light);
    border-color: var(--border-light);
}

body.light-mode .toggle-label {
    background: var(--bg-card-light);
}

body.light-mode .lang-selector,
body.light-mode .filter-select,
body.light-mode .preset-select {
    background: var(--bg-card-light);
    border-color: var(--border-light);
}

body.light-mode .nav-btn {
    background: var(--bg-card-light);
}

body.light-mode .stat {
    background: var(--bg-card-light);
}

body.light-mode .progress-container {
    background: var(--bg-light);
}

body.light-mode .smart-footer {
    background: var(--bg-card-light);
    border-color: var(--border-light);
}

body.light-mode .modal-content {
    background: var(--bg-card-light);
}

body.light-mode .modal-header {
    border-color: var(--border-light);
}

body.light-mode .step {
    background: var(--bg-light);
}

/* إصلاحات للكانفاس */
.smart-canvas {
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-dark);
    display: none;
}

body.light-mode .smart-canvas {
    border-color: var(--border-light);
}

/* إصلاحات للأزرار المعطلة */
.format-card:disabled,
.action-btn:disabled,
.auto-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    pointer-events: none;
}

.format-card.disabled,
.action-btn.disabled,
.auto-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    pointer-events: none;
}

/* تحسينات للتحميل */
.upload-zone {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-zone:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* إصلاحات للعرض على الجوال */
@media (max-width: 768px) {
    .smart-canvas {
        max-width: 100%;
        height: auto;
    }
    
    .upload-zone {
        min-height: 250px;
    }
}

/* تحسينات للخطوات */
.process-steps {
    margin: 20px 0;
}

.step {
    transition: all 0.3s;
}

.step.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: var(--shadow-md);
}

.step.completed {
    background: var(--success);
    color: white;
}

/* تحسينات للإشعارات */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}