/* ===================================================
   SPAIN MEDICAL GROUP — style.css
   =================================================== */

/* Reset & Base */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Brand colours (from reference screenshots) */
    --navy: #1e3451;
    /* primary dark navy */
    --navy-dark: #16293f;
    /* footer / second-opinion bg */
    --navy-mid: #2d4a6e;
    /* accent mid */
    --sky: #7bb8d8;
    /* light blue accents */
    --sky-light: #ddeef7;
    /* very light blue bg */
    --sky-card: #c8e2f0;
    /* card background */
    --white: #ffffff;
    --off-white: #f4f8fb;
    /* hero / section bg */
    --text-body: #6b7a8d;
    --text-dark: #1e3451;
    --gray-border: #d6e4ef;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-serif: 'Playfair Display', Georgia, serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    color: var(--text-dark);
    background: var(--white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 28px;
}

/* ===================================================
   HEADER
   =================================================== */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--white);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 90px;
}

/* Logo */
.logo-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    outline: none;
    transition: opacity 0.2s, transform 0.2s;
}

.logo-link:hover {
    opacity: 0.85;
    transform: scale(1.03);
}

.logo-img {
    height: 74px;
    width: auto;
    display: block;
}

/* Nav */
.nav {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 36px;
    align-items: center;
}

.nav-item-dropdown {
    position: relative;
}

.nav-link {
    text-decoration: none;
    color: #333;
    font-size: 14.5px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--navy);
}

.nav-link.active {
    color: var(--navy);
    border-bottom-color: var(--navy);
}

.nav-chevron {
    color: #888;
    transition: transform 0.2s;
}

.nav-item-dropdown:hover .nav-chevron {
    transform: rotate(180deg);
}

/* Services dropdown */
.nav-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    background: var(--white);
    border: 1px solid var(--gray-border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all 0.2s;
    z-index: 200;
}

.nav-item-dropdown:hover .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-item {
    display: block;
    padding: 11px 18px;
    text-decoration: none;
    color: #444;
    font-size: 14px;
    transition: background 0.15s, color 0.15s;
}

.nav-dropdown-item:first-child {
    border-radius: 10px 10px 0 0;
}

.nav-dropdown-item:last-child {
    border-radius: 0 0 10px 10px;
}

.nav-dropdown-item:hover {
    background: var(--sky-light);
    color: var(--navy);
}

/* Language selector */
.language-selector {
    position: relative;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--white);
    border: 1px solid var(--gray-border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 500;
    color: #444;
    transition: all 0.2s;
}

.lang-btn:hover {
    border-color: var(--navy);
    color: var(--navy);
}

.globe-icon {
    color: #777;
    flex-shrink: 0;
}

.chevron-down {
    color: #999;
    transition: transform 0.2s;
}

.lang-btn.active .chevron-down {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--white);
    border: 1px solid var(--gray-border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    min-width: 140px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all 0.2s;
    z-index: 200;
}

.lang-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    text-align: left;
    font-size: 14px;
    color: #444;
    cursor: pointer;
    transition: background 0.15s;
}

.lang-option:first-child {
    border-radius: 10px 10px 0 0;
}

.lang-option:last-child {
    border-radius: 0 0 10px 10px;
}

.lang-option:hover {
    background: var(--sky-light);
    color: var(--navy);
}

/* Mobile menu button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--navy);
    transition: all 0.3s;
}

/* Mobile menu overlay */
.mobile-menu {
    display: none;
    position: fixed;
    top: 90px;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 24px;
    z-index: 999;
}

.mobile-menu.active {
    display: block;
}

.mobile-nav-list {
    list-style: none;
    margin-bottom: 24px;
}

.mobile-nav-list li {
    margin-bottom: 14px;
}

.mobile-nav-link {
    display: block;
    text-decoration: none;
    color: var(--text-dark);
    font-size: 17px;
    font-weight: 500;
    padding: 8px 0;
}

.mobile-nav-link.active {
    color: var(--navy);
    font-weight: 600;
}

.mobile-lang-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-lang-option {
    padding: 12px 16px;
    background: var(--sky-light);
    border: 1px solid var(--gray-border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.mobile-lang-option:hover,
.mobile-lang-option.active {
    background: var(--navy);
    color: var(--white);
    border-color: var(--navy);
}

/* ===================================================
   HERO SECTION
   =================================================== */
.hero {
    position: relative;
    background: linear-gradient(110deg, #f0f7fc 0%, #e8f3fa 40%, #ddeef8 100%);
    padding: 90px 0 100px;
    overflow: hidden;
    min-height: 480px;
    display: flex;
    align-items: center;
}

/* Hero background: hospital photo */
.hero-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('images/new-homepage-pic.png') 70% top / cover no-repeat;
    z-index: 0;
}

/* Semi-transparent overlay so text is legible */
.hero-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right, rgba(224, 238, 248, 0.85) 0%, rgba(224, 238, 248, 0.65) 50%, rgba(224, 238, 248, 0.3) 100%);
    z-index: 1;
}

