/* Specific font for RTL content (Arabic) */
html.rtl body {
    font-family: 'Cairo', sans-serif;
}

/* Custom CSS to match Attorna's specific design elements */
body {
    font-family: 'Open Sans', sans-serif;
    /* Body text */
    background-color: #f7f7f7;
    /* Light background similar to demo */
    color: #4a4a4a;
    /* Default text color */
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Montserrat', sans-serif;
    /* Headings */
    color: #222222;
    /* Darker headings */
}

/* Navigation Bar Specifics */
.nav-link {
    position: relative;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background-color: #f2a900;
    /* Accent color */
    transition: width 0.3s ease;
    border-radius: 2px;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover {
    color: #f2a900;
    /* Accent color on hover */
}

/* Language Switcher Button (Globe Icon) */
#lang-dropdown-button {
    background-color: transparent;
    border: none;
    color: #4a4a4a; /* Default text color */
    font-size: 1.5rem; /* Larger icon */
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 0.5rem;
    border-radius: 50%;
}

#lang-dropdown-button:hover {
    color: #f2a900; /* Accent color on hover */
    background-color: rgba(242, 169, 0, 0.1);
}

/* Language Options Container */
#lang-options {
    position: absolute;
    top: 100%; /* Position below the nav bar */
    right: 0; /* Align to the right of its parent (relative or absolute positioned) */
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 100px;
    padding: 0.5rem;
    z-index: 100; /* Ensure it's above other content */
    margin-top: 0.5rem; /* Small gap below nav */
}

/* Individual Language Option Buttons */
.lang-option-button {
    background-color: #e0e0e0;
    color: #4a4a4a;
    border: none;
    cursor: pointer;
}

.lang-option-button:hover {
    background-color: #d0d0d0;
}

.lang-option-button.bg-yellow-600 { /* Active state from translation.js */
    background-color: #f2a900;
    color: white;
}

/* Specific adjustments for RTL mode */
html.rtl .nav-link::after {
    left: auto; /* Reset left */
    right: 50%; /* Align underline to right for RTL */
    transform: translateX(50%); /* Adjust transform for RTL centering */
}

html.rtl .lg\:flex.space-x-8 > *:not([hidden]) ~ *:not([hidden]) {
    margin-right: 2rem; /* Tailwind's space-x-8 is 2rem, change to margin-right */
    margin-left: 0; /* Ensure no left margin */
}

/* Adjustments for RTL in footer social icons */
html.rtl .footer-social-icon:not(:first-child) {
    margin-right: 1rem; /* Adjust spacing between icons for RTL */
    margin-left: 0;
}

/* Hero Section */
.hero-background {
    background-image: url('./images/hero.png');
    /* Darker, professional placeholder */
    background-size: cover;
    background-position: center;
    position: relative;
    min-height: 90vh;
    /* Adjust height for visual impact */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.55);
    /* Slightly less opaque overlay */
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 0 1rem;
}

/* Section Titles */
.section-title {
    font-size: 2.5rem;
    /* Larger font for titles */
    font-weight: 700;
    color: #222222;
    position: relative;
    padding-bottom: 0.75rem;
    /* Smaller gap for underline */
    margin-bottom: 3rem;
    /* More space below title */
    display: inline-block;
    /* To center the underline */
}

.section-title::after {
    content: '';
    position: absolute;
    left: 50%;
    /* Center the underline */
    transform: translateX(-50%);
    bottom: 0;
    width: 60px;
    /* Specific width for underline */
    height: 4px;
    background-color: #f2a900;
    /* Accent color */
    border-radius: 2px;
}

/* Buttons */
.btn-primary {
    background-color: #f2a900;
    /* Accent color */
    color: white;
    padding: 1rem 2.5rem;
    /* Larger padding */
    border-radius: 30px;
    /* More rounded */
    font-weight: 600;
    letter-spacing: 0.05em;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 5px 15px rgba(242, 169, 0, 0.3);
    /* Soft shadow */
}

.btn-primary:hover {
    background-color: #e09a00;
    /* Slightly darker accent */
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(242, 169, 0, 0.4);
}

