/* 
 * AlfaX10 Website Styles
 * A modern, dark-themed responsive website with blue and yellow accents
 * Version: 1.1
 * Date: June 24, 2025
 * Updates: Added bilingual support (English and Arabic) with RTL layout
 */

/* ===== Base Styles and Reset ===== */
:root {
    /* Color Variables */
    --bg-dark: #121212;
    --bg-dark-lighter: #1f1f1f;
    --bg-dark-lightest: #2d2d2d;
    --text-white: #ffffff;
    --text-gray: #a0a0a0;
    --accent-blue: #00BFFF;
    --accent-yellow: #FFD700;
    --accent-blue-dark: #0099cc;
    --accent-yellow-dark: #e6c200;
    
    /* Font Variables */
    --font-english: 'Inter', 'Poppins', sans-serif;
    --font-arabic: 'Cairo', 'Tajawal', sans-serif;
    
    /* Language specific variables */
    --font-arabic: 'Cairo', 'Tajawal', sans-serif;

    /* Spacing Variables */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;
    --spacing-xxl: 8rem; /* Extra extra large spacing */

    /* Border Radius */
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 16px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-english);
    background-color: var(--bg-dark);
    color: var(--text-white);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
}

h1 {
    font-size: 3.5rem;
    margin-bottom: var(--spacing-md);
}

h2 {
    font-size: 2.5rem;
}

h3 {
    font-size: 1.75rem;
}

h4 {
    font-size: 1.25rem;
}

p {
    margin-bottom: var(--spacing-sm);
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-blue-dark);
}

ul {
    list-style: none;
}

/* ===== Utility Classes ===== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

.accent-blue {
    color: var(--accent-blue);
}

.accent-yellow {
    color: var(--accent-yellow);
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.section-divider {
    height: 4px;
    width: 60px;
    background: linear-gradient(to right, var(--accent-blue), var(--accent-yellow));
    margin: var(--spacing-sm) auto;
    border-radius: var(--border-radius-sm);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-md);
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    border: none;
    min-width: 120px;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--accent-blue);
    color: var(--text-white);
}

.btn-primary:hover {
    background-color: var(--accent-blue-dark);
    color: var(--text-white);
}

.btn-secondary {
    background-color: transparent;
    border: 2px solid var(--accent-yellow);
    color: var(--accent-yellow);
}

.btn-secondary:hover {
    background-color: var(--accent-yellow);
    color: var(--bg-dark);
}

.image-placeholder {
    background-color: var(--bg-dark-lighter);
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    font-size: 4rem;
    color: var(--accent-blue);
}

.image-placeholder.small {
    min-height: 60px;
    min-width: 60px;
    font-size: 1.5rem;
    border-radius: 50%;
}

/* ===== Header Styles ===== */
#header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: all var(--transition-normal);
}

#header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    height: 80px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    height: 100%;
    position: relative;
    z-index: 1001; /* Ensure logo appears above other elements */
}

.logo-text {
    color: var(--text-white);
}

.logo a {
    color: var(--text-white);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.nav-links {
    display: flex;
    align-items: center; 
    gap: var(--spacing-sm);
    height: 100%;
    margin-top: 0; /* Reset margin to align with the logo */
}

.nav-links li a {
    color: var(--text-white);
    padding: 0.5rem 1rem;
    transition: color var(--transition-fast);
}

.nav-links li a:hover {
    color: var(--accent-yellow);
}

.btn-contact {
    background-color: var(--accent-blue);
    color: var(--text-white) !important;
    border-radius: var(--border-radius-md);
    padding: 0.7rem 1.5rem !important;
    transition: all var(--transition-fast);
    font-weight: 600;
    min-width: 120px;
    text-align: center;
    white-space: nowrap;
    display: inline-block;
}

.btn-contact:hover {
    background-color: var(--accent-blue-dark);
    color: var(--text-white) !important;
}

#menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

#menu-toggle .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px 0;
    background-color: var(--text-white);
    transition: all var(--transition-normal);
}

