/* Base Styles & Variables */
:root {
    /* Color Palette */
    --primary-color: #1ead4c; /* Hansa Green */
    --primary-light: #22c55e;
    --primary-dark: #15803d;
    /* Backwards-compatible aliases used in some templates */
    --primary: var(--primary-color);
    --secondary: var(--secondary-color);
    --secondary-color: #0f172a; /* Dark Blue */
    --accent-color: #f59e0b;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    
    /* Typography */
    --font-arabic: 'Cairo', sans-serif;
    --font-english: 'Inter', sans-serif;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-arabic);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* English overrides */
html[dir="ltr"] body {
    font-family: var(--font-english);
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

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

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
    border: none;
    font-family: inherit;
    font-size: 1rem;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.6);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

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

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition-normal);
}

.navbar.scrolled {
    box-shadow: var(--shadow-sm);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    display: flex;
    align-items: center;
}

.site-logo {
    height: 45px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    font-weight: 600;
    color: var(--text-main);
    transition: var(--transition-fast);
    position: relative;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition-normal);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-lang {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    font-weight: 600;
    transition: var(--transition-fast);
}

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

.hamburger {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-main);
}

/* Hero Section */
.hero {
    padding: 150px 0 80px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: radial-gradient(circle at top right, rgba(13,148,136,0.1), transparent 50%);
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(13, 148, 136, 0.1);
    color: var(--primary-color);
    border-radius: 50px;
    font-weight: 600;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.hero-content h1 {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}

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

.hero-image {
    position: relative;
    border-radius: 30px;
    z-index: 1;
}

.hero-image img {
    width: 100%;
    border-radius: 30px;
    box-shadow: var(--shadow-lg);
    object-fit: cover;
}

.hero-image::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    bottom: 20px;
    left: 20px;
    background: var(--gradient-primary);
    border-radius: 30px;
    z-index: -1;
    opacity: 0.1;
}

.floating-card {
    position: absolute;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 15px 25px;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 15px;
    animation: float 4s ease-in-out infinite;
}

.floating-card i {
    font-size: 2rem;
    color: var(--secondary-color);
}

.floating-card.card-1 {
    top: 30px;
    left: -40px;
    animation-delay: 0s;
}

.floating-card.card-2 {
    bottom: 40px;
    right: -30px;
    animation-delay: 2s;
}

html[dir="ltr"] .floating-card.card-1 {
    left: auto;
    right: -40px;
}

html[dir="ltr"] .floating-card.card-2 {
    right: auto;
    left: -30px;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

/* About Section */
.about {
    padding: 80px 0;
    background-color: white;
}

.about-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.about-image img {
    width: 100%;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--primary-dark);
}

.about-content h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-main);
}

.about-content p {
    color: var(--text-muted);
    margin-bottom: 15px;
}

.about-list {
    margin-top: 20px;
}

.about-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-weight: 600;
}

.about-list li i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

/* Services Section */
.services {
    padding: 100px 0;
    background-color: var(--bg-main);
}

.section-header {
    max-width: 600px;
    margin: 0 auto 60px;
}

.section-header p {
    color: var(--text-muted);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background: white;
    padding: 40px 30px;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    border: 1px solid transparent;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.service-icon {
    width: 70px;
    height: 70px;
    background: rgba(13, 148, 136, 0.1);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    transition: var(--transition-normal);
}

.service-icon i {
    font-size: 2rem;
    color: var(--primary-color);
}

.service-card:hover .service-icon {
    background: var(--gradient-primary);
}

.service-card:hover .service-icon i {
    color: white;
}

.service-card h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.service-card p {
    color: var(--text-muted);
}

/* Footer */
.footer {
    background: var(--text-main);
    color: white;
    padding: 80px 0 20px;
}

.footer-top {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 50px;
    margin-bottom: 50px;
}

.footer-logo {
    color: white;
    margin-bottom: 20px;
}

.footer-logo i {
    color: var(--primary-light);
}

.footer-info p {
    color: #cbd5e1;
    margin-bottom: 20px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-normal);
}

.social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

.footer-links h4, .footer-contact h4 {
    font-size: 1.2rem;
    margin-bottom: 25px;
    position: relative;
    display: inline-block;
}

.footer-links h4::after, .footer-contact h4::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 0;
    width: 30px;
    height: 2px;
    background: var(--primary-color);
}

html[dir="ltr"] .footer-links h4::after, html[dir="ltr"] .footer-contact h4::after {
    right: auto;
    left: 0;
}

.footer-links ul li {
    margin-bottom: 15px;
}

.footer-links ul li a {
    color: #cbd5e1;
    transition: var(--transition-fast);
}

.footer-links ul li a:hover {
    color: var(--primary-light);
    padding-inline-start: 5px;
}

.footer-contact ul li {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    color: #cbd5e1;
}

.footer-contact ul li i {
    color: var(--primary-light);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #94a3b8;
}

/* AI Chatbot */
.chatbot-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
}

html[dir="ltr"] .chatbot-container {
    right: auto;
    left: 30px;
}

.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.4);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: chatbotFloat 3s infinite ease-in-out;
}

@keyframes chatbotFloat {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    animation-play-state: paused;
}