/* RTL adaptations for main page hero background */
html[dir="rtl"] .hero-bg-image {
    background-position: 30% top;
}

html[dir="rtl"] .hero-bg-overlay {
    background: linear-gradient(to left, rgba(224, 238, 248, 0.85) 0%, rgba(224, 238, 248, 0.65) 50%, rgba(224, 238, 248, 0.3) 100%);
}

/* Abstract geometric background pattern (right side) */
.hero-bg-pattern {
    position: absolute;
    top: 0;
    right: 0;
    width: 55%;
    height: 100%;
    background:
        radial-gradient(circle at 80% 20%, rgba(123, 184, 216, 0.18) 0%, transparent 50%),
        radial-gradient(circle at 95% 70%, rgba(123, 184, 216, 0.12) 0%, transparent 45%);
    overflow: hidden;
    z-index: 2;
}

/* Square grid pattern overlay (matches the screenshot) */
.hero-bg-pattern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(123, 184, 216, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(123, 184, 216, 0.12) 1px, transparent 1px);
    background-size: 48px 48px;
    opacity: 0.7;
}

/* Floating blurred squares (right side decorative blocks) */
.hero-bg-pattern::after {
    content: '';
    position: absolute;
    bottom: 30px;
    right: 60px;
    width: 160px;
    height: 100px;
    background: rgba(180, 215, 235, 0.5);
    border-radius: 12px;
    filter: blur(2px);
    box-shadow:
        -100px -80px 0 rgba(200, 226, 240, 0.45),
        -60px -40px 0 rgba(180, 215, 235, 0.35),
        60px -60px 0 rgba(200, 226, 240, 0.3);
}

.hero-content {
    position: relative;
    z-index: 4;
    max-width: 580px;
}

.hero-tag {
    display: inline-block;
    padding: 7px 18px;
    background: rgba(123, 184, 216, 0.18);
    color: #5a8fa8;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 1.2px;
    border-radius: 20px;
    margin-bottom: 28px;
}

.hero-title {
    font-family: var(--font-serif);
    font-size: 46px;
    font-weight: 800;
    line-height: 1.18;
    color: var(--navy);
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}

.hero-description {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-body);
    margin-bottom: 36px;
    max-width: 480px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 28px;
    font-size: 14.5px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    transition: all 0.22s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--navy);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--navy-mid);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(30, 52, 81, 0.25);
}

.btn-secondary {
    background: var(--white);
    color: var(--navy);
    border: 1.5px solid var(--gray-border);
}

.btn-secondary:hover {
    border-color: var(--navy);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--white);
    border: 1.5px solid var(--white);
    border-radius: 10px;
    padding: 13px 32px;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

/* ===================================================
   WHY SPAIN MEDICAL CARE SECTION
   =================================================== */
.why-section {
    padding: 88px 0 96px;
    background: var(--white);
}

.section-title {
    font-family: var(--font-serif);
    font-size: 34px;
    font-weight: 700;
    color: var(--navy);
    text-align: center;
    margin-bottom: 48px;
    letter-spacing: -0.3px;
}

.section-subtitle {
    font-size: 15px;
    color: var(--text-body);
    text-align: center;
    margin-top: -36px;
    margin-bottom: 48px;
}

/* 5-column card grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

.card {
    background: var(--sky-light);
    border-radius: 14px;
    padding: 32px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    transition: transform 0.25s, box-shadow 0.25s;
    border: 1px solid rgba(123, 184, 216, 0.2);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px rgba(30, 52, 81, 0.1);
}

.card-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    color: var(--navy-mid);
    flex-shrink: 0;
}

.card-title {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--navy);
    line-height: 1.45;
}

/* ===================================================
   FEATURED SPECIALTIES SECTION
   =================================================== */
.specialties-section {
    padding: 88px 0 72px;
    background: var(--sky-light);
}

.specialties-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 48px;
}

.specialty-card {
    background: var(--white);
    border-radius: 18px;
    overflow: hidden;
    text-align: center;
    transition: transform 0.25s, box-shadow 0.25s;
    border: 1px solid rgba(123, 184, 216, 0.2);
}

.specialty-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 36px rgba(30, 52, 81, 0.12);
}