/* ===== Hero Section ===== */
#hero {
    padding: calc(260px + var(--spacing-xl)) 0 var(--spacing-xl);
    background: linear-gradient(135deg, rgba(0, 20, 50, 0.9), rgba(0, 0, 0, 0.95));
}

#hero .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-lg);
}

.hero-content {
    flex: 1;
}

.hero-image {
    flex: 1;
    position: relative;
}

.hero-img {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius-md);
    object-fit: cover;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    max-height: 400px;
}

.hero-image .image-placeholder {
    display: none; /* Hide the placeholder since we're using an actual image */
}

.hero-content h1 {
    margin-bottom: var(--spacing-md);
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: var(--spacing-md);
    color: var(--text-gray);
}

.hero-cta {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

/* ===== About Section ===== */
#about {
    padding: var(--spacing-xl) 0;
    background-color: var(--bg-dark-lighter);
}

.about-content {
    display: flex;
    gap: var(--spacing-lg);
    align-items: center;
}

.about-text {
    flex: 1;
}

.about-image {
    flex: 1;
    position: relative;
}

.about-img {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius-md);
    object-fit: cover;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    max-height: 400px;
    display: block;
}

.about-stats {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.stat-item {
    text-align: center;
    flex: 1;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-blue);
    margin-bottom: var(--spacing-xs);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-gray);
}

/* ===== Services Section ===== */
#services {
    padding: var(--spacing-xl) 0;
    background-color: var(--bg-dark);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-md);
}

.service-card {
    background-color: var(--bg-dark-lighter);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-md);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.service-icon {
    background-color: var(--bg-dark-lightest);
    color: var(--accent-yellow);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: var(--spacing-sm);
}

.service-image {
    margin-bottom: var(--spacing-md);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    height: 180px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border: 2px solid var(--bg-dark-lightest);
    position: relative;
}

.service-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
    display: block;
}

.service-card:hover .service-img {
    transform: scale(1.05);
}

.service-card h3 {
    margin-top: 0;
    margin-bottom: var(--spacing-xs);
    color: var(--accent-blue);
}

.service-card p {
    margin-bottom: var(--spacing-sm);
}

.service-features {
    margin-top: var(--spacing-sm);
    padding-left: var(--spacing-sm);
    margin-top: auto; /* Push to bottom of flex container */
    padding-top: var(--spacing-sm);
}

.service-features li {
    margin-bottom: var(--spacing-xs);
    position: relative;
    padding-left: var(--spacing-sm);
}

.service-features li:before {
    content: "•";
    color: var(--accent-blue);
    position: absolute;
    left: 0;
}

/* ===== Projects Section ===== */
#projects {
    padding: var(--spacing-xl) 0;
    background-color: var(--bg-dark-lighter);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--spacing-md);
}

.project-card {
    background-color: var(--bg-dark-lighter);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.25);
}

.project-image {
    position: relative;
    height: 280px;
    overflow: hidden;
    border-radius: var(--border-radius-md) var(--border-radius-md) 0 0;
    background-color: var(--bg-dark-lightest);
}

.project-image .image-placeholder {
    height: 100%;
    width: 100%;
    border-radius: 0;
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: all var(--transition-normal);
    padding: var(--spacing-xs);
}

.project-card:hover .project-img {
    transform: scale(1.03);
}

.coming-soon-badge {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    background-color: var(--accent-yellow);
    color: var(--bg-dark);
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    font-size: 0.8rem;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.project-info {
    padding: var(--spacing-md);
    border-top: 2px solid var(--bg-dark);
}

.project-tags {
    display: flex;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-sm);
    flex-wrap: wrap;
}

.project-tags span {
    background-color: var(--bg-dark-lighter);
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem;
    color: var(--accent-blue);
}

/* ===== Testimonials Section ===== */
#testimonials {
    padding: var(--spacing-xl) 0;
    background-color: var(--bg-dark);
}

.testimonials-slider {
    position: relative;
    display: flex;
    overflow-x: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
    padding-bottom: var(--spacing-md);
    margin: 0 -20px;
    width: calc(100% + 40px);
}

.testimonials-slider::-webkit-scrollbar {
    display: none;
}