.btn-secondary {
    background-color: #004d99;
    /* Darker blue */
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 30px;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 5px 15px rgba(0, 77, 153, 0.3);
}

.btn-secondary:hover {
    background-color: #003366;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 77, 153, 0.4);
}

/* Card styles for services and testimonials */
.service-card,
.testimonial-card {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    /* Softer, more pronounced shadow */
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    border: 1px solid #f0f0f0;
    /* Subtle border */
}

.service-card:hover,
.testimonial-card:hover {
    transform: translateY(-8px);
    /* More pronounced lift */
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.service-card .icon {
    color: #f2a900;
    /* Accent color for icons */
    font-size: 4rem;
    /* Larger icons */
    margin-bottom: 1.5rem;
}

.service-card h3 {
    color: #222222;
    font-size: 1.75rem;
    /* Larger service titles */
    font-weight: 700;
    margin-bottom: 1rem;
}

/* Why Choose Us / Counter Section */
.counter-box {
    background-color: #004d99;
    /* Dark blue background */
    color: white;
    border-radius: 12px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.counter-box .number {
    font-size: 3.5rem;
    /* Large numbers */
    font-weight: 800;
    color: #f2a900;
    /* Accent color */
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.counter-box .label {
    font-size: 1.25rem;
    font-weight: 600;
    opacity: 0.9;
}

/* Team Member Card */
.team-card {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
    padding: 1.5rem;
    border: 1px solid #f0f0f0;
}

.team-card img {
    border: 4px solid #f2a900;
    /* Accent border for avatar */
    box-shadow: 0 0 0 3px rgba(242, 169, 0, 0.3);
    /* Subtle outer glow */
}

.team-card h4 {
    color: #222222;
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.team-card .role {
    color: #004d99;
    /* Dark blue for role */
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 1rem;
}

/* Contact Form */
.contact-form-card {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    padding: 2.5rem;
    border: 1px solid #f0f0f0;
}

/* Default LTR styles for ALL icon-text pairs in the contact card */
.contact-form-card .flex i {
    margin-right: 0.75rem; /* Space to the right of the icon for LTR */
    margin-left: 0; /* Ensure no left margin in LTR */
    vertical-align: middle; /* Helps align icons with text vertically */
}

/* Specific RTL adjustments */
html.rtl .contact-form-card .flex i {
    margin-left: 0.75rem; /* Space to the left of the icon for RTL */
    margin-right: 0; /* Ensure no right margin in RTL */
}


.contact-form-card input[type="text"],
.contact-form-card input[type="email"],
.contact-form-card textarea {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0.85rem 1.25rem;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.contact-form-card input:focus,
.contact-form-card textarea:focus {
    border-color: #f2a900;
    box-shadow: 0 0 0 3px rgba(242, 169, 0, 0.2);
    outline: none;
}

/* --- NEW RULE FOR PHONE NUMBERS WRAPPING --- */
.contact-form-card p.flex {
    word-break: break-word;
    /* Forces long words/strings to break at any character if they overflow */
    overflow-wrap: break-word;
    /* Older alias for word-break, good for wider compatibility */
}

/* ------------------------------------------- */

/* Footer */
.footer-link {
    color: #b0b0b0;
    transition: color 0.3s ease;
    font-size: 0.95rem;
}

.footer-link:hover {
    color: #f2a900;
    /* Accent color on hover */
}

.footer-social-icon {
    color: #b0b0b0;
    transition: color 0.3s ease, transform 0.2s ease;
}

.footer-social-icon:hover {
    color: #f2a900;
    transform: translateY(-2px);
}

/* Hide grid items beyond the initial display limit using Tailwind's `hidden` utility */
.hidden-grid-item {
    display: none;
}

/* For screens where you have 5 columns (md, lg, xl, 2xl etc.) */
/* This will hide items from the 10th position onwards, ensuring the grid always looks "full" with 9 items */
@media (min-width: 768px) {
    /* Adjust this breakpoint as per your lg:grid-cols-5 */
    .achievement-grid-item:nth-child(n+10) {
        /* Selects 10th item and beyond */
        display: none;
    }
}

/* For screens where you have 3 columns (sm, md) */
@media (min-width: 640px) and (max-width: 767px) {
    /* Adjust this breakpoint for sm:grid-cols-3 and md:grid-cols-5 */
    .achievement-grid-item:nth-child(n+10) {
        /* Still hides from 10th onwards */
        display: none;
    }
}

/* If you need more granular control for other breakpoints, adjust the nth-child accordingly */
/* For example, if on very small screens (col-2), you only want 6 visible */
@media (max-width: 639px) {
    .achievement-grid-item:nth-child(n+7) {
        /* Hides 7th item and beyond for col-2 */
        display: none;
    }
}


/* Specific adjustments for RTL mode */
html.rtl .nav-link::after {
    left: auto; /* Reset left */
    right: 50%; /* Align underline to right for RTL */
    transform: translateX(50%); /* Adjust transform for RTL centering */
}

/* Header: Spacing between icon and HaremHiwa logo in Arabic */
html.rtl .logo-icon-haremhiwa {
    margin-left: 0.5rem; /* Add space to the left of the icon for RTL */
    margin-right: 0;
}

/* Header: Adjust spacing between nav links in Arabic (replaces space-x-8) */
html.rtl .lg\:flex.space-x-8 > *:not([hidden]) ~ *:not([hidden]) {
    margin-right: 2rem; /* Tailwind's space-x-8 is 2rem, change to margin-right */
    margin-left: 0; /* Ensure no left margin */
}

/* Language Dropdown: Vertical spacing between options */
#lang-options button {
    margin-bottom: 2px; /* Small vertical gap */
}

#lang-options button:last-child {
    margin-bottom: 0; /* No margin on the last item */
}

/* Adjustments for RTL in footer social icons */
html.rtl .footer-social-icon:not(:first-child) {
    margin-right: 1rem; /* Adjust spacing between icons for RTL */
    margin-left: 0;
}

/* Contact Us - Our Office & Contact Details: Spacing between icon and text */
html.rtl .contact-form-card p.flex i {
    margin-left: 0.75rem; /* Add space to the left of the icon for RTL */
    margin-right: 0;
}



/* Footer Contact Info: Spacing between icon and text */
html.rtl footer p.flex i {
    margin-left: 0.5rem; /* Add space to the left of the icon for RTL */
    margin-right: 0;
}

/* Mobile Language Icon: Add space from the hamburger menu in Arabic */
html.rtl #mobile-lang-button {
    margin-left: 1rem; /* Adjust this value as needed for desired spacing */
    margin-right: 0;
}

html.rtl #mobile-lang-options{
    left: 0 !important;
    right: inherit;
}

/* Language Options Container (Desktop & Mobile) */
#lang-options,
#mobile-lang-options {
    padding: 0.25rem; /* Small internal padding */
    border: 1px solid #e0e0e0; /* Subtle border */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); /* Softer shadow */
}

