/* CSS based on the WordPress design with RTL support */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #518272;
    --secondary-color: #346060;
    --fade-color: #c2d3c7;
    --accent-color: #6ba085;
    --gold-accent: #d4af37;
    --white: #ffffff;
    --off-white: #fefefe;
    --light-gray: #f8f9fa;
    --medium-gray: #e9ecef;
    --dark-gray: #2c3e50;
    --text-primary: #1a1a1a;
    --text-secondary: #555555;
    --shadow-light: rgba(81, 130, 114, 0.1);
    --shadow-medium: rgba(81, 130, 114, 0.2);
    --shadow-heavy: rgba(81, 130, 114, 0.3);
    --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    --gradient-secondary: linear-gradient(135deg, var(--fade-color) 0%, var(--white) 100%);
    --gradient-gold: linear-gradient(135deg, var(--gold-accent) 0%, #f4d03f 100%);
}

body {
    font-family: 'Cairo', 'Tajawal', Arial, sans-serif;
    line-height: 1.7;
    color: var(--text-primary);
    direction: rtl;
    overflow-x: hidden;
    background: var(--off-white);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Loading Screen */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
    color: var(--white);
}

.loader-logo {
    width: 120px;
    height: auto;
    margin-bottom: 2rem;
    animation: pulse 2s infinite;
}

.loader-text {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease-out;
}

.loader-progress {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.loader-bar {
    height: 100%;
    background: var(--white);
    border-radius: 2px;
    animation: loading 2s ease-in-out;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.4s ease;
    padding: 1rem 0;
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(25px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--secondary-color);
    transition: all 0.3s ease;
}

.logo img {
    height: 60px;
    width: auto;
    transition: all 0.3s ease;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.header.scrolled .logo img {
    height: 45px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2.5rem;
    align-items: center;
}

.nav-menu a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    position: relative;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 25px;
}

.nav-menu a::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-menu a:hover::before {
    width: 100%;
}

.nav-menu a:hover {
    color: var(--primary-color);
    background: rgba(81, 130, 114, 0.05);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    background: var(--gradient-secondary);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    margin-top: 80px;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><radialGradient id="grad1" cx="50%" cy="50%" r="50%"><stop offset="0%" style="stop-color:rgba(81,130,114,0.05);stop-opacity:1" /><stop offset="100%" style="stop-color:rgba(81,130,114,0);stop-opacity:0" /></radialGradient></defs><circle cx="200" cy="200" r="300" fill="url(%23grad1)"/><circle cx="800" cy="800" r="400" fill="url(%23grad1)"/></svg>');
    animation: floatBackground 20s ease-in-out infinite;
}

.hero-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 2;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 4rem;
    align-items: center;
    min-height: 80vh;
}

.doctor-image-container {
    position: relative;
    perspective: 1000px;
}

.doctor-image {
    width: 100%;
    max-width: 450px;
    height: auto;
    border-radius: 25px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    background: var(--white);
    padding: 1rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
    transition: all 0.6s ease;
    transform-style: preserve-3d;
}

.doctor-image:hover {
    transform: rotateY(5deg) rotateX(5deg) translateZ(20px);
    box-shadow: 0 35px 80px rgba(0, 0, 0, 0.2);
}

.doctor-image img {
    width: 100%;
    height: auto;
    border-radius: 20px;
    transition: all 0.6s ease;
}

.floating-elements {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.floating-icon {
    position: absolute;
    color: var(--primary-color);
    opacity: 0.1;
    animation: float 6s ease-in-out infinite;
}

.floating-icon:nth-child(1) { top: 20%; right: 10%; font-size: 2rem; animation-delay: 0s; }
.floating-icon:nth-child(2) { top: 60%; right: 20%; font-size: 1.5rem; animation-delay: 2s; }
.floating-icon:nth-child(3) { top: 30%; left: 15%; font-size: 1.8rem; animation-delay: 4s; }
.floating-icon:nth-child(4) { bottom: 30%; right: 5%; font-size: 1.3rem; animation-delay: 1s; }

.hero-text {
    animation: fadeInRight 1.2s ease-out;
}

.hero-text h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    font-weight: 900;
    line-height: 1.2;
    position: relative;
}

.hero-text h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 0;
    width: 100px;
    height: 4px;
    background: var(--gradient-gold);
    border-radius: 2px;
}

.hero-text h2 {
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-weight: 600;
    opacity: 0.9;
}

.hero-description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    line-height: 1.8;
    max-width: 600px;
}