.testimonial-card {
    flex: 0 0 calc(100% - 40px);
    scroll-snap-align: center;
    background-color: var(--bg-dark-lighter);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-md);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin: 0 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.testimonial-card.active {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.quote-icon {
    font-size: 2rem;
    color: var(--accent-yellow);
    margin-bottom: var(--spacing-sm);
    opacity: 0.6;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.author-info h4 {
    margin-bottom: 0;
}

.author-info p {
    margin-bottom: 0;
    color: var(--text-gray);
    font-size: 0.9rem;
}

.slider-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: var(--spacing-md);
    gap: var(--spacing-sm);
}

.prev-btn, .next-btn {
    background-color: transparent;
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.prev-btn:hover, .next-btn:hover {
    background-color: var(--accent-blue);
    color: var(--text-white);
}

.slider-dots {
    display: flex;
    gap: 8px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--bg-dark-lightest);
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.dot.active {
    background-color: var(--accent-blue);
}

/* Fix slider navigation buttons for RTL */
html[dir="rtl"] .prev-btn i.fa-chevron-left:before {
    content: "\f054"; /* Use right arrow icon instead of left in RTL mode */
}

html[dir="rtl"] .next-btn i.fa-chevron-right:before {
    content: "\f053"; /* Use left arrow icon instead of right in RTL mode */
}

/* Fix slider navigation arrows position in RTL */
html[dir="rtl"] .slider-controls {
    direction: rtl;
}

/* ===== Contact Section ===== */
#contact {
    padding: var(--spacing-xl) 0;
    background-color: var(--bg-dark-lighter);
}

.contact-content {
    display: flex;
    gap: var(--spacing-lg);
}

.contact-info, .contact-form {
    flex: 1;
}

.info-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.info-item i {
    color: var(--accent-blue);
    font-size: 1.2rem;
    width: 24px;
}

.social-links {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--bg-dark-lightest);
    border-radius: 50%;
    color: var(--text-white);
    transition: all var(--transition-fast);
}

.social-links a:hover {
    background-color: var(--accent-blue);
    transform: translateY(-3px);
}

.form-group {
    margin-bottom: var(--spacing-sm);
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 15px;
    background-color: var(--bg-dark-lightest);
    border: 1px solid transparent;
    border-radius: var(--border-radius-sm);
    color: var(--text-white);
    font-family: inherit;
    transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.form-group .error-message {
    color: #ff4444;
    font-size: 0.875rem;
    margin-top: 5px;
    display: none;
}

.honeypot-field {
    display: none;
}

/* ===== Footer Section ===== */
#footer {
    background-color: #0c0c0c;
    padding-top: var(--spacing-lg);
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    justify-content: space-between;
}

.footer-logo {
    flex: 0 0 100%;
    max-width: 350px;
    margin-bottom: var(--spacing-md);
}

.footer-logo .logo-text {
    font-size: 1.8rem;
}

.footer-links {
    display: flex;
    flex: 1;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
    justify-content: space-around;
}

.footer-column h4 {
    color: var(--accent-yellow);
    margin-bottom: var(--spacing-sm);
    position: relative;
}

.footer-column ul li {
    margin-bottom: var(--spacing-xs);
}

.footer-column ul li a {
    color: var(--text-gray);
    transition: color var(--transition-fast);
}

.footer-column ul li a:hover {
    color: var(--accent-blue);
}

.footer-bottom {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-md) 0;
    text-align: center;
    border-top: 1px solid var(--bg-dark-lighter);
}

.footer-bottom p {
    color: var(--text-gray);
    margin-bottom: 0.5rem;
}

.footer-bottom i {
    color: #ff4444;
}

/* ===== Back to Top Button ===== */
#backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--accent-blue);
    color: var(--text-white);
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--transition-normal);
    z-index: 900;
}

#backToTop.visible {
    opacity: 1;
    transform: translateY(0);
}

#backToTop:hover {
    background-color: var(--accent-blue-dark);
}

/* ===== Language Switch & RTL Styles ===== */
html[dir="rtl"] body {
    font-family: var(--font-arabic);
    text-align: right;
}

