/* تعديلات عامة */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', 'Tajawal', sans-serif;
}

:root {
    --primary-color: #007BFF;
    --secondary-color: #6C757D;
    --accent-color: #FFC107;
    --text-color: #212529;
    --light-bg: #F8F9FA;
    --dark-bg: #343a40; /* Kept original dark-bg as it was not in the palette */
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    background-color: var(--light-bg);
    color: var(--text-color);
    line-height: 1.8;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

img {
    max-width: 100%;
    height: auto;
}

/* رأس الصفحة والشعار */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    background-color: #fff;
    box-shadow: var(--box-shadow);
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 60px;
    margin-left: 1rem;
}

.logo .site-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0;
    color: var(--text-color);
}

/* القائمة العلوية */
.navbar {
    background: #fff;
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar ul {
    list-style: none;
    display: flex;
    justify-content: flex-end;
    gap: 2rem;
}

.navbar li a {
    text-decoration: none;
    color: var(--text-color);
    padding: 0.8rem 1.2rem;
    transition: var(--transition);
    font-weight: 600;
    border-radius: var(--border-radius);
}

.navbar li a:hover,
.navbar li a.active {
    background: var(--primary-color);
    color: #fff;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

/* قسم hero */
.hero {
    text-align: center;
    padding: 8rem 0;
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('hero-bg.jpg') no-repeat center/cover;
    color: #fff;
    position: relative;
}

.hero .container {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero p {
    font-size: 1.4rem;
    margin-bottom: 2.5rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.cta-btn {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    padding: 1rem 2.5rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    box-shadow: var(--box-shadow);
    text-decoration: none;
}

.cta-btn:hover {
    background: #1da856;
    transform: translateY(-3px);
}

/* قسم المميزات */
.features {
    padding: 5rem 0;
    background-color: #fff;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--accent-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-10px);
}

.feature-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

/* قسم about */
.about {
    padding: 5rem 0;
    background-color: var(--light-bg);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.about-image {
    width: 100%;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.about-text h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
}

.about-text p {
    margin-bottom: 1.5rem;
}

/* قسم الشهادات */
.testimonials {
    padding: 5rem 0;
    background-color: #fff;
}

.testimonials-slider {
    max-width: 800px;
    margin: 0 auto;
}

.testimonial-card {
    background: var(--light-bg);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin: 1rem;
    text-align: center;
    box-shadow: var(--box-shadow);
}

.testimonial-text {
    font-style: italic;
    margin-bottom: 1.5rem;
}

.testimonial-author {
    font-weight: 600;
    color: var(--secondary-color);
}

/* قسم contact */
.contact {
    padding: 5rem 0;
    background-color: var(--light-bg);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.contact-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.contact form {
    background: #fff;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
}

.form-control {
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.submit-btn {
    background: var(--primary-color);
    color: #fff;
    padding: 1rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
}

.submit-btn:hover {
    background: #1da856;
}

/* تذييل الصفحة */
.footer {
    background-color: var(--dark-bg);
    color: #fff;
    padding: 4rem 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-logo img {
    height: 60px;
    margin-bottom: 1rem;
}

.footer-logo p {
    margin-bottom: 1.5rem;
}

.footer-links h4,
.footer-contact h4 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

.footer-links h4::after,
.footer-contact h4::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 0;
    width: 50px;
    height: 3px;
    background-color: var(--primary-color);
}

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

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: #ddd;
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-contact p {
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
}

.footer-contact i {
    margin-left: 0.8rem;
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* زر WhatsApp العائم */
.whatsapp-icon {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 99;
    transition: all 0.3s ease;
    opacity: 0;
    transform: scale(0.8);
}

.whatsapp-icon.show {
    opacity: 1;
    transform: scale(1);
}

.whatsapp-icon:hover {
    transform: scale(1.1);
}

/* نافذة الدردشة المنبثقة */
.chat-popup {
    position: fixed;
    bottom: 100px;
    left: 30px;
    width: 350px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 999;
    overflow: hidden;
    display: none;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
}

.chat-popup.active {
    display: block;
    transform: translateY(0);
    opacity: 1;
}

.chat-header {
    background-color: var(--primary-color);
    color: #fff;
    padding: 1rem;
    display: flex;
    align-items: center;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
}

.chat-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-left: 1rem;
}

.chat-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
}

.chat-info p {
    font-size: 0.8rem;
    opacity: 0.8;
}

.chat-messages {
    padding: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

.message {
    margin-bottom: 1rem;
    padding: 0.8rem;
    border-radius: 10px;
    max-width: 80%;
}

.message.received {
    background-color: #f1f1f1;
    align-self: flex-start;
}

.message.sent {
    background-color: var(--primary-color);
    color: #fff;
    align-self: flex-end;
    margin-right: auto;
}

.chat-input {
    display: flex;
    padding: 1rem;
    border-top: 1px solid #eee;
}

.chat-input input {
    flex: 1;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 20px;
    margin-left: 0.5rem;
}

.send-btn {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

/* تحسينات للأجهزة المحمولة */
@media (max-width: 992px) {
    .hero h1 {
        font-size: 2.8rem;
    }
    
    .hero p {
        font-size: 1.2rem;
    }
    
    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
    }
    
    .about-image {
        order: -1;
        margin-bottom: 2rem;
    }
    
    .section-title h2 {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    
    .navbar ul {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background-color: #fff;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding-top: 5rem;
        transition: all 0.3s ease;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        z-index: 1000;
    }
    
    .navbar ul.show {
        right: 0;
    }
    
    .navbar li {
        margin: 1rem 0;
    }
    
    .hero {
        padding: 6rem 0;
    }
    
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-links h4::after,
    .footer-contact h4::after {
        left: 50%;
        transform: translateX(-50%);
        right: auto;
    }
    
    .footer-contact p {
        justify-content: center;
    }
    
    .chat-popup {
        width: 300px;
        left: 10px;
        bottom: 80px;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 1rem;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .cta-btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
    
    .section-title h2 {
        font-size: 1.8rem;
    }
    
    .feature-card,
    .testimonial-card {
        padding: 1.5rem;
    }
    
    .chat-popup {
        width: calc(100% - 20px);
        left: 10px;
    }
    
    .whatsapp-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
        bottom: 20px;
        left: 20px;
    }
}

/* تحسينات لسرعة التحميل */
.lazy-load {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lazy-load.loaded {
    opacity: 1;
}

/* تحسين تحميل الخطوط */
@font-face {
    font-family: 'Cairo';
    font-display: swap;
}

@font-face {
    font-family: 'Tajawal';
    font-display: swap;
}

/* تحسين الصور */
img {
    max-width: 100%;
    height: auto;
    loading: lazy;
}

/* تحسينات للطباعة */
@media print {
    .navbar,
    .footer,
    .whatsapp-icon,
    .chat-popup,
    .cta-btn {
        display: none !important;
    }
    
    body {
        background-color: #fff;
        color: #000;
    }
    
    .container {
        width: 100%;
        max-width: 100%;
        padding: 0;
    }
    
    .hero {
        background: none;
        color: #000;
        padding: 2rem 0;
    }
    
    .hero h1 {
        color: #000;
        text-shadow: none;
    }
    
    .section-title h2 {
        color: #000;
    }
    
    .section-title h2::after {
        display: none;
    }
}

/* تحسينات لذوي الاحتياجات الخاصة */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* تحسينات لصفحة المنتجات */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.product-card {
    background: #fff;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    position: relative; /* Added this line */
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.product-content {
    padding: 1.5rem;
}

.product-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.product-btn {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    margin-top: 1rem;
}

.product-btn:hover {
    background: #1da856;
}

/* تحسينات لصفحة الأسئلة الشائعة */
.faq-item {
    background: #fff;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.faq-question {
    padding: 1.5rem;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.faq-question:hover {
    background-color: #f9f9f9;
}

.faq-question i {
    transition: transform 0.3s ease;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.active .faq-answer {
    padding: 0 1.5rem 1.5rem;
    max-height: 1000px;
}

/* تحسينات لصفحة المدونة */
.blog-section {
    padding: 4rem 0;
}

.post-card {
    background: #fff;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.post-image {
    height: 200px;
    overflow: hidden;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-card:hover .post-image img {
    transform: scale(1.05);
}

.post-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-date {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.post-content h4 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.read-more {
    margin-top: auto;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    transition: var(--transition);
}

.read-more i {
    margin-right: 0.5rem;
    transition: transform 0.3s ease;
}

.read-more:hover {
    color: var(--secondary-color);
}

.read-more:hover i {
    transform: translateX(-5px);
}

/* تحسينات إضافية للأجهزة المحمولة */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .hero {
        padding: 4rem 0;
    }
    
    .hero h1 {
        font-size: 1.6rem;
    }
    
    .section-title h2 {
        font-size: 1.6rem;
    }
    
    .feature-icon {
        font-size: 2.5rem;
    }
    
    .feature-card h3 {
        font-size: 1.3rem;
    }
    
    .footer {
        padding: 3rem 0 1.5rem;
    }
    
    .footer-content {
        gap: 2rem;
    }
}

/* تحسينات لتسريع التحميل */
.preload-image {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* تحسينات للتوافق مع الأجهزة اللوحية */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 90%;
    }
    
    .hero h1 {
        font-size: 3rem;
    }
    
    .features-grid,
    .products-grid,
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* تحسينات للشاشات الكبيرة */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    html {
        font-size: 18px;
    }
}
