/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    direction: rtl;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loader {
    text-align: center;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
}

.nav-brand i {
    font-size: 28px;
}

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

.nav-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: #667eea;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 0;
    width: 100%;
    height: 2px;
    background: #667eea;
}

/* Hero Section */
.hero-section {
    padding: 120px 20px 60px;
    text-align: center;
    color: white;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto 80px;
}

.hero-text h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-text p {
    font-size: 20px;
    margin-bottom: 30px;
    opacity: 0.9;
    line-height: 1.6;
}

.cta-button {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    padding: 18px 40px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 30px rgba(255, 107, 107, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(255, 107, 107, 0.4);
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

.feature-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.feature-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.25);
}

.feature-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.3);
}

.feature-icon i {
    font-size: 32px;
    color: white;
}

.feature-card h3 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 15px;
    color: white;
}

.feature-card p {
    font-size: 16px;
    opacity: 0.9;
    line-height: 1.6;
    color: white;
}

/* Editor Section */
.editor-section {
    min-height: 100vh;
    padding: 80px 20px 20px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.editor-container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

/* Upload Area */
.upload-area {
    padding: 80px 40px;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.upload-content {
    max-width: 500px;
    margin: 0 auto;
}

.upload-icon {
    font-size: 80px;
    margin-bottom: 30px;
    opacity: 0.8;
}

.upload-area h3 {
    font-size: 28px;
    margin-bottom: 15px;
    font-weight: 600;
}

.upload-area p {
    font-size: 18px;
    margin-bottom: 30px;
    opacity: 0.9;
}

.upload-button {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    padding: 15px 35px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
}

.upload-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(255, 107, 107, 0.4);
}

/* Editor Interface */
.editor-interface {
    display: grid;
    grid-template-columns: 300px 1fr;
    min-height: 700px;
}

.tools-panel {
    background: #f8f9fa;
    padding: 30px;
    border-left: 1px solid #e9ecef;
    overflow-y: auto;
}

.tool-group {
    margin-bottom: 30px;
}

.tool-group h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #495057;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
}

.tool-btn,
.filter-btn,
.size-btn {
    width: 100%;
    background: white;
    border: 2px solid #e9ecef;
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #495057;
}

.tool-btn:hover,
.filter-btn:hover,
.size-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateX(-3px);
}

.tool-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.size-inputs {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.size-inputs input {
    padding: 10px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
}

.size-inputs button {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
}

.size-inputs button:hover {
    background: #5a67d8;
}

/* Canvas Area */
.canvas-area {
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    position: relative;
}

#imageCanvas {
    max-width: 100%;
    max-height: 100%;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    cursor: crosshair;
}

/* Action Buttons */
.action-buttons {
    grid-column: 1 / -1;
    background: #f8f9fa;
    padding: 20px 30px;
    display: flex;
    justify-content: center;
    gap: 20px;
    border-top: 1px solid #e9ecef;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.2);
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108, 117, 125, 0.3);
}

/* Footer */
.footer {
    background: #2c3e50;
    color: white;
    padding: 60px 20px 20px;
    margin-top: 80px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer-section h4 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #ff6b6b;
}

.footer-section p,
.footer-section li {
    font-size: 16px;
    line-height: 1.6;
    opacity: 0.9;
    margin-bottom: 8px;
}

.footer-section ul {
    list-style: none;
}

.footer-section li::before {
    content: "✓ ";
    color: #ff6b6b;
    font-weight: bold;
    margin-left: 5px;
}

.footer-bottom {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #34495e;
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .hero-text h1 {
        font-size: 36px;
    }
    
    .hero-text p {
        font-size: 18px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .editor-interface {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }
    
    .tools-panel {
        border-left: none;
        border-bottom: 1px solid #e9ecef;
        max-height: 300px;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 100px 15px 40px;
    }
    
    .hero-text h1 {
        font-size: 28px;
    }
    
    .cta-button {
        font-size: 16px;
        padding: 15px 30px;
    }
    
    .feature-card {
        padding: 30px 15px;
    }
    
    .upload-area {
        padding: 60px 20px;
    }
    
    .upload-icon {
        font-size: 60px;
    }
    
    .upload-area h3 {
        font-size: 24px;
    }
    
    .tools-panel {
        padding: 20px;
    }
    
    .canvas-area {
        padding: 20px;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

.feature-card {
    animation: fadeIn 0.6s ease forwards;
}

.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.3s; }
.feature-card:nth-child(4) { animation-delay: 0.4s; }

/* Drag and Drop Styles */
.upload-area.drag-over {
    background: linear-gradient(135deg, #5a67d8 0%, #667eea 100%);
    transform: scale(1.02);
    transition: all 0.3s ease;
}

/* Canvas Filters */
.filter-none { filter: none; }
.filter-grayscale { filter: grayscale(100%); }
.filter-sepia { filter: sepia(100%); }
.filter-blur { filter: blur(2px); }
.filter-brightness { filter: brightness(1.3); }
.filter-contrast { filter: contrast(1.3); }