/* Reverse header layout for RTL */
html[dir="rtl"] #header .container {
    flex-direction: row-reverse;
    direction: rtl;
}

/* RTL Navigation Bar */
html[dir="rtl"] .nav-links {
    flex-direction: row-reverse; /* Reverse menu item flow */
    justify-content: flex-start; /* Start from right in RTL */
    direction: rtl; /* Ensure proper RTL direction */
}

/* Arabic nav items proper spacing */
html[dir="rtl"] .nav-links li {
    margin-right: var(--spacing-md);
    margin-left: 0;
}

html[dir="rtl"] .nav-links li:last-child {
    margin-right: 0;
}

/* Apply reverse order to ensure proper RTL menu sequence */
html[dir="rtl"] .nav-links li:nth-child(1) { order: 6; }
html[dir="rtl"] .nav-links li:nth-child(2) { order: 5; }
html[dir="rtl"] .nav-links li:nth-child(3) { order: 4; }
html[dir="rtl"] .nav-links li:nth-child(4) { order: 3; }
html[dir="rtl"] .nav-links li:nth-child(5) { order: 2; }
html[dir="rtl"] .nav-links li:nth-child(6) { order: 1; }
html[dir="rtl"] .nav-links li:nth-child(7) { order: 0; }

/* Apply reverse order to legal pages menu items in RTL */
html[dir="rtl"] .legal-nav .nav-links li:nth-child(1) { order: 6; }
html[dir="rtl"] .legal-nav .nav-links li:nth-child(2) { order: 5; }
html[dir="rtl"] .legal-nav .nav-links li:nth-child(3) { order: 4; }
html[dir="rtl"] .legal-nav .nav-links li:nth-child(4) { order: 3; }
html[dir="rtl"] .legal-nav .nav-links li:nth-child(5) { order: 2; }
html[dir="rtl"] .legal-nav .nav-links li:nth-child(6) { order: 1; } /* Language switcher */

html[dir="rtl"] .nav-links,
html[dir="rtl"] .hero-cta,
html[dir="rtl"] .about-stats,
html[dir="rtl"] .testimonial-author,
html[dir="rtl"] .social-links,
html[dir="rtl"] .info-item,
html[dir="rtl"] .slider-controls {
    flex-direction: row-reverse;
}

html[dir="rtl"] .service-features li {
    padding-right: var(--spacing-sm);
    padding-left: 0;
}

html[dir="rtl"] .service-features li:before {
    right: 0;
    left: auto;
}

html[dir="rtl"] .info-item i {
    margin-left: var(--spacing-sm);
    margin-right: 0;
}

html[dir="rtl"] .testimonial-author {
    text-align: right;
    flex-direction: row-reverse;
}

html[dir="rtl"] .quote-icon {
    text-align: right;
}

html[dir="rtl"] #backToTop {
    left: 30px;
    right: auto;
}

.lang-switcher {
    margin-left: var(--spacing-sm);
}

html[dir="rtl"] .lang-switcher {
    margin-right: var(--spacing-md);
    margin-left: 0;
    order: 1; /* Move language switcher to end (visually left) in RTL */
}

/* Keep logo on the left in RTL */
html[dir="rtl"] .logo {
    order: -2; /* Place logo at far left in RTL */
}

/* Ensure consistent language switcher button styling */
html[dir="rtl"] #lang-toggle,
#lang-toggle {
    font-weight: 600;
    min-width: 100px;
    border: 2px solid var(--accent-yellow);
    padding: 8px 16px;
}

.nav-links .lang-switcher {
    display: flex;
    align-items: center;
    margin-left: var(--spacing-sm);
}

html[dir="rtl"] .nav-links .lang-switcher {
    margin-right: var(--spacing-sm);
    margin-left: 0;
}

/* Set button styling for language switcher in navigation */
.nav-links .lang-switcher button {
    background-color: transparent;
    border: 2px solid var(--accent-yellow);
    color: var(--accent-yellow);
    padding: 8px 16px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 1rem;
    font-weight: 600;
    min-width: 100px;
    text-align: center;
}

/* ===== Responsive Styles ===== */

