/* =================
   GLOBAL & SETUP
   ================= */
:root {
    --brand: #0E7CFF;
    --brand-2: #37C3A8;
    --ink: #0F172A;
    --muted: #526178;
    --surface: #F8FAFC;
    --card: #FFFFFF;
    --border-color: #E2E8F0;
    --accent: #f5f9ff;
    --shadow-color: rgba(15, 23, 42, 0.05);
    --gradient: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
}

@media (prefers-color-scheme: dark) {
    :root {
        --ink: #E2E8F0;
        --muted: #94A3B8;
        --surface: #080d17;
        --card: #111827;
        --border-color: #1E293B;
        --accent: #111827;
        --shadow-color: rgba(0, 0, 0, 0.15);
    }
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16.5px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Heebo", "Assistant", "Roboto", "Helvetica Neue", Arial, sans-serif;
    background-color: var(--surface);
    color: var(--ink);
    line-height: 1.6;
    direction: rtl;
    text-align: right;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--brand);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--brand-2);
}

.section-title {
    font-size: 2.25rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--ink);
}

.section-subtitle {
    font-size: 1.1rem;
    text-align: center;
    color: var(--muted);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.content-section {
    padding: 4rem 0;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--brand);
    color: white;
    padding: 8px;
    z-index: 10000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* =================
   HEADER
   ================= */
.main-header {
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(248, 250, 252, 0.8); /* Match --surface */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s, border-color 0.3s;
}

@media (prefers-color-scheme: dark) {
    .main-header {
        background-color: rgba(11, 18, 32, 0.8);
    }
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    flex-shrink: 0; /* Prevent logo from shrinking */
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ink);
}
.logo:hover { color: var(--ink); }

.main-nav {
    display: flex;
    align-items: center;
    flex-grow: 1; /* Allow nav to take up space */
    justify-content: flex-end; /* Align hamburger to the left in RTL */
}

.main-menu {
    display: none;
    list-style: none;
}

.main-menu li {
    margin-right: 1.5rem;
}

.main-menu a {
    color: var(--muted);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

.main-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--brand);
    transition: width 0.3s ease;
}

.main-menu a:hover, .main-menu a.active {
    color: var(--ink);
}
.main-menu a:hover::after {
    width: 100%;
}

.mobile-menu-toggle {
    display: block;
    background: none;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 22px;
    position: relative;
    z-index: 1001;
}

.hamburger-icon,
.hamburger-icon::before,
.hamburger-icon::after {
    content: '';
    display: block;
    background-color: var(--ink);
    height: 3px;
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
}

.hamburger-icon {
    position: relative;
}

.hamburger-icon::before {
    position: absolute;
    top: -8px;
    width: 100%;
}

.hamburger-icon::after {
    position: absolute;
    top: 8px;
    width: 100%;
}

.main-nav.is-open .hamburger-icon {
    background-color: transparent;
}

.main-nav.is-open .hamburger-icon::before {
    transform: translateY(8px) rotate(45deg);
}

.main-nav.is-open .hamburger-icon::after {
    transform: translateY(-8px) rotate(-45deg);
}

.main-nav.is-open .main-menu {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 70px;
    right: 0;
    width: 100%;
    height: calc(100vh - 70px);
    background-color: var(--surface);
    padding: 2rem;
    text-align: center;
}

.main-nav.is-open .main-menu li {
    margin: 0 0 2rem 0;
}

.main-nav.is-open .main-menu a {
    font-size: 1.5rem;
}

.header-cta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
}

.header-icon-btn {
    display: none; /* Hidden on mobile, shown on desktop */
    color: var(--muted);
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.3s, color 0.3s;
}
.header-icon-btn:hover {
    background-color: var(--accent);
    color: var(--brand);
}
.header-icon-btn i {
    width: 22px;
    height: 22px;
    display: block;
}

.header-main-cta {
    display: none; /* Hidden on mobile, shown on desktop */
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    background-color: var(--brand);
    color: #fff;
}
.header-main-cta:hover {
    background-color: var(--brand-2);
    color: #fff;
}
.header-main-cta i {
    width: 18px;
    height: 18px;
    margin-left: 0.5rem;
}

/* =================
   HERO SECTION
   ================= */
.hero-section {
    position: relative;
    padding: 6rem 0;
    overflow: hidden;
    background: var(--accent);
    color: var(--ink);
}

