/* Import Google Fonts - Poppins is a good choice for modern, readable text */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');
/* Import Cairo font for Arabic text */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&display=swap');

body {
    font-family: 'Poppins', sans-serif; /* Changed font to Poppins */
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
    font-size: 1.1rem; /* Slightly larger base font size */
    line-height: 1.7; /* Increased line height for better readability */
    overflow-x: hidden; /* Prevent horizontal scroll on mobile */
}

/* --- RTL (Right-to-Left) Language Adjustments --- */
/* This is crucial for Arabic support */
body[dir="rtl"] {
    direction: rtl;
    text-align: right;
    font-family: 'Cairo', sans-serif; /* Apply Cairo font for Arabic */
}

/* Header overall alignment for RTL */
body[dir="rtl"] header {
    flex-direction: row-reverse; /* Reverse the order of header items */
    justify-content: flex-start; /* Align main header items to the left (logo will be pushed to the right by margin-left: auto) */
}

/* Header Logo adjustments for RTL */
body[dir="rtl"] .logo {
    /* Push the logo to the far right by taking up available space on its left */
   margin-right: 200px; /* Adjust this value as needed to push the logo right */
}

body[dir="rtl"] .logo a {
    flex-direction: row-reverse; /* Reverse the order of logo image and text */
}

body[dir="rtl"] .logo img {
    margin-right: 0; /* Remove default left-to-right margin */
    margin-left: 12px; /* Add margin to the left of the image */
}

body[dir="rtl"] .logo-text-container {
    align-items: flex-end; /* Align the stacked logo text to the right */
}

/* Navigation adjustments for RTL */
body[dir="rtl"] nav ul {
    justify-content: flex-end; /* Align menu items to the right */
}

/* Language switcher dropdown arrow for RTL */
body[dir="rtl"] .language-switcher {
    /* Ensure the language switcher is on the left when other items are pushed right */
    margin-right: auto; /* Take up available space on its right */
    margin-left: 0; /* Reset left margin */
}

body[dir="rtl"] .language-switcher select {
    padding: 8px 12px 8px 35px; /* Increased left padding for RTL */
    background-position: left 12px top 50%; /* Arrow closer to left edge */
}

/* Text alignment for various sections in RTL */
body[dir="rtl"] h1,
body[dir="rtl"] h2,
body[dir="rtl"] p,
body[dir="rtl"] a,
body[dir="rtl"] li,
body[dir="rtl"] .service-item,
body[dir="rtl"] .project-item .content, /* If you had a content div in project-item */
body[dir="rtl"] .visual-card .slice-content,
body[dir="rtl"] footer {
    text-align: right;
}

/* Form input/textarea alignment for RTL */
body[dir="rtl"] .contact-form input,
body[dir="rtl"] .contact-form textarea {
    text-align: right;
}
body[dir="rtl"] .contact-form input::placeholder,
body[dir="rtl"] .contact-form textarea::placeholder {
    text-align: right;
}

/* Modal text alignment for RTL */
body[dir="rtl"] .modal-content h2,
body[dir="rtl"] .modal-content .form-group label,
body[dir="rtl"] .modal-content input {
    text-align: right;
}

/* Modal close button position for RTL */
body[dir="rtl"] .close-button {
    left: 25px; /* Move close button to the left */
    right: auto; /* Reset right position */
}

/* Scroll to top button for RTL (if it moves, though usually fixed) */
body[dir="rtl"] .scroll-to-top-btn {
    right: auto;
    left: 30px;
}


/* --- Header Styles --- */
header {
    background-color: #222; /* Dark background */
    color: #fff;
    padding: 1rem 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); /* Subtle shadow for depth */
    flex-wrap: wrap; /* Allows header content to wrap on smaller screens */
    gap: 15px; /* Space between header elements */
}

/* --- Logo Container Styles --- */
.logo a {
    display: flex; /* Use Flexbox to align image and text */
    align-items: center; /* Vertically center them */
    text-decoration: none; /* Remove underline from the link */
}

.logo img {
    max-height: 45px; /* Adjusted maximum height of the logo image */
    width: auto;      /* Maintain aspect ratio */
    margin-right: 12px; /* Space between the image and the text */
    display: block; /* Ensures no extra space below the image */
}