/* Tablets */
@media (max-width: 992px) {
    html {
        font-size: 15px;
    }

    h1 {
        font-size: 2.8rem;
    }

    h2 {
        font-size: 2.2rem;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on tablets */
    }

    #hero .container,
    .about-content,
    .contact-content {
        flex-direction: column;
    }

    .hero-image,
    .about-image {
        margin-top: var(--spacing-md);
    }
    
    .hero-img,
    .about-img {
        max-height: 350px;
        margin: 0 auto;
        display: block;
    }
}

/* Mobile */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    h1 {
        font-size: 2.4rem;
    }

    h2 {
        font-size: 1.8rem;
    }
    
    .hero-img,
    .about-img {
        max-height: 300px;
    }

    #menu-toggle {
        display: block;
        z-index: 1001;
    }

    .nav-links {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        height: 100vh;
        background-color: var(--bg-dark);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: var(--spacing-md);
        transition: left var(--transition-normal);
        box-shadow: 3px 0 10px rgba(0, 0, 0, 0.2);
        z-index: 1000;
        margin-top: 0; /* Reset margin for mobile slide menu */
    }

    .nav-links.active {
        left: 0;
    }

    .nav-links li {
        width: 100%;
        text-align: center;
    }

    .nav-links li a {
        display: block;
        padding: var(--spacing-sm) 0;
    }

    #menu-toggle.active .bar:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }

    #menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    #menu-toggle.active .bar:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }

    .hero-content {
        text-align: center;
    }

    .hero-cta {
        justify-content: center;
    }

    .about-stats {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .service-image {
        height: 180px; /* Consistent height on mobile */
    }
    
    .services-grid {
        gap: var(--spacing-lg); /* More space between cards on mobile */
    }
    
    .services-grid,
    .projects-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .project-image {
        height: 220px;
    }

    .footer-content {
        flex-direction: column;
    }

    .footer-logo, 
    .footer-links {
        flex: 1 0 100%;
        text-align: center;
    }

    .footer-column {
        flex: 1 0 100%;
        margin-bottom: var(--spacing-md);
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    html {
        font-size: 13px;
    }

    h1 {
        font-size: 2rem;
    }

    .hero-cta {
        flex-direction: column;
        width: 100%;
    }

    .hero-cta .btn {
        width: 100%;
        margin-bottom: var(--spacing-xs);
    }
}

/* Responsive adjustments for testimonials */
@media (max-width: 768px) {
    .testimonial-card {
        flex: 0 0 calc(100% - 20px);
        margin: 0 10px;
    }
    
    .testimonials-slider {
        margin: 0 -10px;
        width: calc(100% + 20px);
    }
}

.logo-image {
    height: 150px;
    width: auto;
    display: inline-block;
    vertical-align: middle;
    margin-right: var(--spacing-sm);
    filter: drop-shadow(0 0 5px rgba(0, 191, 255, 0.5));
}

.footer-logo-image {
    height: 60px;
    margin-bottom: var(--spacing-sm);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
    
.footer-logo-image {
    height: 50px;
}
    
#header .container {
        height: 80px;
    }


/* Logo emphasis effect */
@keyframes logoHighlight {
    0% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(0, 191, 255, 0.6)); }
    50% { transform: scale(1.03); filter: drop-shadow(0 0 15px rgba(0, 191, 255, 0.8)); }
    100% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(0, 191, 255, 0.6)); }
}

.logo:hover .logo-image {
    animation: logoHighlight 1.5s infinite ease-in-out;
}

/* Logo adjustments for RTL */
html[dir="rtl"] .logo {
    display: flex;
    align-items: center;
}

html[dir="rtl"] .footer-logo {
    text-align: right;
}

/* ===== Legal Pages Styles ===== */
.legal-page {
    padding: var(--spacing-xxl) 0;
    background-color: var(--bg-dark);
    min-height: 80vh;
}

.legal-page .section-header h1 {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-sm);
    color: var(--text-white);
}

