* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* Hide ad placeholders on Online tools pages */
.ad-placeholder {
    display: none !important;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.navbar {
    padding: 1rem 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-logo {
    display: flex;
    align-items: center;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    flex-direction: column;
    align-items: flex-start;
}

.nav-logo i {
    margin-left: 10px;
    font-size: 2rem;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #ffd700;
}

.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 120px 20px 80px;
    margin-top: 80px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.hero-container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.cta-button {
    display: inline-block;
    background: #ffd700;
    color: #333;
    padding: 15px 30px;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.cta-button:hover {
    background: #ffed4e;
    transform: translateY(-2px);
}

.tools-section {
    padding: 80px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 50%, #f8f9fa 100%);
    position: relative;
    overflow: hidden;
}

.tools-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(102, 126, 234, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(118, 75, 162, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.section-title {
    text-align: center;
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 4rem;
    background: linear-gradient(135deg, #2c3e50 0%, #667eea 50%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 1;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    padding: 1rem 0;
}

.tool-card:nth-child(odd) {
    animation: slideInLeft 0.6s ease-out;
}

.tool-card:nth-child(even) {
    animation: slideInRight 0.6s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* تحسينات إضافية للبطاقات */
.tool-card {
    animation-delay: calc(var(--card-index, 0) * 0.1s);
}

.tool-card::after {
    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%);
    transform: translateX(-100%);
    transition: transform 0.8s;
}

.tool-card:hover::after {
    transform: translateX(100%);
}

/* تأثير النبض للأيقونات */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

.tool-card:hover .tool-icon {
    animation: pulse 2s infinite;
}

.tool-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 25px;
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: 
        0 20px 40px rgba(0,0,0,0.08),
        0 8px 16px rgba(0,0,0,0.06),
        inset 0 1px 0 rgba(255,255,255,0.8);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255,255,255,0.2);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.6s;
}

.tool-card:hover::before {
    left: 100%;
}

.tool-card:hover {
    transform: translateY(-15px) scale(1.03);
    box-shadow: 
        0 30px 60px rgba(102, 126, 234, 0.15),
        0 15px 30px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(255,255,255,0.9);
    border-color: rgba(102, 126, 234, 0.3);
}

.tool-card:active {
    transform: translateY(-5px) scale(0.98);
}

.tool-icon {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    position: relative;
    box-shadow: 
        0 10px 25px rgba(102, 126, 234, 0.3),
        0 5px 15px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(255,255,255,0.2);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tool-icon::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #667eea, #764ba2, #667eea);
    border-radius: 50%;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s;
}

.tool-card:hover .tool-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 
        0 15px 35px rgba(102, 126, 234, 0.4),
        0 8px 20px rgba(0,0,0,0.15),
        inset 0 1px 0 rgba(255,255,255,0.3);
}

.tool-card:hover .tool-icon::before {
    opacity: 1;
}

.tool-icon i {
    font-size: 2.2rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.4s;
}

.tool-card:hover .tool-icon i {
    transform: scale(1.1);
    text-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.tool-card h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    color: #2c3e50;
    text-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: all 0.3s;
}

.tool-card:hover h3 {
    color: #667eea;
    transform: translateY(-2px);
}

.tool-card p {
    color: #6c757d;
    margin-bottom: 2rem;
    line-height: 1.6;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.tool-card:hover p {
    color: #495057;
}

.tool-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 8px 20px rgba(102, 126, 234, 0.3),
        0 4px 10px rgba(0,0,0,0.1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tool-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s;
}

.tool-button:hover::before {
    left: 100%;
}

.tool-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 15px 30px rgba(102, 126, 234, 0.4),
        0 8px 20px rgba(0,0,0,0.15);
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.tool-button:active {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 
        0 8px 20px rgba(102, 126, 234, 0.3),
        0 4px 10px rgba(0,0,0,0.1);
}

.about-section {
    padding: 80px 0;
    background: #f8f9fa;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.feature i {
    font-size: 2.5rem;
    color: #667eea;
}

.footer {
    background: #2c3e50;
    color: white;
    padding: 50px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: #ffd700;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: #bdc3c7;
    text-decoration: none;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    color: #bdc3c7;
    font-size: 1.5rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #34495e;
    color: #bdc3c7;
}

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    color: #aaa;
    float: left;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 1rem;
    left: 1rem;
}

.tool-interface {
    margin-top: 2rem;
}

.tool-interface input,
.tool-interface textarea,
.tool-interface select {
    width: 100%;
    padding: 15px 18px;
    margin: 15px 0;
    border: 2px solid #e1e5e9;
    border-radius: 15px;
    font-size: 1rem;
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s ease;
    background: #f8f9fa;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.tool-interface input:focus,
.tool-interface textarea:focus,
.tool-interface select:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 
        0 0 0 3px rgba(102, 126, 234, 0.1),
        inset 0 2px 4px rgba(0,0,0,0.05);
    transform: translateY(-2px);
}

.tool-interface button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    margin: 15px 8px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 8px 20px rgba(102, 126, 234, 0.3),
        0 4px 10px rgba(0,0,0,0.1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tool-interface button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s;
}

.tool-interface button:hover::before {
    left: 100%;
}

.tool-interface button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 15px 30px rgba(102, 126, 234, 0.4),
        0 8px 20px rgba(0,0,0,0.15);
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.tool-interface button:active {
    transform: translateY(-1px) scale(1.02);
}

/* تنسيق خاص لملف الإدخال */
.tool-interface input[type="file"] {
    position: relative;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px dashed #667eea;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.tool-interface input[type="file"]:hover {
    border-color: #764ba2;
    background: linear-gradient(145deg, #f0f4ff 0%, #e8f0ff 100%);
    transform: translateY(-2px);
    box-shadow: 
        0 10px 25px rgba(102, 126, 234, 0.15),
        0 5px 15px rgba(0,0,0,0.1);
}

.tool-interface input[type="file"]::before {
    content: '📁 اختر صورة';
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 10px;
}

.tool-interface input[type="file"]::after {
    content: 'أو اسحب الصورة هنا';
    display: block;
    font-size: 0.9rem;
    color: #6c757d;
    opacity: 0.8;
}

/* تنسيق خاص لشريط التمرير */
.tool-interface input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 5px;
    outline: none;
    padding: 0;
    margin: 20px 0;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.tool-interface input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 3px solid #667eea;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 
        0 4px 10px rgba(0,0,0,0.2),
        0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.tool-interface input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 
        0 6px 15px rgba(0,0,0,0.3),
        0 3px 8px rgba(0,0,0,0.15);
}

.tool-interface input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 3px solid #667eea;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 
        0 4px 10px rgba(0,0,0,0.2),
        0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.tool-interface input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 
        0 6px 15px rgba(0,0,0,0.3),
        0 3px 8px rgba(0,0,0,0.15);
}

/* تنسيق للقيم */
.range-value {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-left: 15px;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
    animation: pulse 2s infinite;
}

/* تنسيق للعناوين */
.tool-interface h2 {
    background: linear-gradient(135deg, #2c3e50 0%, #667eea 50%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}

.tool-interface h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

/* تنسيق للنتائج */
.result-area {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #e1e5e9;
    border-radius: 20px;
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: 
        0 10px 30px rgba(0,0,0,0.08),
        0 5px 15px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
}

.result-area:hover {
    border-color: #667eea;
    box-shadow: 
        0 15px 40px rgba(102, 126, 234, 0.15),
        0 8px 20px rgba(0,0,0,0.1);
    transform: translateY(-3px);
}

/* تنسيقات خاصة بضاغط الصور */
.file-upload-section {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px dashed #667eea;
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.file-upload-section:hover {
    border-color: #764ba2;
    background: linear-gradient(145deg, #f0f4ff 0%, #e8f0ff 100%);
    transform: translateY(-3px);
    box-shadow: 
        0 15px 35px rgba(102, 126, 234, 0.15),
        0 8px 20px rgba(0,0,0,0.1);
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    color: #667eea;
    font-size: 1.2rem;
    font-weight: 600;
}

.upload-label i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.upload-label small {
    font-size: 0.9rem;
    color: #6c757d;
    opacity: 0.8;
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-info {
    margin-top: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.file-preview {
    text-align: center;
    margin-bottom: 1.5rem;
}

.file-preview img {
    max-width: 200px;
    max-height: 150px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.file-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.file-details p {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #495057;
    font-weight: 500;
}

.file-details i {
    color: #667eea;
    width: 20px;
}

.compression-settings {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.compression-settings h3 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 2rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.setting-group {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

.setting-group label {
    display: block;
    margin-bottom: 0.8rem;
    font-weight: 600;
    color: #2c3e50;
}

.quality-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #6c757d;
}

.unit {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.compress-btn, .reset-btn {
    padding: 15px 30px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.4s ease;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.compress-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.3);
}

.compress-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(40, 167, 69, 0.4);
}

.reset-btn {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(108, 117, 125, 0.3);
}

.reset-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(108, 117, 125, 0.4);
}

.comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

.original, .compressed {
    text-align: center;
    padding: 1.5rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.original h4, .compressed h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 700;
}

.image-container {
    margin: 1rem 0;
}

.image-container img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.stats {
    text-align: left;
    margin-top: 1rem;
}

.stats p {
    margin: 0.5rem 0;
    color: #495057;
    font-weight: 500;
}

.stats i {
    color: #667eea;
    width: 20px;
    margin-left: 0.5rem;
}

.download-section {
    text-align: center;
    margin-top: 2rem;
}

.download-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.download-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(102, 126, 234, 0.4);
}

/* تحسينات إضافية */
.quality-slider {
    margin: 1rem 0;
}

.setting-group input[type="number"] {
    width: calc(100% - 60px);
    display: inline-block;
}

.setting-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 1rem;
    background: white;
    transition: all 0.3s ease;
}

.setting-group select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* تحسينات إضافية لنتائج الضغط */
.compression-results {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.compression-results h3 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 2rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.result-area {
    margin-top: 2rem;
}

/* تحسين عرض الصور */
.image-container img {
    transition: transform 0.3s ease;
    cursor: pointer;
}

.image-container img:hover {
    transform: scale(1.05);
}

/* تحسين الإحصائيات */
.stats p {
    background: linear-gradient(145deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 0.8rem;
    border-radius: 10px;
    margin: 0.8rem 0;
    border-left: 3px solid #667eea;
}

/* تحسين زر التحميل */
.download-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.download-btn:disabled:hover {
    transform: none;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

/* دعم الوضع المظلم */
body.dark-mode .compression-settings {
    background: linear-gradient(145deg, #2c3e50 0%, #34495e 100%);
    color: #ecf0f1;
}

body.dark-mode .compression-settings h3 {
    color: #ecf0f1;
}

body.dark-mode .setting-group {
    background: #34495e;
    color: #ecf0f1;
}

body.dark-mode .setting-group label {
    color: #ecf0f1;
}

body.dark-mode .setting-group input,
body.dark-mode .setting-group select {
    background: #2c3e50;
    color: #ecf0f1;
    border-color: #5a6c7d;
}

body.dark-mode .setting-group input:focus,
body.dark-mode .setting-group select:focus {
    border-color: #667eea;
    background: #2c3e50;
}

body.dark-mode .compression-results {
    background: linear-gradient(145deg, #2c3e50 0%, #34495e 100%);
    color: #ecf0f1;
}

body.dark-mode .compression-results h3 {
    color: #ecf0f1;
}

body.dark-mode .original,
body.dark-mode .compressed {
    background: #34495e;
    color: #ecf0f1;
}

body.dark-mode .original h4,
body.dark-mode .compressed h4 {
    color: #ecf0f1;
}

body.dark-mode .stats p {
    background: linear-gradient(145deg, #2c3e50 0%, #34495e 100%);
    color: #ecf0f1;
    border-left-color: #667eea;
}

body.dark-mode .quality-labels {
    color: #bdc3c7;
}

/* تأثيرات التحميل */
.compress-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.result-area {
    margin-top: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px solid #e1e5e9;
}

/* تنسيقات الإشعارات */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 15px;
    padding: 1rem 1.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    z-index: 10000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    border-left: 4px solid #667eea;
}

.notification.show {
    transform: translateX(0);
}

.notification i {
    font-size: 1.2rem;
}

.notification-success {
    border-left-color: #28a745;
    background: linear-gradient(145deg, #d4edda 0%, #c3e6cb 100%);
}

.notification-warning {
    border-left-color: #ffc107;
    background: linear-gradient(145deg, #fff3cd 0%, #ffeaa7 100%);
}

.notification-info {
    border-left-color: #17a2b8;
    background: linear-gradient(145deg, #d1ecf1 0%, #bee5eb 100%);
}

.notification-success i {
    color: #28a745;
}

.notification-warning i {
    color: #ffc107;
}

.notification-info i {
    color: #17a2b8;
}

.notification-error {
    border-left-color: #dc3545;
    background: linear-gradient(145deg, #f8d7da 0%, #f5c6cb 100%);
}

.notification-error i {
    color: #dc3545;
}

/* الرسوم المتحركة */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* تطبيق الرسوم المتحركة */
.compression-results {
    animation: fadeIn 0.6s ease-out;
}

.compress-btn:active {
    animation: pulse 0.3s ease-in-out;
}

@keyframes fadeInUp {
    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);
    }
}

/* تحسينات إضافية للموبايل */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        flex-direction: column;
        padding: 1rem 0;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-menu .nav-link {
        padding: 1rem 2rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .nav-toggle {
        display: flex;
        flex-direction: column;
        cursor: pointer;
        transition: 0.3s;
    }
    
    .nav-toggle span {
        width: 25px;
        height: 3px;
        background: white;
        margin: 3px 0;
        transition: 0.3s;
        border-radius: 2px;
    }
    
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .tool-card {
        padding: 1.5rem;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 1.5rem;
    }
    
    /* تحسينات إضافية للموبايل */
    .container {
        padding: 0 15px;
    }
    
    .header {
        padding: 1rem 0;
    }
    
    .navbar {
        padding: 0.5rem 0;
    }
    
    .hero-container {
        text-align: center;
        padding: 0 1rem;
    }
    
    .cta-button {
        padding: 1rem 2rem;
        font-size: 1rem;
    }
    
    /* تحسينات أداة ضاغط الصور للموبايل */
    .compression-settings {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .setting-group {
        padding: 0.8rem;
        margin-bottom: 1rem;
    }
    
    .comparison {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .compress-btn, .reset-btn {
        width: 100%;
        justify-content: center;
    }
    
    .download-btn {
        width: 100%;
        justify-content: center;
    }
    
    .quality-labels {
        font-size: 0.7rem;
    }
    
    .setting-group input[type="number"] {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .unit {
        display: block;
        margin: 0.5rem 0 0 0;
        text-align: center;
    }
    
    .tools-section {
        padding: 3rem 15px;
    }
    
    .about-section {
        padding: 3rem 15px;
    }
    
    .footer {
        padding: 2rem 15px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    /* تحسينات إضافية لضاغط الصور على الموبايل */
    .comparison {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .file-details {
        grid-template-columns: 1fr;
    }
    
    .file-upload-section {
        padding: 1.5rem;
    }
    
    .upload-label {
        padding: 2rem 1rem;
        font-size: 1rem;
    }
    
    .upload-label i {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }
    
    .compression-settings {
        padding: 1.5rem;
    }
    
    .setting-group {
        margin-bottom: 1.5rem;
    }
    
    .setting-group label {
        font-size: 0.95rem;
        margin-bottom: 0.8rem;
    }
    
    .setting-group input[type="number"],
    .setting-group select {
        padding: 0.8rem;
        font-size: 0.95rem;
    }
    
    .quality-labels {
        justify-content: space-between;
        margin-top: 0.5rem;
    }
    
    .quality-labels span {
        font-size: 0.85rem;
    }
    
    .compress-btn, .reset-btn {
        padding: 1rem 2rem;
        font-size: 1rem;
        margin: 0.5rem;
    }
    
    .comparison {
        margin-top: 2rem;
    }
    
    .original, .compressed {
        padding: 1.5rem;
    }
    
    .image-container img {
        max-width: 100%;
        height: auto;
    }
    
    .stats {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .stats p {
        font-size: 0.9rem;
        padding: 0.6rem;
    }
    
    .download-section {
        margin-top: 1.5rem;
    }
    
    .download-btn {
        padding: 1rem 2rem;
        font-size: 1rem;
    }
    
    /* تحسينات للإشعارات */
    .notification {
        right: 15px;
        left: 15px;
        padding: 1rem;
        font-size: 0.9rem;
    }
}

/* تحسينات للشاشات المتوسطة (tablets) */
@media (max-width: 1024px) and (min-width: 769px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .modal-content {
        width: 90%;
        max-width: 800px;
    }
    
    .comparison {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
    
    .file-details {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* تحسينات للشاشات الصغيرة جداً */
@media (max-width: 480px) {
    .hero {
        padding: 80px 15px 50px;
    }
    
    .hero-title {
        font-size: 1.6rem;
        line-height: 1.3;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    .section-title {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }
    
    .tool-card {
        padding: 1rem;
        margin: 0.5rem 0;
    }
    
    .tool-card h3 {
        font-size: 1.1rem;
        margin-bottom: 0.8rem;
    }
    
    .tool-card p {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    .tool-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 1rem;
    }
    
    .tool-icon i {
        font-size: 1.5rem;
    }
    
    .tool-button {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .nav-logo span {
        display: none;
    }
    
    .nav-logo i {
        font-size: 1.8rem;
    }
    
    /* تحسينات خاصة لضاغط الصور على الشاشات الصغيرة */
    .modal-content {
        margin: 5% auto;
        width: 98%;
        padding: 1rem;
        max-height: 95vh;
        overflow-y: auto;
    }
    
    .tool-interface h2 {
        font-size: 1.4rem;
        margin-bottom: 1.5rem;
    }
    
    .file-upload-section {
        padding: 1rem;
    }
    
    .upload-label {
        padding: 1.5rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .upload-label i {
        font-size: 2rem;
        margin-bottom: 0.8rem;
    }
    
    .upload-label small {
        font-size: 0.8rem;
    }
    
    .compression-settings {
        padding: 1rem;
    }
    
    .compression-settings h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    .setting-group {
        margin-bottom: 1rem;
    }
    
    .setting-group label {
        font-size: 0.9rem;
        margin-bottom: 0.6rem;
    }
    
    .setting-group input[type="number"],
    .setting-group select {
        padding: 0.6rem;
        font-size: 0.85rem;
    }
    
    .quality-labels {
        margin-top: 0.4rem;
    }
    
    .quality-labels span {
        font-size: 0.8rem;
    }
    
    .action-buttons {
        gap: 0.8rem;
    }
    
    .compress-btn, .reset-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
        margin: 0.3rem;
    }
    
    .comparison {
        margin-top: 1.5rem;
        gap: 1rem;
    }
    
    .original, .compressed {
        padding: 0.8rem;
    }
    
    .original h4, .compressed h4 {
        font-size: 1rem;
        margin-bottom: 0.8rem;
    }
    
    .stats {
        gap: 0.6rem;
    }
    
    .stats p {
        font-size: 0.85rem;
        padding: 0.5rem;
    }
    
    .download-section {
        margin-top: 1rem;
    }
    
    .download-btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.85rem;
    }
    
    /* تحسينات للإشعارات على الشاشات الصغيرة */
    .notification {
        right: 10px;
        left: 10px;
        padding: 0.8rem;
        font-size: 0.85rem;
        border-radius: 12px;
    }
    
    .notification i {
        font-size: 1rem;
    }
}

/* تحسينات للشاشات الصغيرة جداً (أقل من 360px) */
@media (max-width: 360px) {
    .hero-title {
        font-size: 1.4rem;
    }
    
    .hero-subtitle {
        font-size: 0.85rem;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    .tool-card {
        padding: 0.8rem;
    }
    
    .tool-card h3 {
        font-size: 1rem;
    }
    
    .tool-card p {
        font-size: 0.85rem;
    }
    
    .tool-icon {
        width: 50px;
        height: 50px;
    }
    
    .tool-icon i {
        font-size: 1.3rem;
    }
    
    .tool-button {
        padding: 0.7rem 1.2rem;
        font-size: 0.85rem;
    }
    
    .modal-content {
        padding: 0.8rem;
        margin: 2% auto;
    }
    
    .tool-interface h2 {
        font-size: 1.3rem;
    }
    
    .file-upload-section,
    .compression-settings {
        padding: 0.8rem;
    }
    
    .upload-label {
        padding: 1.2rem 0.6rem;
        font-size: 0.85rem;
    }
    
    .upload-label i {
        font-size: 1.8rem;
    }
    
    .setting-group label {
        font-size: 0.85rem;
    }
    
    .setting-group input[type="number"],
    .setting-group select {
        padding: 0.6rem;
        font-size: 0.85rem;
    }
    
    .compress-btn, .reset-btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.85rem;
    }
    
    .original, .compressed {
        padding: 0.8rem;
    }
    
    .stats p {
        font-size: 0.8rem;
        padding: 0.4rem;
    }
    
    .download-btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.85rem;
    }
}

/* تحسينات للشاشات الطويلة (أجهزة محمولة حديثة) */
@media (min-height: 800px) and (max-width: 768px) {
    .hero {
        padding: 120px 15px 80px;
    }
    
    .tools-section {
        padding: 4rem 15px;
    }
    
    .about-section {
        padding: 4rem 15px;
    }
    
    .modal-content {
        margin: 8% auto;
    }
}

/* تحسينات للشاشات العريضة (أجهزة محمولة حديثة) */
@media (min-width: 400px) and (max-width: 480px) {
    .tools-grid {
        gap: 1rem;
    }
    
    .tool-card {
        padding: 1.2rem;
    }
    
    .modal-content {
        width: 96%;
        padding: 1.2rem;
    }
}

/* تحسينات للاتجاه الأفقي على الهواتف */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        padding: 60px 15px 40px;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
    }
    
    .tools-section {
        padding: 2rem 15px;
    }
    
    .about-section {
        padding: 2rem 15px;
    }
    
    .modal-content {
        margin: 5% auto;
        max-height: 90vh;
    }
    
    .file-upload-section,
    .compression-settings {
        padding: 1.2rem;
    }
    
    .comparison {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
}

/* تحسينات إضافية للاستجابة العامة */
@media (max-width: 1200px) {
    .container {
        max-width: 100%;
        padding: 0 20px;
    }
    
    .tools-grid {
        gap: 1.5rem;
    }
    
    .modal-content {
        width: 95%;
        max-width: 900px;
    }
}

@media (max-width: 600px) {
    .hero {
        padding: 80px 10px 50px;
    }
    
    .hero-container {
        padding: 0 0.5rem;
    }
    
    .tools-section {
        padding: 2.5rem 10px;
    }
    
    .about-section {
        padding: 2.5rem 10px;
    }
    
    .footer {
        padding: 1.5rem 10px;
    }
    
    .modal-content {
        margin: 5% auto;
        width: 98%;
        padding: 1rem;
    }
    
    .tool-interface {
        padding: 1rem;
    }
    
    .file-upload-section,
    .compression-settings {
        padding: 1rem;
    }
    
    .upload-label {
        padding: 1.5rem 0.8rem;
    }
    
    .setting-group {
        margin-bottom: 1.2rem;
    }
    
    .action-buttons {
        gap: 0.8rem;
    }
    
    .compress-btn, .reset-btn {
        width: 100%;
        max-width: 200px;
    }
}

/* High-performance mobile mode: reduce heavy effects */
@media (max-width: 768px) {
    .tool-card {
        backdrop-filter: none !important;
        box-shadow: 0 4px 10px rgba(0,0,0,0.06) !important;
        border: 1px solid rgba(0,0,0,0.06) !important;
    }

    .tool-card::before,
    .tool-card::after,
    .tool-button::before {
        display: none !important;
    }

    .tool-icon,
    .tool-button,
    .result-area,
    .file-upload-section,
    .compression-settings,
    .download-btn,
    .modal-content,
    .file-preview img,
    .stats,
    .notification {
        box-shadow: none !important;
        filter: none !important;
    }

    /* Neutralize hover lifts on touch devices */
    .tool-button:hover,
    .download-btn:hover,
    .result-area:hover,
    .file-upload-section:hover,
    .tool-interface input[type="file"]:hover {
        transform: none !important;
    }
}

/* تحسينات للشاشات العالية (أجهزة محمولة حديثة) */
@media (min-height: 700px) and (max-width: 768px) {
    .hero {
        padding: 100px 15px 70px;
    }
    
    .tools-section {
        padding: 3.5rem 15px;
    }
    
    .about-section {
        padding: 3.5rem 15px;
    }
}

/* تحسينات للشاشات العريضة (أجهزة محمولة حديثة) */
@media (min-width: 450px) and (max-width: 600px) {
    .tools-grid {
        gap: 1.2rem;
    }
    
    .tool-card {
        padding: 1.3rem;
    }
    
    .modal-content {
        width: 97%;
        padding: 1.3rem;
    }
}

/* تحسينات للاتجاه الأفقي على الأجهزة اللوحية */
@media (max-width: 1024px) and (orientation: landscape) and (min-height: 600px) {
    .hero {
        padding: 80px 20px 50px;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .tools-section {
        padding: 3rem 20px;
    }
    
    .about-section {
        padding: 3rem 20px;
    }
    
    .modal-content {
        margin: 3% auto;
        max-height: 85vh;
    }
    
    .comparison {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
    
    .file-details {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* تحسينات للأداء على الأجهزة الضعيفة */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Performance: disable animations/transitions on tool cards (mobile speed) */
.tool-card,
.tool-card *,
.tool-card::before,
.tool-card::after {
    animation: none !important;
    transition: none !important;
}

.tool-card {
    transform: none !important;
}

.tool-card::before,
.tool-card::after {
    display: none !important;
}

.tool-card:hover,
.tool-card:active {
    transform: none !important;
    box-shadow: 
        0 20px 40px rgba(0,0,0,0.08),
        0 8px 16px rgba(0,0,0,0.06),
        inset 0 1px 0 rgba(255,255,255,0.8) !important;
    border-color: rgba(255,255,255,0.2) !important;
}

.tool-card:hover .tool-icon,
.tool-card:hover .tool-icon i,
.tool-card:hover h3,
.tool-card:hover p {
    transform: none !important;
    text-shadow: none !important;
}

/* تحسينات للوضع المظلم (إذا كان مدعوماً) */
@media (prefers-color-scheme: dark) {
    .modal-content {
        background: #1a1a1a;
        color: #ffffff;
    }
    
    .tool-interface input,
    .tool-interface textarea,
    .tool-interface select {
        background: #2a2a2a;
        color: #ffffff;
        border-color: #444;
    }
    
    .result-area {
        background: #2a2a2a;
        border-color: #444;
    }
    
    .file-upload-section {
        background: #2a2a2a;
        border-color: #444;
    }
    
    .compression-settings {
        background: #2a2a2a;
        border-color: #444;
    }
    
    .notification {
        background: #2a2a2a;
        color: #ffffff;
        border-color: #444;
    }
}

/* تحسينات للطباعة */
@media print {
    .header,
    .navbar,
    .nav-toggle,
    .modal,
    .notification {
        display: none !important;
    }
    
    .hero,
    .tools-section,
    .about-section,
    .footer {
        padding: 1rem 0;
    }
    
    .tool-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .modal-content {
        position: static;
        transform: none;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* تحسينات إضافية للموبايل */
@media (max-width: 480px) {
    .mobile-close-btn {
        top: 15px !important;
        right: 15px !important;
        width: 35px !important;
        height: 35px !important;
        font-size: 16px !important;
    }
    
    .mobile-message {
        font-size: 0.8rem;
        padding: 8px;
        background: rgba(102, 126, 234, 0.1);
        border-radius: 8px;
        margin: 8px 0;
    }
    
    .tool-interface h2 {
        font-size: 1.3rem;
        text-align: center;
    }
    
    .file-upload-section {
        margin-bottom: 1rem;
    }
    
    .compression-settings {
        margin-bottom: 1rem;
    }
    
    .action-buttons {
        margin-top: 1rem;
    }
    
    .comparison {
        margin-top: 1rem;
    }
    
    .download-section {
        margin-top: 1rem;
        text-align: center;
    }
}

/* تحسينات للشاشات الصغيرة جداً */
@media (max-width: 360px) {
    .mobile-close-btn {
        top: 10px !important;
        right: 10px !important;
        width: 30px !important;
        height: 30px !important;
        font-size: 14px !important;
    }
    
    .mobile-message {
        font-size: 0.75rem;
        padding: 6px;
    }
    
    .tool-interface {
        padding: 0.8rem;
    }
    
    .file-upload-section,
    .compression-settings {
        padding: 0.8rem;
    }
    
    .upload-label {
        padding: 1rem 0.6rem;
    }
    
    .setting-group {
        margin-bottom: 0.8rem;
    }
    
    .action-buttons {
        gap: 0.6rem;
    }
    
    .compress-btn, .reset-btn {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
}

/* تحسينات للاتجاه الأفقي على الهواتف */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        padding: 60px 15px 40px;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
    }
    
    .tools-section {
        padding: 2rem 15px;
    }
    
    .about-section {
        padding: 2rem 15px;
    }
    
    .modal-content {
        margin: 5% auto;
        max-height: 90vh;
    }
    
    .file-upload-section,
    .compression-settings {
        padding: 1.2rem;
    }
    
    .comparison {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
}

/* تحسينات للأداء على الأجهزة الضعيفة */
@media (prefers-reduced-motion: reduce) {
    .tool-card,
    .tool-icon,
    .tool-button,
    .modal-content,
    .notification {
        transition: none;
        animation: none;
    }
    
    .tool-card::before,
    .tool-card::after,
    .tool-icon::before,
    .tool-button::before {
        display: none;
    }
}

/* تحسينات للوضع المظلم (إذا كان مدعوماً) */
@media (prefers-color-scheme: dark) {
    .modal-content {
        background: #1a1a1a;
        color: #ffffff;
    }
    
    .tool-interface input,
    .tool-interface textarea,
    .tool-interface select {
        background: #2a2a2a;
        color: #ffffff;
        border-color: #444;
    }
    
    .result-area {
        background: #2a2a2a;
        border-color: #444;
    }
    
    .file-upload-section {
        background: #2a2a2a;
        border-color: #444;
    }
    
    .compression-settings {
        background: #2a2a2a;
        border-color: #444;
    }
    
    .notification {
        background: #2a2a2a;
        color: #ffffff;
        border-color: #444;
    }
}

/* تحسينات للطباعة */
@media print {
    .header,
    .navbar,
    .nav-toggle,
    .modal,
    .notification {
        display: none !important;
    }
    
    .compression-results {
        page-break-inside: avoid;
    }
    
    .comparison {
        grid-template-columns: 1fr 1fr;
    }
}

/* تحسينات إضافية لأداة ضاغط الصور */
.image-container {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.image-container img {
    transition: all 0.3s ease;
    cursor: pointer;
}

.image-container img:hover {
    transform: scale(1.05);
}

/* تحسين الإحصائيات */
.stats p {
    background: linear-gradient(145deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1rem;
    border-radius: 12px;
    margin: 0.8rem 0;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.stats p:hover {
    transform: translateX(5px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

/* تحسين الأزرار */
.compress-btn, .reset-btn, .download-btn {
    position: relative;
    overflow: hidden;
}

.compress-btn::before, .reset-btn::before, .download-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.compress-btn:hover::before, .reset-btn:hover::before, .download-btn:hover::before {
    left: 100%;
}

/* تحسينات للوضع المظلم */
body.dark-mode .image-container {
    box-shadow: 0 5px 15px rgba(0,0,0,0.4);
}

body.dark-mode .stats p {
    background: linear-gradient(145deg, #2c3e50 0%, #34495e 100%);
    color: #ecf0f1;
    border-left-color: #667eea;
}

body.dark-mode .stats p:hover {
    background: linear-gradient(145deg, #34495e 0%, #2c3e50 100%);
}

/* ===== أنماط أداة محول PDF ===== */
.conversion-options {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border: 2px solid #e1e5e9;
}

.conversion-options h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    font-weight: 600;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.option-group {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: linear-gradient(145deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.option-group:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-color: #667eea;
}

.option-group label {
    display: block;
    margin-bottom: 0.8rem;
    font-weight: 600;
    color: #2c3e50;
    font-size: 1rem;
}

.option-group select,
.option-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 1rem;
    background: white;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
}

.option-group select:focus,
.option-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.option-group textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

.option-group small {
    display: block;
    margin-top: 0.5rem;
    color: #6c757d;
    font-size: 0.85rem;
    font-style: italic;
}

.pdf-settings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.setting-item label {
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.setting-item select {
    padding: 10px 12px;
    font-size: 0.9rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.convert-btn, .reset-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 15px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Cairo', sans-serif;
    position: relative;
    overflow: hidden;
}

.convert-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.convert-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(102, 126, 234, 0.4);
}

.reset-btn {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(108, 117, 125, 0.3);
}

.reset-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(108, 117, 125, 0.4);
}

.convert-btn::before, .reset-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.convert-btn:hover::before, .reset-btn:hover::before {
    left: 100%;
}

.conversion-results {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    text-align: center;
    animation: slideInUp 0.6s ease-out;
}

.conversion-results h3 {
    color: #28a745;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.pdf-info {
    margin-bottom: 2rem;
}

.pdf-info p {
    background: linear-gradient(145deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1rem;
    border-radius: 12px;
    margin: 0.8rem 0;
    border-left: 4px solid #28a745;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.download-section {
    margin-top: 1.5rem;
}

.download-btn {
    padding: 1.2rem 2.5rem;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Cairo', sans-serif;
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.3);
    position: relative;
    overflow: hidden;
}

.download-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(40, 167, 69, 0.4);
}

.download-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.download-btn:hover::before {
    left: 100%;
}

/* تحسينات للموبايل */
@media (max-width: 768px) {
    .conversion-options {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .conversion-options h3 {
        font-size: 1.2rem;
        margin-bottom: 1.2rem;
    }
    
    .option-group {
        padding: 0.8rem;
        margin-bottom: 1rem;
    }
    
    .option-group label {
        font-size: 0.95rem;
        margin-bottom: 0.6rem;
    }
    
    .option-group select,
    .option-group textarea {
        padding: 10px 12px;
        font-size: 0.95rem;
    }
    
    .option-group textarea {
        min-height: 100px;
    }
    
    .pdf-settings {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .setting-item select {
        padding: 8px 10px;
        font-size: 0.9rem;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 0.8rem;
        margin: 1.5rem 0;
    }
    
    .convert-btn, .reset-btn {
        width: 100%;
        justify-content: center;
        padding: 1rem 2rem;
        font-size: 1rem;
    }
    
    .conversion-results {
        padding: 1.5rem;
    }
    
    .conversion-results h3 {
        font-size: 1.3rem;
        margin-bottom: 1.2rem;
    }
    
    .pdf-info p {
        padding: 0.8rem;
        font-size: 0.9rem;
        margin: 0.6rem 0;
    }
    
    .download-btn {
        width: 100%;
        justify-content: center;
        padding: 1rem 2rem;
        font-size: 1rem;
    }
}

/* تحسينات للشاشات الصغيرة */
@media (max-width: 480px) {
    .conversion-options {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .conversion-options h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    .option-group {
        padding: 0.6rem;
        margin-bottom: 0.8rem;
    }
    
    .option-group label {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    .option-group select,
    .option-group textarea {
        padding: 8px 10px;
        font-size: 0.9rem;
    }
    
    .option-group textarea {
        min-height: 80px;
    }
    
    .pdf-settings {
        gap: 0.6rem;
    }
    
    .setting-item select {
        padding: 6px 8px;
        font-size: 0.85rem;
    }
    
    .action-buttons {
        margin: 1rem 0;
    }
    
    .convert-btn, .reset-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .conversion-results {
        padding: 1rem;
    }
    
    .conversion-results h3 {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }
    
    .pdf-info p {
        padding: 0.6rem;
        font-size: 0.85rem;
        margin: 0.5rem 0;
    }
    
    .download-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* دعم الوضع المظلم */
body.dark-mode .conversion-options {
    background: linear-gradient(145deg, #2c3e50 0%, #34495e 100%);
    color: #ecf0f1;
    border-color: #5a6c7d;
}

body.dark-mode .conversion-options h3 {
    color: #ecf0f1;
}

body.dark-mode .option-group {
    background: linear-gradient(145deg, #34495e 0%, #2c3e50 100%);
    color: #ecf0f1;
    border-color: #5a6c7d;
}

body.dark-mode .option-group label {
    color: #ecf0f1;
}

body.dark-mode .option-group select,
body.dark-mode .option-group textarea {
    background: #2c3e50;
    color: #ecf0f1;
    border-color: #5a6c7d;
}

body.dark-mode .option-group select:focus,
body.dark-mode .option-group textarea:focus {
    border-color: #667eea;
    background: #2c3e50;
}

body.dark-mode .option-group small {
    color: #bdc3c7;
}

body.dark-mode .conversion-results {
    background: linear-gradient(145deg, #2c3e50 0%, #34495e 100%);
    color: #ecf0f1;
}

body.dark-mode .conversion-results h3 {
    color: #28a745;
}

body.dark-mode .pdf-info p {
    background: linear-gradient(145deg, #2c3e50 0%, #34495e 100%);
    color: #ecf0f1;
    border-left-color: #28a745;
}

/* تحسينات للرسوم المتحركة */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* تطبيق الرسوم المتحركة */
.image-settings,
.image-results {
    animation: fadeIn 0.6s ease-out;
}

.setting-group {
    animation: slideInUp 0.4s ease-out;
}

.setting-group:nth-child(1) { animation-delay: 0.1s; }
.setting-group:nth-child(2) { animation-delay: 0.2s; }
.setting-group:nth-child(3) { animation-delay: 0.3s; }
.setting-group:nth-child(4) { animation-delay: 0.4s; }

.action-buttons {
    animation: slideInUp 0.5s ease-out;
}

.image-container {
    animation: scaleIn 0.6s ease-out;
}

.image-info {
    animation: slideInUp 0.7s ease-out;
}

.download-section {
    animation: slideInUp 0.8s ease-out;
}

/* تحسينات الانتقالات */
.image-settings,
.image-results,
.setting-group,
.action-buttons,
.image-container,
.image-info,
.download-section {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* تحسينات للتفاعل */
.setting-group:hover {
    transform: translateY(-2px);
}

.image-container:hover {
    transform: scale(1.02);
}

/* تحسينات للوضع المظلم */
body.dark-mode .image-settings,
body.dark-mode .image-results {
    transition: background 0.3s ease, border-color 0.3s ease;
}

body.dark-mode .setting-group input,
body.dark-mode .setting-group select {
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* ===== تحسينات الأداء ===== */
@media (prefers-reduced-motion: reduce) {
    .image-settings,
    .image-results,
    .setting-group,
    .action-buttons,
    .image-container,
    .image-info,
    .download-section {
        animation: none;
        transition: none;
    }
    
    .generate-btn::before,
    .reset-btn::before,
    .download-btn::before,
    .copy-btn::before {
        display: none;
    }
    
    .setting-group:hover,
    .image-container:hover {
        transform: none;
    }
}

/* ===== تحسينات للطباعة ===== */
@media print {
    .image-settings,
    .action-buttons,
    .download-section {
        display: none;
    }
    
    .image-results {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .image-container img {
        max-width: 100%;
        height: auto;
    }
}

/* ===== تحسينات للأداء ===== */
.image-settings,
.image-results,
.setting-group,
.action-buttons,
.image-container,
.image-info,
.download-section {
    will-change: transform, opacity;
}

.generate-btn,
.reset-btn,
.download-btn,
.copy-btn {
    will-change: transform, box-shadow;
}

.setting-group input,
.setting-group select {
    will-change: border-color, box-shadow, transform;
}

/* ===== تحسينات للذاكرة ===== */
.image-container img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* ===== تحسينات للشبكة ===== */
@media (max-width: 768px) {
    .image-container img {
        image-rendering: auto;
    }
}

/* ===== تحسينات إضافية للوضع المظلم ===== */
body.dark-mode .image-settings {
    background: linear-gradient(145deg, #1a252f 0%, #2c3e50 100%);
    color: #ecf0f1;
    border-color: #34495e;
}

body.dark-mode .image-settings h3 {
    color: #ecf0f1;
}

body.dark-mode .image-settings h3 i {
    color: #3498db;
}

body.dark-mode .setting-group label {
    color: #bdc3c7;
}

body.dark-mode .setting-group input,
body.dark-mode .setting-group select {
    background: #34495e;
    border-color: #5a6c7d;
    color: #ecf0f1;
}

body.dark-mode .setting-group input:focus,
body.dark-mode .setting-group select:focus {
    border-color: #3498db;
    background: #2c3e50;
}

body.dark-mode .setting-group .unit {
    color: #95a5a6;
}

body.dark-mode .image-results {
    background: linear-gradient(145deg, #1a252f 0%, #2c3e50 100%);
    color: #ecf0f1;
    border-color: #34495e;
}

body.dark-mode .image-results h3 {
    color: #2ecc71;
}

body.dark-mode .image-results h3 i {
    color: #2ecc71;
}

body.dark-mode .image-container {
    background: #34495e;
}

body.dark-mode .image-info {
    background: #2c3e50;
    border-color: #5a6c7d;
    color: #ecf0f1;
}

body.dark-mode .image-info p {
    color: #bdc3c7;
}

body.dark-mode .image-info a {
    color: #3498db;
}

body.dark-mode .image-info a:hover {
    color: #5dade2;
}

/* ===== تحسينات للانتقال بين الأوضاع ===== */
.image-settings,
.image-results,
.setting-group input,
.setting-group select {
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

/* ===== تحسينات للوضع المظلم على الموبايل ===== */
@media (max-width: 768px) {
    body.dark-mode .image-settings {
        background: linear-gradient(145deg, #1a252f 0%, #2c3e50 100%);
    }
    
    body.dark-mode .image-results {
        background: linear-gradient(145deg, #1a252f 0%, #2c3e50 100%);
    }
}

/* ===== تحسينات للوضع المظلم على الشاشات الصغيرة ===== */
@media (max-width: 480px) {
    body.dark-mode .image-settings {
        background: linear-gradient(145deg, #1a252f 0%, #2c3e50 100%);
    }
    
    body.dark-mode .image-results {
        background: linear-gradient(145deg, #1a252f 0%, #2c3e50 100%);
    }
}

/* ===== تحسينات إمكانية الوصول العالية ===== */
@media (prefers-contrast: high) {
    .image-settings,
    .image-results {
        border-width: 3px;
        border-style: solid;
    }
    
    .setting-group input,
    .setting-group select {
        border-width: 3px;
        border-style: solid;
    }
    
    .generate-btn,
    .reset-btn,
    .download-btn,
    .copy-btn {
        border: 3px solid #000;
    }
    
    .image-container {
        border: 3px solid #000;
    }
    
    .image-info {
        border-width: 3px;
        border-style: solid;
    }
}

/* ===== تحسينات للقراءة ===== */
@media (prefers-reduced-motion: no-preference) {
    .image-settings,
    .image-results {
        scroll-behavior: smooth;
    }
}

/* ===== تحسينات للشاشات عالية الدقة ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .image-container img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ===== تحسينات للشاشات منخفضة الدقة ===== */
@media (-webkit-max-device-pixel-ratio: 1), (max-resolution: 96dpi) {
    .image-container img {
        image-rendering: pixelated;
    }
}

/* ===== تحسينات للطباعة ===== */
@media print and (color) {
    .image-settings,
    .image-results {
        border-color: #000;
        background: #fff;
        color: #000;
    }
    
    .setting-group input,
    .setting-group select {
        border-color: #000;
        background: #fff;
        color: #000;
    }
    
    .generate-btn,
    .reset-btn,
    .download-btn,
    .copy-btn {
        border: 1px solid #000;
        background: #fff;
        color: #000;
    }
}

/* ===== تحسينات للشاشات الكبيرة ===== */
@media (min-width: 1200px) {
    .image-settings {
        max-width: 800px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .image-results {
        max-width: 800px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* ===== تحسينات للشاشات المتوسطة ===== */
@media (min-width: 768px) and (max-width: 1199px) {
    .image-settings {
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .image-results {
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* ===== أنماط التحميل والأخطاء ===== */
.loading-container {
    text-align: center;
    padding: 2rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-container {
    text-align: center;
    padding: 2rem;
    color: #e74c3c;
}

.error-container i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #e74c3c;
}

.error-container p {
    margin-bottom: 1rem;
    color: #e74c3c;
    font-weight: 500;
}

/* ===== أنماط الوضع المظلم للتحميل والأخطاء ===== */
body.dark-mode .spinner {
    border-color: #34495e;
    border-top-color: #3498db;
}

body.dark-mode .error-container {
    color: #e74c3c;
}

body.dark-mode .error-container i {
    color: #e74c3c;
}

body.dark-mode .error-container p {
    color: #e74c3c;
}

/* ===== الاستجابة للموبايل ===== */
@media (max-width: 768px) {
    .image-settings {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .image-settings h3 {
        font-size: 1.2rem;
        text-align: center;
        justify-content: center;
    }
    
    .setting-group {
        margin-bottom: 1.25rem;
    }
    
    .setting-group input,
    .setting-group select {
        padding: 0.7rem 0.8rem;
        font-size: 0.95rem;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }
    
    .generate-btn,
    .reset-btn {
        padding: 0.9rem 1.5rem;
        font-size: 0.95rem;
        min-width: 100%;
    }
    
    .image-results {
        padding: 1.5rem;
    }
    
    .image-results h3 {
        font-size: 1.2rem;
        margin-bottom: 1.25rem;
    }
    
    .image-container {
        padding: 0.75rem;
        margin-bottom: 1.25rem;
    }
    
    .image-info {
        padding: 1.25rem;
        margin-bottom: 1.25rem;
    }
    
    .image-info p {
        font-size: 0.9rem;
        margin-bottom: 0.6rem;
    }
    
    .download-section {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .download-btn,
    .copy-btn {
        padding: 0.8rem 1.25rem;
        font-size: 0.9rem;
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    .image-settings {
        padding: 1.25rem;
        border-radius: 15px;
    }
    
    .image-settings h3 {
        font-size: 1.1rem;
    }
    
    .setting-group input,
    .setting-group select {
        padding: 0.6rem 0.7rem;
        font-size: 0.9rem;
        border-radius: 10px;
        min-height: 44px; /* لتحسين التفاعل باللمس */
    }
    
    .generate-btn,
    .reset-btn {
        padding: 0.8rem 1.25rem;
        font-size: 0.9rem;
        border-radius: 12px;
        min-height: 48px; /* لتحسين التفاعل باللمس */
    }
    
    .image-results {
        padding: 1.25rem;
        border-radius: 15px;
    }
    
    .image-results h3 {
        font-size: 1.1rem;
    }
    
    .image-container {
        padding: 0.5rem;
        border-radius: 12px;
    }
    
    .image-info {
        padding: 1rem;
        border-radius: 12px;
    }
    
    .download-btn,
    .copy-btn {
        padding: 0.7rem 1rem;
        font-size: 0.85rem;
        border-radius: 10px;
        min-height: 44px; /* لتحسين التفاعل باللمس */
    }
}

@media (max-width: 360px) {
    .image-settings {
        padding: 0.75rem;
        border-radius: 10px;
    }
    
    .image-settings h3 {
        font-size: 0.95rem;
    }
    
    .setting-group input,
    .setting-group select {
        padding: 0.5rem 0.6rem;
        font-size: 0.85rem;
        border-radius: 6px;
    }
    
    .generate-btn,
    .reset-btn {
        padding: 0.7rem 0.8rem;
        font-size: 0.85rem;
        border-radius: 8px;
    }
    
    .download-btn,
    .copy-btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.8rem;
        border-radius: 6px;
    }
}

/* ===== تحسينات للتفاعل باللمس ===== */
@media (hover: none) and (pointer: coarse) {
    .generate-btn:hover,
    .reset-btn:hover,
    .download-btn:hover,
    .copy-btn:hover {
        transform: none;
        box-shadow: none;
    }
    
    .setting-group input:hover,
    .setting-group select:hover {
        transform: none;
        border-color: #e1e5e9;
    }
    
    .setting-group input:focus,
    .setting-group select:focus {
        transform: none;
    }
}

/* ===== تحسينات إمكانية الوصول ===== */
.generate-btn:focus,
.reset-btn:focus,
.download-btn:focus,
.copy-btn:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.setting-group input:focus,
.setting-group select:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* ===== تحسينات للتنقل بالكيبورد ===== */
.generate-btn:focus-visible,
.reset-btn:focus-visible,
.download-btn:focus-visible,
.copy-btn:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.setting-group input:focus-visible,
.setting-group select:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* ===== تحسينات للقراءة ===== */
.image-settings h3,
.image-results h3 {
    font-weight: 700;
    letter-spacing: 0.5px;
}

.setting-group label {
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* ===== تحسينات للتباين ===== */
.image-info p {
    line-height: 1.6;
}

.image-info a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ===== تحسينات للوضع المظلم ===== */
body.dark-mode .generate-btn:focus,
body.dark-mode .reset-btn:focus,
body.dark-mode .download-btn:focus,
body.dark-mode .copy-btn:focus {
    outline-color: #5dade2;
}

body.dark-mode .setting-group input:focus,
body.dark-mode .setting-group select:focus {
    outline-color: #5dade2;
}

body.dark-mode .image-info a {
    text-decoration-color: #5dade2;
}

/* ===== أنماط الأزرار المعطلة ===== */
.generate-btn:disabled,
.reset-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.generate-btn:disabled:hover,
.reset-btn:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* ===== تأثيرات النقر ===== */
.generate-btn:active,
.reset-btn:active,
.download-btn:active,
.copy-btn:active {
    transform: scale(0.95);
    transition: transform 0.15s ease;
}

/* ===== تحسينات إضافية للأزرار ===== */
.generate-btn,
.reset-btn,
.download-btn,
.copy-btn {
    position: relative;
    overflow: hidden;
}

.generate-btn::before,
.reset-btn::before,
.download-btn::before,
.copy-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.generate-btn:hover::before,
.reset-btn:hover::before,
.download-btn:hover::before,
.copy-btn:hover::before {
    left: 100%;
}

/* ===== أنماط التحقق من صحة المدخلات ===== */
.setting-group input.error,
.setting-group select.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
    animation: shake 0.5s ease-in-out;
}

.setting-group input.success,
.setting-group select.success {
    border-color: #27ae60;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ===== تحسينات إضافية للحقول ===== */
.setting-group input:focus,
.setting-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

.setting-group input:hover,
.setting-group select:hover {
    border-color: #bdc3c7;
    transform: translateY(-1px);
}

/* ===== أنماط الوحدات ===== */
.setting-group .unit {
    color: #7f8c8d;
    font-size: 0.85rem;
    margin-top: 0.25rem;
    font-weight: 500;
    opacity: 0.8;
}

/* ===== تحسينات للوضع المظلم ===== */
body.dark-mode .setting-group input.error,
body.dark-mode .setting-group select.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2);
}

body.dark-mode .setting-group input.success,
body.dark-mode .setting-group select.success {
    border-color: #2ecc71;
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.2);
}

body.dark-mode .setting-group input:focus,
body.dark-mode .setting-group select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

body.dark-mode .setting-group input:hover,
body.dark-mode .setting-group select:hover {
    border-color: #5a6c7d;
}