/* Individual Language Option Buttons (apply to both desktop and mobile buttons) */
#lang-options button,
#mobile-lang-options button {
    padding: 0.5rem 0.75rem; /* Adjust padding for a slightly larger click area */
    border-radius: 6px; /* Slightly rounded corners for buttons */
    /* Ensure background and text colors are handled by translation.js classes */
    margin-top: 2px;
}

/* For modal thumbnails container */
#modal-thumbnails {
    max-height: 100px; /* Adjust as needed */
    overflow-x: auto; /* Enable horizontal scrolling */
    white-space: nowrap; /* Prevent items from wrapping */
    /* padding: 5px 0; Add some padding if scrollbar obscures content */
    display: flex; /* Ensure it's a flex container for `flex-row-reverse` to work */
    gap: 0.5rem; /* Add a small gap between thumbnails */
    padding: 10px;
    overflow-y: hidden;

}

html.rtl #modal-thumbnails {
    direction: rtl; /* Makes the scrollbar and content direction RTL */
    padding: 10px;
}

/* About Section Text Justification */
#about p {
    text-align: justify;
    text-justify: inter-word; /* Recommended for better word spacing */
}

/* For RTL languages, justify text as well */
html.rtl #about p {
    text-align: justify;
    text-justify: inter-word;
}


html.rtl .contact-form-card div span{
    direction:ltr;
}