.legal-content {
    background-color: var(--bg-dark-lighter);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius-md);
    margin-top: var(--spacing-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.legal-content .last-updated {
    color: var(--text-gray);
    font-style: italic;
    margin-bottom: var(--spacing-lg);
}

.legal-content h2 {
    color: var(--accent-blue);
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
    font-size: 1.5rem;
    border-bottom: 1px solid var(--bg-dark-lightest);
    padding-bottom: var(--spacing-xs);
}

.legal-content h3 {
    color: var(--accent-yellow);
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-xs);
    font-size: 1.2rem;
}

.legal-content p {
    margin-bottom: var(--spacing-sm);
    line-height: 1.6;
}

.legal-content ul {
    margin-bottom: var(--spacing-md);
    padding-left: var(--spacing-md);
}

.legal-content li {
    margin-bottom: var(--spacing-xs);
    line-height: 1.5;
}

.legal-content a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.legal-content a:hover {
    color: var(--accent-blue-dark);
    text-decoration: underline;
}

/* Legal pages navigation styles */
.legal-nav .logo-text {
    display: none;
}

.legal-nav .nav-links {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.legal-nav .lang-switcher {
    display: flex;
    align-items: center;
    margin-left: var(--spacing-md);
}

html[dir="rtl"] .legal-nav .nav-links {
    margin-right: auto;
    margin-left: 0;
    flex-direction: row-reverse; /* Reverse menu item flow in legal pages */
}

/* RTL Legal Pages specific navbar styles */
html[dir="rtl"] .legal-nav .container {
    direction: rtl;
}

html[dir="rtl"] .legal-nav .logo {
    order: -2; /* Place logo on far left in RTL */
}

html[dir="rtl"] .legal-nav .nav-links li {
    margin-right: var(--spacing-md);
    margin-left: 0;
}

html[dir="rtl"] .legal-nav .nav-links li:last-child {
    margin-right: 0;
}

/* Keep Contact button next to logo in RTL for legal pages */
html[dir="rtl"] .legal-nav a[data-i18n="nav.contact"] {
    order: -1;
}

/* Move language switcher to the left in RTL for legal pages */
html[dir="rtl"] .legal-nav .lang-switcher {
    order: 1;
}

/* RTL testimonial slider fixes */
html[dir="rtl"] .testimonials-slider {
    flex-direction: row-reverse;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
}

html[dir="rtl"] .testimonials-slider::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
}

/* Fix RTL testimonial card positioning */
html[dir="rtl"] .testimonial-card {
    scroll-snap-align: start;
    direction: rtl;
}

/* Fix duplicate logo issue in RTL mode */
html[dir="rtl"] #header .logo a > img.logo-image:nth-of-type(2),
html[dir="rtl"] #header .logo a > span.logo-text:nth-of-type(2) {
    display: none;
}

/* Mobile menu adjustments for RTL */
@media (max-width: 768px) {
    html[dir="rtl"] .nav-links {
        left: auto;
        right: -100%;
        box-shadow: -3px 0 10px rgba(0, 0, 0, 0.2);
        flex-direction: column;
    }

    html[dir="rtl"] .nav-links.active {
        left: auto;
        right: 0;
    }
    
    html[dir="rtl"] .nav-links li {
        margin-left: 0;
        text-align: right;
        width: 100%;
        padding-right: var(--spacing-md);
    }
    
    html[dir="rtl"] #menu-toggle {
        margin-left: 0;
        margin-right: auto;
    }

    /* Legal navigation specific mobile adjustments */
    .legal-nav #menu-toggle {
        position: relative;
        z-index: 1002;
    }

    html[dir="rtl"] .legal-nav #menu-toggle {
        margin-right: 0;
    }
}