.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0);
    transform-origin: bottom right;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    pointer-events: none;
}

html[dir="ltr"] .chatbot-window {
    right: auto;
    left: 0;
    transform-origin: bottom left;
}

.chatbot-window.open {
    transform: scale(1);
    opacity: 1;
    pointer-events: all;
}

.chatbot-header {
    background: var(--gradient-primary);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-agent {
    display: flex;
    align-items: center;
    gap: 12px;
}

.agent-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    position: relative;
}

.online-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: #10b981;
    border-radius: 50%;
    border: 2px solid var(--primary-dark);
}

.agent-info h4 {
    font-size: 1rem;
    margin: 0;
}

.agent-info p {
    font-size: 0.8rem;
    margin: 0;
    opacity: 0.8;
}

.chatbot-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.chatbot-close:hover {
    transform: rotate(90deg);
}

.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #f8fafc;
}

.message {
    display: flex;
    max-width: 85%;
}

.message.bot {
    align-self: flex-start;
}

.message.user {
    align-self: flex-end;
}

.msg-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.message.bot .msg-bubble {
    background: white;
    color: var(--text-main);
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

html[dir="ltr"] .message.bot .msg-bubble {
    border-bottom-right-radius: 18px;
    border-bottom-left-radius: 4px;
}

.message.user .msg-bubble {
    background: var(--primary-color);
    color: white;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 5px rgba(13, 148, 136, 0.2);
}

html[dir="ltr"] .message.user .msg-bubble {
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 4px;
}

.chatbot-input {
    padding: 15px;
    background: white;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
}

.chatbot-input input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    outline: none;
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.chatbot-input input:focus {
    border-color: var(--primary-color);
}

.chatbot-input button {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.chatbot-input button:hover {
    background: var(--primary-dark);
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 5px 10px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Responsive */
@media (max-width: 992px) {
    .hero-content h1 { font-size: 2.8rem; }
    .hero-container, .about-container { grid-template-columns: 1fr; gap: 40px; }
    .hero-image { order: -1; }
    .floating-card { display: none; } /* Hide floating cards on smaller screens for cleaner look */
    .footer-top { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 768px) {
    .nav-links {
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        padding: 20px;
        gap: 15px;
        box-shadow: var(--shadow-md);
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
        transition: 0.4s ease-out;
    }
    
    .nav-links.active {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
    
    .hamburger { display: block; }
    .hero { padding-top: 120px; }
    .hero-content h1 { font-size: 2.2rem; }
    
    .chatbot-window {
        width: 90vw;
        right: 5vw;
        bottom: 90px;
    }
    
    html[dir="ltr"] .chatbot-window {
        left: 5vw;
        right: auto;
    }
}

/* Internal Pages General Styles */
.page-header {
    padding: 120px 0 60px;
    background: var(--gradient-primary);
    color: white;
    text-align: center;
}

.page-header h1 {
    font-size: 2.5rem;
    margin: 0;
}

/* About Page Specific Styles */
.about-page-content {
    padding: 80px 0;
}

.about-block {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
    margin-bottom: 80px;
}

.about-block-image img {
    width: 100%;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
}

.mission-vision-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.mv-card {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: var(--transition-normal);
}

.mv-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.mv-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.mv-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--primary-dark);
}

/* Services Page Specific Styles */
.services-page-content {
    padding: 80px 0;
}

/* Clinics Page Specific Styles */
.clinics-page-content {
    padding: 80px 0;
}

/* Blog Page Specific Styles */
.blog-page-content {
    padding: 80px 0;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
}

.blog-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.blog-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.blog-image {
    width: 100%;
    height: 200px;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.blog-image i {
    font-size: 3rem;
    color: var(--text-muted);
    opacity: 0.5;
}

.blog-content {
    padding: 30px;
}

.blog-content h3 {
    font-size: 1.25rem;
    margin-bottom: 15px;
    color: var(--text-main);
}

.blog-content p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.read-more {
    color: var(--primary-color);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition-fast);
}

.read-more:hover {
    color: var(--primary-dark);
    gap: 8px;
}

@media (max-width: 768px) {
    .about-block, .mission-vision-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Contact Page Specific Styles */
.contact-page-content {
    padding: 80px 0;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 50px;
}

.contact-info-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition-normal);
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.info-card i {
    font-size: 2rem;
    color: var(--primary-color);
}

.info-card h4 {
    margin: 0;
    color: var(--text-main);
    font-size: 1.1rem;
}

.contact-social {
    margin-top: 10px;
}

.contact-social a {
    background: white;
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.contact-social a:hover {
    background: var(--primary-color);
    color: white;
}

.contact-form-panel {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
}

.form-group {
    margin-bottom: 25px;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 15px 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    background: var(--bg-main);
    transition: var(--transition-fast);
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(30, 173, 76, 0.1);
}

.branches-container {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    margin-bottom: 20px;
}

.branch-card {
    background: var(--bg-main);
    box-shadow: none;
    margin-bottom: 15px;
    align-items: flex-start;
    padding: 20px;
}

.branch-card:last-child {
    margin-bottom: 0;
}

.branch-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
}

.map-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 5px;
    transition: var(--transition-fast);
}

.map-link:hover {
    color: var(--primary-dark);
}