.cta-buttons {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.btn {
    padding: 16px 32px;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.4s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: 0 8px 25px rgba(81, 130, 114, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(81, 130, 114, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    box-shadow: 0 8px 25px rgba(81, 130, 114, 0.1);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(81, 130, 114, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 12px 24px;
    font-size: 1rem;
}

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

.stats-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.stat-item {
    text-align: center;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary-color);
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-top: 0.5rem;
}

/* About Section */
.about {
    padding: 120px 0;
    background: var(--white);
    position: relative;
}

.about::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
}

.section-title {
    text-align: center;
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-weight: 900;
    position: relative;
}

.section-subtitle {
    text-align: center;
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 4rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.credentials {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.credential-item {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 25px;
    border: 1px solid var(--medium-gray);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.credential-item::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: var(--gradient-primary);
    border-radius: 50%;
    transform: translate(30px, -30px);
    opacity: 0.1;
    transition: all 0.4s ease;
}

.credential-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.credential-item:hover::before {
    transform: translate(20px, -20px) scale(1.2);
    opacity: 0.15;
}

.credential-item i {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    display: block;
}

.credential-item h3 {
    color: var(--secondary-color);
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.4;
}

/* Services Section */
.services {
    padding: 120px 0;
    background: var(--gradient-secondary);
    position: relative;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    margin-top: 4rem;
}

.service-card {
    background: var(--white);
    padding: 3rem 2.5rem;
    border-radius: 30px;
    text-align: center;
    transition: all 0.5s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
}

.service-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    transition: all 0.4s ease;
}

.service-card:hover .service-icon {
    transform: rotateY(360deg);
    background: var(--gradient-gold);
}

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

.service-card h3 {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    font-weight: 700;
    font-size: 1.4rem;
}

.service-card p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

/* Contact Section */
.contact {
    padding: 120px 0;
    background: var(--white);
    position: relative;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-top: 4rem;
}

.contact-info {
    background: var(--gradient-secondary);
    padding: 3rem;
    border-radius: 30px;
    position: relative;
    overflow: hidden;
}

.contact-info::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: shimmer 4s ease-in-out infinite;
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    transition: all 0.4s ease;
    position: relative;
    z-index: 2;
}

.contact-item:hover {
    transform: translateX(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    background: var(--white);
}

.contact-item i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-left: 1.5rem;
    width: 50px;
    text-align: center;
    transition: all 0.3s ease;
}

.contact-item:hover i {
    transform: scale(1.2);
    color: var(--gold-accent);
}

.contact-item-content h4 {
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.contact-item a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.contact-item a:hover {
    color: var(--primary-color);
}

.map-container {
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    position: relative;
}

.map-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-primary);
    opacity: 0.1;
    z-index: 1;
    pointer-events: none;
}

.map-container iframe {
    width: 100%;
    height: 500px;
    border: none;
    transition: all 0.3s ease;
}

/* WhatsApp Button */
.whatsapp-float {
    position: fixed;
    width: 70px;
    height: 70px;
    bottom: 30px;
    left: 30px;
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: white;
    border-radius: 50%;
    text-align: center;
    font-size: 2rem;
    box-shadow: 0 8px 30px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.4s ease;
    animation: pulse 3s infinite;
}

.whatsapp-float:hover {
    transform: scale(1.15);
    box-shadow: 0 12px 40px rgba(37, 211, 102, 0.6);
}

.whatsapp-float::before {
    content: 'تواصل معنا';
    position: absolute;
    right: 80px;
    background: var(--white);
    color: var(--text-primary);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
}

.whatsapp-float:hover::before {
    opacity: 1;
    transform: translateX(0);
}

/* Footer */
.footer {
    background: var(--gradient-primary);
    color: var(--white);
    padding: 3rem 0 1rem;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20"><path d="M0,10 Q25,0 50,10 T100,10 V20 H0 Z" fill="rgba(255,255,255,0.1)"/></svg>');
    background-size: 200px 40px;
    animation: wave 3s ease-in-out infinite;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    position: relative;
    z-index: 2;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: var(--white);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: var(--white);
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-section ul li a:hover {
    color: var(--gold-accent);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 2;
}

/* Social Media Links */
.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--white);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.social-links a i {
    font-size: 1.2rem;
}

/* Flash Messages */
.flash-messages {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 1001;
    max-width: 400px;
}

.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 10px;
    position: relative;
    animation: slideIn 0.5s ease;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert .close {
    position: absolute;
    top: 0.5rem;
    left: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Utility Classes */
.text-center { text-align: center; }
.mt-4 { margin-top: 2rem; }
.mb-4 { margin-bottom: 2rem; }

/* Animations */
@keyframes loading {
    0% { width: 0; }
    50% { width: 70%; }
    100% { width: 100%; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 8px 30px rgba(37, 211, 102, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 12px 40px rgba(37, 211, 102, 0.6); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}

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

@keyframes floatBackground {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-50px) rotate(180deg); }
}

@keyframes shimmer {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes wave {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-50px); }
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Scroll reveal animations */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s ease;
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s ease;
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .hero-content { gap: 2rem; }
    .contact-content { gap: 2rem; }
}

@media (max-width: 768px) {
    .nav-menu { display: none; }
    
    .logo {
        font-size: 1.4rem;
    }
    
    .logo img {
        height: 45px;
    }

    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }

    .hero-text h1 {
        font-size: 2.5rem;
    }

    .stats-bar {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .doctor-image {
        max-width: 350px;
    }

    .contact-content {
        grid-template-columns: 1fr;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

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

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

    .whatsapp-float {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}