.specialty-img-wrap {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.specialty-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

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

.specialty-title {
    padding: 16px 16px 18px;
    font-size: 14px;
    font-weight: 400;
    color: var(--navy-mid);
    line-height: 1.4;
}

.specialties-footer {
    text-align: center;
}

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 600;
    color: var(--navy);
    text-decoration: none;
    transition: color 0.2s, gap 0.2s;
}

.link-arrow:hover {
    color: var(--navy-mid);
    gap: 10px;
}

/* ===================================================
   SECOND OPINION SECTION
   =================================================== */
.second-opinion-section {
    padding: 64px 0;
    background: var(--navy-dark);
    margin-bottom: 40px;
}

.second-opinion-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.second-opinion-text {
    flex: 1;
}

.second-opinion-title {
    font-family: var(--font-serif);
    font-size: 30px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 12px;
}

.second-opinion-description {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.6;
}

.second-opinion-action {
    flex-shrink: 0;
}

/* ===================================================
   FOOTER
   =================================================== */
.footer {
    background: var(--navy-dark);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 56px 0 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    gap: 56px;
    padding-bottom: 48px;
}

.footer-brand {
    flex: 1;
    max-width: 280px;
}

/* Footer logo box (matches reference — white box with logo) */
.footer-logo-wrap {
    display: inline-block;
    background: var(--white);
    border-radius: 10px;
    padding: 10px 16px;
    margin-bottom: 18px;
}

.footer-logo-img {
    height: 40px;
    width: auto;
    display: block;
}

.footer-tagline {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.6;
}

.footer-links {
    flex-shrink: 0;
}

.footer-links-title {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--sky);
    margin-bottom: 18px;
}

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

.footer-links-list li {
    margin-bottom: 11px;
}

.footer-links-list a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.72);
    font-size: 14px;
    transition: color 0.2s;
}

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

.footer-contact {
    flex-shrink: 0;
}

.footer-contact-title {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--sky);
    margin-bottom: 18px;
}

.footer-contact-info {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.72);
    margin-bottom: 10px;
}

.footer-contact-email {
    display: block;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    transition: color 0.2s;
}


/* ===================================================
   VIDEO PRESENTATION SECTION
   =================================================== */
.video-section {
    padding: 88px 0;
    background: var(--off-white);
    text-align: center;
}

.video-card-wrapper {
    max-width: 860px;
    margin: 0 auto;
}

.video-preview-card {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 20px 40px rgba(30, 52, 81, 0.12);
    border: 1px solid rgba(123, 184, 216, 0.25);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s ease;
}

.video-preview-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 30px 60px rgba(30, 52, 81, 0.22);
}

.video-loop-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.video-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(30, 52, 81, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.video-preview-card:hover .video-card-overlay {
    background: rgba(30, 52, 81, 0.2);
}

.play-button-pulsing {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--white);
    color: var(--navy);
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 5px;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.5);
    animation: pulsePlay 2s infinite;
    transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease;
}

.video-preview-card:hover .play-button-pulsing {
    transform: scale(1.1);
    background: var(--navy);
    color: var(--white);
}

@keyframes pulsePlay {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.6);
    }

    70% {
        box-shadow: 0 0 0 20px rgba(255, 255, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

/* Video Modal Lightbox */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 20, 35, 0.88);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.video-modal.active {
    opacity: 1;
    visibility: visible;
}

.video-modal-content {
    width: 90%;
    max-width: 960px;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.video-modal.active .video-modal-content {
    transform: scale(1);
}

.video-modal-content video {
    width: 100%;
    height: 100%;
    display: block;
}

.video-modal-close {
    position: absolute;
    top: 24px;
    right: 32px;
    color: var(--white);
    font-size: 40px;
    font-weight: 300;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s;
    user-select: none;
    z-index: 10001;
}

.video-modal-close:hover {
    opacity: 1;
    transform: scale(1.1);
}


/* ===================================================
   RESPONSIVE
   =================================================== */
@media (max-width: 1024px) {
    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .specialties-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-title {
        font-size: 38px;
    }

    .nav-list {
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .nav {
        display: none;
    }

    .language-selector {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .hero {
        padding: 70px 0 60px;
        min-height: auto;
    }

    .hero-title {
        font-size: 32px;
    }

    .hero-description {
        font-size: 15px;
    }

    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .specialties-grid {
        grid-template-columns: 1fr 1fr;
    }

    .second-opinion-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-content {
        flex-direction: column;
        gap: 36px;
    }

    .footer-brand {
        max-width: 100%;
    }

    .section-title {
        font-size: 26px;
    }

    .second-opinion-title {
        font-size: 24px;
    }

    .video-section {
        padding: 60px 0;
    }

    .play-button-pulsing {
        width: 64px;
        height: 64px;
    }
}

@media (max-width: 540px) {
    .container {
        padding: 0 18px;
    }

    .hero-title {
        font-size: 27px;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .specialties-grid {
        grid-template-columns: 1fr;
    }

    .specialty-img-wrap {
        height: 180px;
    }

    .video-section {
        padding: 48px 0;
    }

    .play-button-pulsing {
        width: 52px;
        height: 52px;
    }
}

/* ===================================================
   FLOATING CHAT WIDGET
   =================================================== */
.chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: var(--font-sans);
}

/* Floating Action Button */
.chat-widget-btn {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
    color: var(--white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(30, 52, 81, 0.25);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease, background 0.3s ease;
    outline: none;
}

.chat-widget-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 30px rgba(30, 52, 81, 0.35);
}

.chat-widget-btn:active {
    transform: translateY(-1px) scale(0.98);
}

/* Icon style */
.chat-icon {
    width: 28px;
    height: 28px;
    transition: transform 0.3s ease;
}

.chat-widget-btn:hover .chat-icon {
    transform: rotate(5deg) scale(1.05);
}

/* Green Pulsing Badge */
.chat-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #2ecc71;
    border: 2px solid var(--white);
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.6);
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.6);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(46, 204, 113, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0);
    }
}