/* Styles for the new text container */
.logo-text-container {
    display: flex; /* Use flexbox to stack the text */
    flex-direction: column; /* Stack EPTRC and full name vertically */
    align-items: flex-start; /* Align text to the left within its container (default LTR) */
}

.logo-text-container span:first-child { /* Targets the "EPTRC" text */
    font-size: 1.7rem; /* Made logo text bigger */
    font-weight: 700; /* Made logo text bolder */
    color: #ffc107; /* Ensures EPTRC remains yellow */
    line-height: 1.2; /* Adjust line height for better spacing */
}

.full-company-name {
    font-size: 0.85rem; /* Smaller font size for the full name */
    font-weight: 400; /* Normal weight */
    color: #fff; /* White color for the full name */
    line-height: 1.2; /* Adjust line height */
    white-space: nowrap; /* Prevent text from wrapping on one line if possible */
}


/* --- Navigation Styles --- */
nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex; /* Ensures list items are aligned horizontally */
    align-items: center; /* Vertically aligns all items in the nav */
    gap: 30px; /* Adds consistent spacing between navigation items */
    flex-wrap: wrap; /* Allow navigation items to wrap */
    justify-content: center; /* Center items when wrapped */
}

/* Style for all navigation links and the login button (default state) */
nav ul li a,
.login-btn {
    color: #fff; /* Default color: white */
    text-decoration: none;
    cursor: pointer;
    padding: 0.6rem 1.2rem; /* Slightly more padding */
    transition: color 0.3s ease; /* Smooth transition for color change */
    white-space: nowrap; /* Prevents text from wrapping on small screens */
    font-size: 1.1rem; /* Increased font size for nav links */
    font-weight: 600; /* Made nav links bolder */
}

/* Hover effect for all navigation links and the login button */
nav ul li a:hover {
    color: #ffc107; /* Foreground color turns yellow on hover */
    background-color: transparent; /* Ensure no background change on hover for links */
}

/* Specific styling for the login button's default state */
.login-btn {
    border: 2px solid #ffc107; /* Slightly thicker yellow border for login button */
    border-radius: 6px; /* Slightly more rounded corners for the login button */
}

/* Login button specific hover effect if you want a background change */
.login-btn:hover {
    background-color: #ffc107; /* Yellow background on hover */
    color: #222; /* Text turns black for better contrast on yellow background */
}

/* --- Language Switcher Styles --- */
.language-switcher select {
    background-color: #333;
    color: #fff;
    border: 1px solid #ffc107;
    /* Adjusted padding to create space from the arrow */
    padding: 8px 35px 8px 12px; /* Top, Right, Bottom, Left. Increased Right padding. */
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    appearance: none; /* Remove default dropdown arrow */
    /* Custom arrow for LTR */
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23ffffff%22%20d%3D%22M287%20197.8L146.2%2057%205.4%20197.8h281.6z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    /* Position the arrow relative to the right edge for LTR */
    background-position: right 12px top 50%;
    background-size: 12px auto;
}

.language-switcher select:focus {
    outline: none;
    border-color: #fff;
}


/* --- Hero Section Styles (WITH VIDEO BACKGROUND) --- */
.hero {
    color: #fff; /* Text color remains white */
    text-align: center;
    padding: 6rem 20px; /* More vertical padding */
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 450px; /* Slightly taller hero section */
    position: relative; /* Needed for positioning video and overlay */
    overflow: hidden; /* Important for clipping video */
    background-color: #333; /* Fallback background color if video doesn't load */
}

/* Hero Video Styles */
.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: 0; /* Behind the content and overlay */
    transform: translate(-50%, -50%); /* Center the video */
    object-fit: cover; /* Ensures video covers the area, cropping if necessary */
}

/* Overlay for the hero video */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent black overlay */
    z-index: 1; /* Above the video, but below content */
}

.hero-content {
    position: relative; /* Essential to allow z-index to work */
    max-width: 800px;
    margin: 0 auto;
    z-index: 2; /* Higher z-index to be on top of video and overlay */
}

.hero h1 {
    font-size: 3.8rem; /* Made hero heading much bigger */
    margin-bottom: 1.2rem;
    font-weight: 700; /* Extra bold */
}

.hero p {
    font-size: 1.3rem; /* Made hero paragraph bigger */
    margin-bottom: 2.5rem;
    font-weight: 400; /* Standard weight */
}