/* Mobile styles for legal pages navigation */
@media (max-width: 768px) {
    .legal-nav .nav-links {
        margin-left: 0;
    }
    
    html[dir="rtl"] .legal-nav .nav-links {
        margin-right: 0;
        flex-direction: column; /* Reset to column in mobile */
    }
    
    .legal-nav .nav-links .lang-switcher {
        margin: 10px 0;
        width: 100%;
        text-align: left;
    }
    
    html[dir="rtl"] .legal-nav .nav-links .lang-switcher {
        text-align: right;
    }
    
    /* Reset order properties in mobile view */
    html[dir="rtl"] .legal-nav .logo,
    html[dir="rtl"] .logo {
        order: 0;
    }
    
    /* Ensure proper button order in mobile RTL view */
    html[dir="rtl"] .btn-contact,
    html[dir="rtl"] a[data-i18n="nav.contact"] {
        order: 0;
    }
    
    html[dir="rtl"] .lang-switcher {
        order: 0;
    }
    
    /* Keep menu order in mobile RTL */
    html[dir="rtl"] .nav-links li:nth-child(1),
    html[dir="rtl"] .nav-links li:nth-child(2),
    html[dir="rtl"] .nav-links li:nth-child(3),
    html[dir="rtl"] .nav-links li:nth-child(4),
    html[dir="rtl"] .nav-links li:nth-child(5),
    html[dir="rtl"] .nav-links li:nth-child(6),
    html[dir="rtl"] .nav-links li:nth-child(7),
    html[dir="rtl"] .legal-nav .nav-links li:nth-child(1),
    html[dir="rtl"] .legal-nav .nav-links li:nth-child(2),
    html[dir="rtl"] .legal-nav .nav-links li:nth-child(3),
    html[dir="rtl"] .legal-nav .nav-links li:nth-child(4),
    html[dir="rtl"] .legal-nav .nav-links li:nth-child(5) {
        order: 0;
    }
}

/* Ensure contact button consistency in legal pages */
.legal-nav .nav-links a[data-i18n="nav.contact"] {
    min-width: 120px;
    text-align: center;
    padding: 8px 16px;
    white-space: nowrap;
}

/* Contact button consistency across languages */
.btn-contact, 
a[data-i18n="nav.contact"] {
    min-width: 120px;
    text-align: center;
    padding: 10px 20px;
    white-space: nowrap;
}

/* Fix for Arabic contact button to match English size */
html[dir="rtl"] .btn-contact,
html[dir="rtl"] a[data-i18n="nav.contact"] {
    font-family: var(--font-arabic);
    font-size: 16px; /* Adjust size for Arabic text */
    order: -1; /* Move Contact button next to logo */
}

/* Apply specific RTL rules for mobile menu */
@media (max-width: 768px) {
    html[dir="rtl"] .nav-links {
        display: flex;
        flex-direction: column !important;
    }

    /* Restore proper order for mobile navigation in RTL */
    html[dir="rtl"] .nav-links li {
        width: 100%;
        text-align: right;
    }
}

/* Ensure proper RTL layout inside testimonial cards */
html[dir="rtl"] .testimonial-content {
    text-align: right;
}

html[dir="rtl"] .testimonial-author {
    flex-direction: row-reverse;
    text-align: right;
    justify-content: flex-start;
}

/* ===== Sitemap Styles ===== */
.sitemap-section {
    padding: var(--spacing-xl) 0;
}

.sitemap-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.sitemap-group {
    background-color: var(--bg-dark-lighter);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-md);
    transition: transform var(--transition-normal);
}

.sitemap-group:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.sitemap-group h2 {
    font-size: 1.5rem;
    color: var(--accent-blue);
    border-bottom: 2px solid var(--accent-yellow);
    padding-bottom: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
}

.sitemap-links {
    list-style-type: none;
}

.sitemap-links li {
    margin-bottom: var(--spacing-sm);
}

.sitemap-links a {
    color: var(--text-white);
    display: flex;
    align-items: center;
    transition: all var(--transition-fast);
}

.sitemap-links a:hover {
    color: var(--accent-yellow);
    transform: translateX(5px);
}

.sitemap-links a::before {
    content: "→";
    margin-right: var(--spacing-xs);
    color: var(--accent-blue);
}

/* RTL adjustments for sitemap */
html[dir="rtl"] .sitemap-links a::before {
    content: "←";
    margin-right: 0;
    margin-left: var(--spacing-xs);
}

html[dir="rtl"] .sitemap-links a:hover {
    transform: translateX(-5px);
}

@media (max-width: 768px) {
    .sitemap-content {
        grid-template-columns: 1fr;
    }
}