/* Hover Tooltip */
.chat-tooltip {
    position: absolute;
    right: 75px;
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    background: var(--navy-dark);
    color: var(--white);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

.chat-tooltip::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent transparent var(--navy-dark);
}

.chat-widget-btn:hover .chat-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

/* Options Panel */
.chat-widget-panel {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 330px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(123, 184, 216, 0.3);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(30, 52, 81, 0.18);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px) scale(0.95);
    transition: opacity 0.3s cubic-bezier(0.165, 0.84, 0.44, 1), transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1), visibility 0.3s;
    z-index: 9998;
}

.chat-widget-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Panel Header */
.chat-panel-header {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
    color: var(--white);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.chat-avatar-container {
    position: relative;
    width: 44px;
    height: 44px;
    background: var(--white);
    border-radius: 50%;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.chat-avatar-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.chat-status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #2ecc71;
    border: 2px solid var(--white);
}

.chat-header-text {
    flex: 1;
}

.chat-header-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 2px 0;
}

.chat-header-subtitle {
    font-size: 11.5px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.chat-widget-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 24px;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s, transform 0.2s;
    outline: none;
}

.chat-widget-close:hover {
    color: var(--white);
    transform: scale(1.1);
}

/* Panel Body */
.chat-panel-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.chat-body-msg {
    font-size: 13.5px;
    color: var(--text-dark);
    line-height: 1.5;
    margin: 0 0 6px 0;
    font-weight: 500;
}

/* Chat Buttons */
.chat-panel-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.chat-panel-btn.whatsapp-btn {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.25);
}

.chat-panel-btn.whatsapp-btn:hover {
    background: linear-gradient(135deg, #28e06f 0%, #149c8c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(37, 211, 102, 0.35);
}

.chat-panel-btn.email-btn {
    background: var(--white);
    color: var(--navy);
    border: 1px solid var(--gray-border);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

.chat-panel-btn.email-btn:hover {
    background: var(--sky-light);
    border-color: var(--sky);
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(30, 52, 81, 0.08);
}

.chat-panel-btn:active {
    transform: translateY(-0.5px);
}

.chat-panel-btn .btn-svg {
    flex-shrink: 0;
}

/* ===================================================
   RTL SUPPORT (ARABIC)
   =================================================== */
html[dir="rtl"] .chat-widget {
    right: auto;
    left: 30px;
}

html[dir="rtl"] .chat-widget-panel {
    right: auto;
    left: 0;
}

html[dir="rtl"] .chat-tooltip {
    right: auto;
    left: 75px;
    transform: translateY(-50%) translateX(-10px);
}

html[dir="rtl"] .chat-tooltip::after {
    left: auto;
    right: 100%;
    border-color: transparent var(--navy-dark) transparent transparent;
}

html[dir="rtl"] .chat-widget-btn:hover .chat-tooltip {
    transform: translateY(-50%) translateX(0);
}

html[dir="rtl"] .chat-widget-close {
    right: auto;
    left: 15px;
}

html[dir="rtl"] .chat-panel-header {
    flex-direction: row-reverse;
    text-align: right;
}

/* Responsive adjustment for Mobile */
@media (max-width: 540px) {
    .chat-widget {
        bottom: 20px;
        right: 20px;
    }

    html[dir="rtl"] .chat-widget {
        right: auto;
        left: 20px;
    }

    .chat-widget-panel {
        width: 290px;
        bottom: 75px;
    }

    .chat-tooltip {
        display: none !important;
        /* Hide tooltips on mobile devices */
    }
}