.cta-button {
    display: inline-block;
    background-color: #ffc107; /* Yellow */
    color: #222; /* Black text for contrast */
    padding: 1.1rem 2.5rem; /* More padding */
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600; /* Bolder button text */
    font-size: 1.1rem; /* Bigger button text */
    transition: background-color 0.3s ease;
}

.cta-button:hover {
    background-color: #e0a800;
}

/* Under Construction Alert */
.under-construction-alert {
    background-color: #ffeb3b; /* Yellow background */
    color: #333;
    padding: 15px;
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
    border-radius: 8px;
    margin-bottom: 20px; /* Space below the alert */
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    animation: pulse 1.5s infinite alternate; /* Simple animation */
    /* Ensure it's centered and has some margin */
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 20px; /* Space between alert and CTA button */
}

@keyframes pulse {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(1.02);
        opacity: 0.95;
    }
}

.under-construction-alert p {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.under-construction-alert strong {
    color: #c00; /* Red for emphasis */
}


/* --- Section General Styles --- */
.services, .projects, .contact, .visual-sections {
    padding: 4rem 20px; /* More vertical padding for sections */
    text-align: center;
}

.services h2, .projects h2, .contact h2, .visual-sections h2 {
    font-size: 2.8rem; /* Made section headings bigger */
    margin-bottom: 2rem; /* More space below headings */
    color: #222;
    font-weight: 700; /* Extra bold */
}

/* --- Service Grid Styles --- */
.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px; /* Increased gap */
    margin-top: 2.5rem;
}

.service-item {
    background-color: #fff;
    padding: 25px; /* More padding */
    border-radius: 8px; /* More rounded corners */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Stronger shadow */
    text-align: left; /* Default LTR alignment */
    transition: transform 0.2s ease;
}

.service-item:hover {
    transform: translateY(-8px); /* Lift effect on hover */
}

.service-item h3 {
    color: #28a745; /* Green */
    margin-top: 0;
    margin-bottom: 0.8rem;
    font-size: 1.6rem; /* Bigger service item headings */
    font-weight: 600; /* Bolder */
}

.service-item p {
    font-size: 1rem; /* Standard paragraph size */
    font-weight: 300; /* Lighter weight for body text */
}

/* --- Visual Sections (Image Slices) --- */
.visual-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-top: 2.5rem;
}

.visual-card {
    position: relative;
    height: 300px; /* Fixed height for visual consistency */
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: flex-end; /* Align content to bottom */
    color: #fff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.visual-card:hover {
    transform: scale(1.03); /* Slight zoom on hover */
}

.visual-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: brightness(0.6); /* Darken image */
    transition: filter 0.3s ease;
    z-index: 0;
}

.visual-card:hover::before {
    filter: brightness(0.4); /* Further darken on hover */
}

.visual-card.image-1::before {
    background-image: url('images/dash.jpg'); /* Example image path */
}

.visual-card.image-2::before {
    background-image: url('images/labo.jpg'); /* Example image path */
}

.slice-content {
    position: relative;
    z-index: 1;
    padding: 25px;
    text-align: left; /* Default LTR alignment */
}

.slice-content h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: #ffc107; /* Yellow title */
}

.slice-content p {
    font-size: 1.1rem;
    font-weight: 300;
}


/* --- Projects Section Styles --- */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 2.5rem;
}

.project-item {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.2s ease;
}

.project-item:hover {
    transform: translateY(-8px);
}

.project-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.project-item h3 {
    padding: 1.2rem;
    margin: 0;
    color: #222;
    font-size: 1.6rem;
    font-weight: 600;
}

.project-item p {
    padding: 0 1.2rem 1.2rem;
    margin: 0;
    font-size: 1rem;
    font-weight: 300;
}

/* --- Contact Section Styles (Replaced with new contact details) --- */
/* The .contact-form, submit-button etc. are removed as they are not needed for this specific request.
   If you want a full contact form in addition to the details, let me know. */

.contact-details-section {
    background-color: #fff;
    padding: 60px 20px; /* Increased padding */
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); /* Stronger shadow */
    margin-top: -80px; /* Overlap with hero section */
    position: relative;
    z-index: 3; /* Ensure it's above other elements */
    border-radius: 10px;
}

.contact-details-section h2 {
    color: #222;
    font-size: 2.8rem; /* Consistent heading size */
    margin-bottom: 40px;
    position: relative;
    display: inline-block;
}

