:root {
    --primary-blue: #0092AB;
    --secondary-blue: #008BA8;
    --accent-blue: #0093AC;
    --neutral-bg: #F5F7F8;
    --text-dark: #0A2E36;
    --white-overlay: rgba(245, 247, 248, 0.75);
    --font-ar: 'Tajawal', sans-serif;
    --font-en: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.lang-ar {
    font-family: var(--font-ar);
}

body.lang-en {
    font-family: var(--font-en);
}

body {
    background-color: var(--neutral-bg);
    background-image: url('background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-dark);
    position: relative;
    transition: font-family 0.3s ease;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--white-overlay);
    backdrop-filter: blur(1px);
    z-index: 1;
}

.container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 900px;
    padding: 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 90vh;
}

/* Language Toggle */
.lang-toggle-container {
    position: absolute;
    top: 2rem;
    right: 2rem;
    z-index: 10;
}

/* In RTL, left is right. We need to manually handle this if we want fixed absolute position */
html[dir="rtl"] .lang-toggle-container {
    right: auto;
    left: 2rem;
}

html[dir="ltr"] .lang-toggle-container {
    left: auto;
    right: 2rem;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 94, 184, 0.2);
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    color: var(--primary-blue);
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.lang-btn:hover {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 146, 171, 0.2);
}

/* Logo and Icon Container - Side by Side */
.logo-icon-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.logo-wrapper {
    display: flex;
    align-items: center;
}

.logo {
    height: 60px;
    width: auto;
    object-fit: contain;
    display: block;
    animation: logoFloat 4s ease-in-out infinite;
    transform-origin: center;
}

/* Main Content */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.icon-wrapper {
    color: var(--primary-blue);
    display: flex;
    align-items: center;
}

.medical-icon {
    width: 64px;
    height: 64px;
}

.title {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 1.5rem;
    line-height: 1.2;
    animation: titleBreath 5s ease-in-out infinite;
}

body.lang-en .title {
    font-weight: 800;
    /* Inter weighting adjustment */
    letter-spacing: -0.02em;
}

.description {
    font-size: 1.5rem;
    line-height: 1.6;
    color: #4a5568;
    max-width: 700px;
    margin: 0 auto 3rem;
    font-weight: 400;
    animation: gentleSlide 3s ease-out;
}

body.lang-en .description {
    font-size: 1.35rem;
    /* Slightly smaller for English density */
}

/* Trust Badge */
.badge-container {
    margin-top: 1rem;
}

.trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    color: var(--primary-blue);
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 4px 6px rgba(0, 94, 184, 0.1);
    border: 1px solid rgba(0, 94, 184, 0.1);
    font-family: 'Inter', sans-serif;
    direction: ltr;
    transition: all 0.3s ease;
    animation: badgeGlow 3s ease-in-out infinite;
}

.trust-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 94, 184, 0.2);
}

.shield-icon {
    color: var(--accent-blue);
    animation: shieldPulse 4s ease-in-out infinite;
}

/* Footer & Loader */
.footer {
    width: 100%;
    color: #718096;
    font-size: 0.9rem;
    margin-top: auto;
    animation: fadeIn 2s ease-out;
}

.loading-bar-container {
    width: 120px;
    height: 4px;
    background-color: #e2e8f0;
    border-radius: 2px;
    margin: 0 auto 1.5rem;
    overflow: hidden;
    position: relative;
    direction: ltr;
    /* Loader direction always same */
}

.loading-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 50%;
    background-color: var(--accent-blue);
    border-radius: 2px;
    animation: loading 2s infinite ease-in-out;
}

/* Animations */
@keyframes loading {
    0% {
        left: -50%;
        width: 30%;
    }

    50% {
        left: 40%;
        width: 60%;
    }

    100% {
        left: 100%;
        width: 30%;
    }
}

/* Logo Float Animation */
@keyframes logoFloat {

    0%,
    100% {
        transform: translateY(0px) scale(1);
    }

    50% {
        transform: translateY(-8px) scale(1.02);
    }
}

/* Pulse Animation for Icon */
@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.15);
        opacity: 0.7;
    }
}

.pulse {
    animation: pulse 2.5s infinite ease-in-out;
}

/* Title Breathing Effect */
@keyframes titleBreath {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.01);
        opacity: 0.95;
    }
}

/* Gentle Slide for Description */
@keyframes gentleSlide {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Badge Glow Effect */
@keyframes badgeGlow {

    0%,
    100% {
        box-shadow: 0 4px 6px rgba(0, 146, 171, 0.1);
    }

    50% {
        box-shadow: 0 4px 12px rgba(0, 146, 171, 0.25);
    }
}

/* Shield Icon Pulse */
@keyframes shieldPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.85;
    }
}

.animate-fade-down {
    animation: fadeDown 1s ease-out;
}

.animate-fade-in {
    animation: fadeIn 1.5s ease-out;
}

.animate-fade-up {
    animation: fadeUp 1s ease-out;
}

@keyframes fadeDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
        height: auto;
        min-height: 100vh;
        padding-top: 5rem;
        /* Space for language toggle */
    }

    .lang-toggle-container {
        top: 1.5rem;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }

    /* Override RTL handling for mobile center alignment */
    html[dir="rtl"] .lang-toggle-container,
    html[dir="ltr"] .lang-toggle-container {
        left: 50%;
        right: auto;
    }

    .title {
        font-size: 2.25rem;
    }

    .description {
        font-size: 1.15rem;
    }

    .desktop-only {
        display: none;
    }

    .trust-badge {
        font-size: 0.8rem;
        padding: 0.6rem 1.2rem;
    }

    .logo-icon-container {
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .logo {
        height: 50px;
    }

    body {
        overflow-y: auto;
    }
}