.hero-section::before {
    content: none; /* Removed the dark overlay */
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(11, 18, 32, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.hero-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2rem;
}

.hero-content {
    position: relative;
    z-index: 2;
    color: var(--ink);
}
@media (prefers-color-scheme: dark) {
    .hero-content { color: #fff; }
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--ink);
    animation: slide-in-top 0.6s both;
}

.hero-subtitle {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 2rem;
    color: var(--muted);
    opacity: 0.9;
    animation: slide-in-top 0.6s 0.2s both;
}

.hero-cta-group {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
    animation: slide-in-bottom 0.6s 0.4s both;
}

.cta-button {
    padding: 0.8rem 2rem;
    border-radius: 99px;
    font-weight: 700;
    font-size: 1rem;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
}

.primary-cta {
    background-color: var(--brand);
    color: #fff;
    box-shadow: 0 4px 15px rgba(14, 124, 255, 0.2);
}
.primary-cta:hover {
    background-color: #fff;
    color: var(--brand);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 124, 255, 0.3);
}

.secondary-cta {
    background-color: transparent;
    color: var(--brand);
    border-color: var(--brand);
}
.secondary-cta:hover {
    background-color: var(--brand);
    color: #fff;
}

.usp-tags {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    color: var(--muted);
    animation: slide-in-bottom 0.6s 0.6s both;
}
.usp-tags span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}
.usp-tags i {
    width: 18px;
    height: 18px;
    color: var(--brand-2);
}

.hero-image-wrapper {
    position: relative;
    width: 100%;
    max-width: 450px;
    animation: fade-in 1s 0.5s both;
}

.hero-image {
    width: 100%;
    height: auto;
    border-radius: 24px;
    object-fit: cover;
    box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.2);
}