.contact-details-section h2::after {
    content: '';
    display: block;
    width: 80px; /* Wider underline */
    height: 5px; /* Thicker underline */
    background-color: #ffc107;
    margin: 10px auto 0;
    border-radius: 2px;
}

.contact-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Adjusted min-width for responsiveness */
    gap: 30px;
    margin-top: 30px;
}

.contact-info-grid div {
    background-color: #f8f8f8;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1); /* Subtle shadow */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex; /* Use flexbox for icon and text alignment */
    flex-direction: column; /* Stack icon and text */
    align-items: center; /* Center items */
    justify-content: center;
    text-align: center; /* Center text within each grid item */
}

body[dir="rtl"] .contact-info-grid div {
    text-align: center; /* Ensure text is centered in RTL as well */
}


.contact-info-grid div:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15); /* More prominent shadow on hover */
}

.contact-info-grid i {
    font-size: 3em; /* Larger icons */
    color: #ffc107;
    margin-bottom: 15px;
}

.contact-info-grid p {
    font-size: 1.1em;
    color: #555;
    line-height: 1.6;
    margin: 0;
}

.contact-info-grid p strong {
    color: #222; /* Make the label bold and dark */
}

.map-container {
    margin-top: 25px;
    width: 100%;
    overflow: hidden; /* Ensure map doesn't overflow */
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.map-container iframe {
    width: 100%;
    height: 250px; /* Fixed height for map */
    border: 0;
}


/* Utility class to hide elements */
.hidden {
    display: none;
}

/* --- Footer Styles --- */
footer {
    background-color: #222;
    color: #fff;
    text-align: center;
    padding: 2rem 20px;
    font-size: 0.9rem;
}

/* --- Login Modal Styles --- */
/* Your existing modal styles remain unchanged */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.6); /* Black w/ opacity */
    display: flex; /* Use flexbox to center content */
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fefefe;
    margin: auto; /* For older browsers, flexbox handles centering */
    padding: 30px;
    border: 1px solid #888;
    width: 90%; /* Responsive width */
    max-width: 500px; /* Max width for desktop */
    border-radius: 10px;
    position: relative; /* For close button positioning */
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation-name: animatetop; /* Simple animation */
    animation-duration: 0.4s;
}

/* Modal animation */
@keyframes animatetop {
    from {top: -300px; opacity: 0}
    to {top: 0; opacity: 1}
}

.close-button {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 25px; /* Default LTR position */
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-button:hover,
.close-button:focus {
    color: #333;
    text-decoration: none;
    cursor: pointer;
}

.modal-content h2 {
    text-align: center; /* Default LTR alignment */
    color: #222;
    margin-bottom: 25px;
    font-size: 2rem;
}

.modal-content .form-group {
    margin-bottom: 15px;
    text-align: left; /* Default LTR alignment for labels/inputs */
}

.modal-content label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.modal-content input[type="text"],
.modal-content input[type="password"] {
    width: calc(100% - 20px); /* Full width with padding considered */
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Include padding in width */
    font-size: 1rem;
}

.modal-content input[type="text"]:focus,
.modal-content input[type="password"]:focus {
    outline: none;
    border-color: #ffc107;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.2);
}

.login-submit-button {
    background-color: #28a745; /* Green for login */
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 20px;
    transition: background-color 0.3s ease;
}

.login-submit-button:hover {
    background-color: #218838; /* Darker green on hover */
}


/* --- Scroll to Top Button --- */
.scroll-to-top-btn {
    display: none; /* Hidden by default */
    position: fixed;
    bottom: 30px;
    right: 30px; /* Default LTR position */
    z-index: 99;
    font-size: 24px;
    border: none;
    outline: none;
    background-color: #ffc107; /* Yellow */
    color: #222;
    cursor: pointer;
    padding: 15px 20px;
    border-radius: 50%; /* Circular button */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.scroll-to-top-btn:hover {
    background-color: #e0a800; /* Darker yellow */
    transform: translateY(-3px); /* Slight lift */
}

/* --- Responsive Adjustments (Media Queries) --- */

/* Tablets and small desktops (max-width: 1024px) */
@media (max-width: 1024px) {
    header {
        flex-direction: column; /* Stack logo, nav, and lang switcher */
        text-align: center;
        padding-top: 1rem;
        padding-bottom: 1rem;
        gap: 15px; /* Consistent gap between stacked items */
    }

    .logo {
        margin-bottom: 10px; /* Space below logo when stacked */
        margin-left: 0 !important; /* Reset margin for mobile stacking */
        margin-right: 0 !important;
    }

    /* Adjust logo order for RTL on smaller screens when header items are stacked */
    body[dir="rtl"] header {
        flex-direction: column; /* Ensure it stays column */
        align-items: center; /* Center items when stacked */
    }
    body[dir="rtl"] .logo {
        margin-left: 0; /* Override auto margin for column layout */
        margin-right: 0;
    }


    nav ul {
        flex-direction: row; /* Keep nav items horizontal, but allow wrapping */
        justify-content: center;
        width: 100%; /* Take full width */
        margin-bottom: 10px; /* Space below nav when stacked */
        gap: 15px; /* Reduce gap for smaller screens */
    }
    body[dir="rtl"] nav ul {
        justify-content: center; /* Override flex-end for stacked nav */
    }


    .language-switcher {
        margin-top: 10px; /* Space above language switcher */
        margin-left: 0 !important; /* Reset margin for mobile stacking */
        margin-right: 0 !important;
    }

    .hero h1 {
        font-size: 3rem; /* Slightly smaller hero heading */
    }

    .hero p {
        font-size: 1.2rem;
    }

    .services h2, .projects h2, .contact h2, .visual-sections h2, .contact-details-section h2 {
        font-size: 2.4rem; /* Slightly smaller section headings */
    }

    .service-grid, .project-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Allow slightly smaller grid items */
        gap: 25px; /* Reduced gap */
    }

    .visual-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    }

    .contact-info-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Adjust for smaller screens */
    }
}

/* Mobile devices (max-width: 768px) */
@media (max-width: 768px) {
    header {
        padding: 15px 15px; /* Reduced padding */
        gap: 10px;
    }

    .logo-text-container span:first-child {
        font-size: 1.5rem; /* Smaller logo text */
    }

    .full-company-name {
        font-size: 0.75rem; /* Smaller full name text */
        white-space: normal; /* Allow full company name to wrap */
    }

    nav ul {
        flex-direction: column; /* Stack nav items vertically on small screens */
        align-items: center; /* Center them */
        gap: 10px; /* Reduced gap between stacked items */
    }

    nav ul li a,
    .login-btn {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }

    .hero {
        padding: 4rem 15px; /* More vertical padding */
        min-height: 400px; /* Shorter hero section */
    }

    .hero h1 {
        font-size: 2.5rem; /* Further reduced hero heading size */
    }

    .hero p {
        font-size: 1rem;
    }

    .cta-button {
        padding: 0.9rem 1.8rem;
        font-size: 1rem;
    }

    .services, .projects, .contact, .visual-sections {
        padding: 3rem 15px; /* Reduced section padding */
    }

    .services h2, .projects h2, .contact h2, .visual-sections h2, .contact-details-section h2 {
        font-size: 2rem; /* Further reduced section headings */
        margin-bottom: 1.5rem;
    }

    .service-grid, .project-grid, .visual-grid {
        grid-template-columns: 1fr; /* Single column layout for grids */
        gap: 20px; /* Reduced gap */
    }

    .visual-card {
        height: 250px; /* Shorter visual cards */
    }

    .slice-content h3 {
        font-size: 1.6rem; /* Smaller visual card titles */
    }

    .slice-content p {
        font-size: 0.95rem; /* Smaller visual card paragraphs */
    }

    .contact-details-section {
        padding: 40px 15px;
        margin-top: 30px; /* Adjust overlap for smaller screens */
    }

    .contact-info-grid {
        grid-template-columns: 1fr; /* Single column for contact info on very small screens */
    }

    .modal-content {
        width: 95%; /* Wider modal on smaller screens */
        padding: 20px;
    }

    .modal-content h2 {
        font-size: 1.8rem;
        margin-bottom: 20px;
    }

    .modal-content input[type="text"],
    .modal-content input[type="password"] {
        padding: 8px;
    }

    .login-submit-button {
        padding: 10px 15px;
        font-size: 1rem;
    }

    .scroll-to-top-btn {
        bottom: 20px;
        right: 20px;
        padding: 12px 16px;
        font-size: 20px;
    }
    body[dir="rtl"] .scroll-to-top-btn {
        right: 20px; /* Keep it on the right for mobile, consistent with LTR visual */
        left: auto;
    }
}