/* Hero Animations */
@keyframes slide-in-top {
  from { transform: translateY(-30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes slide-in-bottom {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes fade-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@media (min-width: 992px) {
    .hero-section {
        padding: 8rem 0;
    }
    .hero-container {
        flex-direction: row;
        justify-content: space-between;
        text-align: right;
    }
    .hero-content {
        flex: 0 0 50%;
    }
    .hero-image-wrapper {
        flex: 0 0 45%;
    }
    .hero-cta-group, .usp-tags {
        justify-content: flex-start;
    }
    .hero-title {
        font-size: 3.5rem;
    }
}

/* =================
   INTRO BAR & DEMO BANNERS
   ================= */
.intro-bar {
    padding: 2rem 0;
    background-color: var(--accent);
}
.demo-text {
    background-color: var(--card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--muted);
    box-shadow: 0 8px 20px -5px var(--shadow-color);
}
.demo-text i {
    width: 20px;
    height: 20px;
    color: var(--brand);
    margin-left: 0.5rem;
}
.demo-link {
    font-weight: 700;
    color: var(--brand);
    text-decoration: underline;
    text-underline-offset: 3px;
    margin-right: 0.25rem;
}
.demo-banner-section {
    background-color: var(--card);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}
.demo-banner-2 p {
    color: var(--ink);
}
.demo-banner-2 a {
    color: var(--brand);
}
.demo-banner-section {
    background-color: var(--card);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    text-align: center;
    padding: 1.25rem;
}

/* =================
   SERVICES SECTION
   ================= */
.services-grid {
    display: grid;
    gap: 1.5rem;
}

.service-card {
    background-color: var(--card);
    padding: 2.5rem 2rem;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px var(--shadow-color);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 20px var(--shadow-color);
}

.service-icon {
    margin: 0 auto 1.5rem;
    color: var(--brand);
}
.service-icon i {
    width: 56px;
    height: 56px;
    stroke-width: 1.5;
    color: var(--brand);
}

.service-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--ink);
}

.service-description {
    color: var(--muted);
}

/* =================
   TEAM SECTION
   ================= */
.team-grid {
    display: grid;
    gap: 1.5rem;
}

.doctor-card {
    background-color: var(--card);
    border-radius: 16px;
    overflow: hidden;
    text-align: center;
    padding-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.doctor-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 16px var(--shadow-color);
}

.doctor-photo {
    width: 100%;
    height: 250px;
    object-fit: cover;
    margin-bottom: 1rem;
}

.doctor-name {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.doctor-specialty {
    color: var(--brand);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.doctor-meta {
    font-size: 0.9rem;
    color: var(--muted);
}

/* =================
   GALLERY SECTION
   ================= */
.gallery-section {
    background-color: var(--accent);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.gallery-grid figure {
    overflow: hidden;
    box-shadow: 0 4px 12px var(--shadow-color);
    border-radius: 12px;
}

.gallery-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-grid figure:hover img {
    transform: scale(1.05);
}

/* =================
   TESTIMONIALS SECTION
   ================= */
.testimonials-grid {
    display: grid;
    gap: 1.5rem;
}

.testimonial-card {
    background-color: var(--card);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.rating {
    color: #FFC107;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.testimonial-text {
    font-style: italic;
    margin-bottom: 1rem;
    color: var(--ink);
}

.testimonial-card cite {
    font-style: normal;
    font-weight: 500;
    color: var(--muted);
}

/* =================
   FAQ SECTION
   ================= */
.faq-grid {
    display: grid;
    gap: 2rem;
}

.process-steps h3, .faq-items h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--brand);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.process-steps ol {
    list-style: none;
    counter-reset: process-counter;
}

.process-steps li {
    position: relative;
    padding-right: 2.5rem;
    margin-bottom: 1.5rem;
}

.process-steps li::before {
    counter-increment: process-counter;
    content: counter(process-counter);
    position: absolute;
    right: 0;
    top: 0;
    width: 32px;
    height: 32px;
    background: var(--brand-2);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

details {
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}
details:last-of-type {
    border-bottom: none;
}

summary {
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
summary::-webkit-details-marker {
    display: none;
}

summary::after {
    content: '+';
    font-size: 1.5rem;
    color: var(--brand);
    transition: transform 0.3s ease;
}

details[open] summary::after {
    transform: rotate(45deg);
}

details p {
    margin-top: 1rem;
    color: var(--muted);
}

/* =================
   INSURANCE SECTION
   ================= */
.insurance-section {
    background-color: var(--accent);
    padding: 4rem 0;
}

.insurance-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 3rem;
}

.insurance-logo {
    flex-basis: 150px;
    text-align: center;
}

.insurance-logo img {
    max-height: 45px;
    width: auto;
    margin: 0 auto;
    filter: grayscale(100%) opacity(0.7);
    transition: filter 0.3s ease;
}
.insurance-logo:hover img {
    filter: grayscale(0%) opacity(1);
}

/* =================
   CONTACT FORM
   ================= */
.contact-form {
    display: grid;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--muted);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--surface);
    color: var(--ink);
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(14, 124, 255, 0.2);
}

.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}
.checkbox-wrapper input[type="checkbox"] {
    margin-top: 5px;
    width: auto;
}
.checkbox-wrapper label {
    font-size: 0.9rem;
    color: var(--muted);
    margin: 0;
}

.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
}

.form-group.error input,
.form-group.error textarea {
    border-color: #ef4444;
}
.form-group.error .error-message {
    display: block;
}

.form-success-message {
    background-color: var(--brand-2);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    margin-top: 1rem;
}

/* =================
   FOOTER
   ================= */
.main-footer {
    background-color: var(--card);
    color: var(--muted);
    padding: 4rem 0 2rem;
    border-top: 1px solid var(--border-color);
}

.footer-grid {
    display: grid;
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-title {
    font-size: 1.2rem;
    color: var(--ink);
    margin-bottom: 1rem;
}

.footer-links, .footer-contact {
    list-style: none;
}
.footer-links li, .footer-contact li {
    margin-bottom: 0.5rem;
}
.footer-links a, .footer-contact a {
    color: var(--muted);
}
.footer-links a:hover, .footer-contact a:hover {
    color: var(--brand);
}

.footer-socials {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}
.footer-socials a {
    color: var(--muted);
}
.footer-socials a:hover {
    color: var(--brand);
}
.footer-socials i {
    width: 24px;
    height: 24px;
}

.footer-bottom {
    text-align: center;
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}
.footer-bottom p {
    margin-bottom: 0.5rem;
}

/* =================
   STICKY MOBILE BAR
   ================= */
.sticky-mobile-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    background-color: var(--surface);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    z-index: 999;
}

.sticky-bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    color: var(--muted);
    font-size: 0.75rem;
}
.sticky-bar-item svg, .sticky-bar-item i {
    margin-bottom: 0.25rem;
    width: 24px;
    height: 24px;
}
.sticky-bar-item.cta {
    background-color: var(--brand);
    color: white;
}
.sticky-bar-item.cta:hover {
    color: white;
    background-color: #0062cc;
}

/* =================
   ANIMATIONS
   ================= */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* =================
   MEDIA QUERIES (Mobile First)
   ================= */

/* Small devices (tablets, 768px and up) */
@media (min-width: 768px) {
    .hero-title {
        font-size: 3.5rem;
    }
    .hero-subtitle {
        font-size: 1.25rem;
    }
    .mobile-menu-toggle {
        display: none;
    }
    .main-nav {
        justify-content: flex-start; /* Revert for desktop menu alignment */
    }
    .main-menu {
        display: flex;
    }
    .header-icon-btn {
        display: block;
    }
    .header-main-cta {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .team-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .testimonials-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    .faq-grid {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
    .contact-form {
        grid-template-columns: 1fr 1fr;
    }
    .form-group-full {
        grid-column: 1 / -1;
    }
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr;
    }
    .sticky-mobile-bar {
        display: none;
    }
}

/* Large devices (desktops, 1024px and up) */
@media (min-width: 1024px) {
    .hero-title {
        font-size: 4rem;
    }
    .content-section {
        padding: 6rem 0;
    }
}
