* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --secondary-color: #06b6d4;
    --accent-color: #8b5cf6;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --text-muted: #94a3b8;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
    --shadow-hover: 0 8px 24px rgba(37, 99, 235, 0.15);
    --gradient: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
    --gradient-hover: linear-gradient(135deg, #1e40af 0%, #0891b2 100%);
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--bg-light);
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Page Transitions */
.page {
    display: none;
    animation: fadeIn 0.5s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Language Selection Page */
#language-selection {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient);
    padding: 40px 20px;
    position: relative;
    overflow: hidden;
}

#language-selection::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    top: -200px;
    right: -200px;
    animation: float 6s ease-in-out infinite;
}

#language-selection::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    bottom: -150px;
    left: -150px;
    animation: float 8s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(20px); }
}

.welcome-section {
    text-align: center;
    margin-bottom: 60px;
    animation: slideDown 0.8s ease;
    position: relative;
    z-index: 1;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo {
    width: 100px;
    height: 100px;
    margin: 0 auto 30px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.logo svg {
    width: 50px;
    height: 50px;
    color: white;
}

.welcome-title {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    margin-bottom: 15px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.welcome-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 400;
}

.language-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 25px;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.language-btn {
    background: white;
    border: none;
    border-radius: 20px;
    padding: 35px 25px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    animation: fadeInUp 0.6s ease backwards;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.language-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.language-btn:hover::before {
    opacity: 1;
}

.language-btn .flag,
.language-btn .lang-name {
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.language-btn:nth-child(1) { animation-delay: 0.1s; }
.language-btn:nth-child(2) { animation-delay: 0.2s; }
.language-btn:nth-child(3) { animation-delay: 0.3s; }
.language-btn:nth-child(4) { animation-delay: 0.4s; }
.language-btn:nth-child(5) { animation-delay: 0.5s; }
.language-btn:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.language-btn:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.language-btn:hover .lang-name {
    color: white;
}

.language-btn:active {
    transform: translateY(-4px) scale(1.01);
}

.language-btn .flag {
    font-size: 3.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.language-btn .lang-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* Navbar */
.navbar {
    background: var(--bg-white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    animation: slideDown 0.5s ease;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 80px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.navbar-logo {
    width: 45px;
    height: 45px;
    background: var(--gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.navbar-logo svg {
    width: 24px;
    height: 24px;
}

.navbar-title {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 40px;
    list-style: none;
}

.navbar-menu a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    position: relative;
    padding: 5px 0;
}

.navbar-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient);
    transition: width 0.3s ease;
}

.navbar-menu a:hover {
    color: var(--primary-color);
}

.navbar-menu a:hover::after {
    width: 100%;
}

.navbar-lang-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
}

.navbar-lang-btn:hover {
    background: var(--gradient-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.navbar-lang-btn svg {
    width: 18px;
    height: 18px;
}

/* Mobile Menu Toggle */
.navbar-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.navbar-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-dark);
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Main Content */
#main-content {
    padding-top: 40px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Sections */
.section {
    background: var(--bg-white);
    border-radius: 24px;
    padding: 50px;
    margin: 30px 0;
    box-shadow: var(--shadow);
    animation: fadeInUp 0.6s ease;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.section:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 35px;
    position: relative;
}

.section-header::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 0;
    width: 80px;
    height: 4px;
    background: var(--gradient);
    border-radius: 2px;
}

.icon-box {
    width: 60px;
    height: 60px;
    background: var(--gradient);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.section-header h2 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-dark);
}

.section-text {
    font-size: 1.15rem;
    color: var(--text-light);
    line-height: 1.9;
}

/* Doctors Section */
.doctors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 35px;
}

.doctor-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 20px;
    padding: 40px 35px;
    text-align: center;
    transition: all 0.4s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.doctor-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--gradient);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.doctor-card:hover::before {
    transform: scaleX(1);
}

.doctor-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-light);
}

.doctor-avatar {
    width: 120px;
    height: 120px;
    background: var(--gradient);
    border-radius: 50%;
    margin: 0 auto 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
    transition: transform 0.3s ease;
}

.doctor-card:hover .doctor-avatar {
    transform: scale(1.1) rotate(5deg);
}

.doctor-avatar svg {
    width: 60px;
    height: 60px;
}

.doctor-name {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.doctor-title {
    font-size: 1.05rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 25px;
}

.doctor-education {
    text-align: left;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 2px solid var(--border-color);
}

.doctor-education h4 {
    font-size: 1.15rem;
    color: var(--text-dark);
    margin-bottom: 15px;
    font-weight: 700;
}

.doctor-education ul {
    list-style: none;
}

.doctor-education li {
    padding: 10px 0 10px 30px;
    position: relative;
    color: var(--text-light);
    font-size: 0.98rem;
    line-height: 1.6;
}

.doctor-education li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--secondary-color);
    font-weight: bold;
    font-size: 1.2rem;
}

/* Services Section */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.service-item {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    padding: 35px 25px;
    text-align: center;
    transition: all 0.4s ease;
    border: 2px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.service-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.service-item:hover::before {
    opacity: 0.05;
}

.service-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
}

.service-item:hover .service-icon {
    transform: scale(1.15) rotate(5deg);
}

.service-item h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-dark);
    position: relative;
    z-index: 1;
}

/* Location Section */
.location-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 35px;
}

.location-info {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.info-item {
    display: flex;
    gap: 20px;
    padding: 25px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.info-item:hover {
    transform: translateX(8px);
    box-shadow: var(--shadow);
    border-color: var(--primary-light);
}

.info-item svg {
    flex-shrink: 0;
    color: var(--primary-color);
}

.info-item h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.info-item p {
    font-size: 0.98rem;
    color: var(--text-light);
    line-height: 1.7;
}

.map-placeholder {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
    padding: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 20px;
    border: 2px dashed var(--border-color);
}

.map-placeholder svg {
    color: var(--primary-color);
    opacity: 0.6;
}

.map-placeholder p {
    color: var(--text-light);
    font-size: 0.98rem;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
    margin-top: auto;
    padding-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    padding-bottom: 40px;
}

.footer-section h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--gradient);
    border-radius: 2px;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.8;
    font-size: 0.95rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.footer-links a:hover {
    color: white;
    transform: translateX(5px);
}

.footer-links a::before {
    content: '›';
    font-size: 1.2rem;
    font-weight: bold;
}

.footer-contact-item {
    display: flex;
    align-items: start;
    gap: 12px;
    margin-bottom: 15px;
}

.footer-contact-item svg {
    flex-shrink: 0;
    color: var(--secondary-color);
    margin-top: 3px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-link {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--gradient);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.social-link svg {
    width: 20px;
    height: 20px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 25px 0;
    text-align: center;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
}

/* Arabic RTL Support */
body.rtl {
    direction: rtl;
}

body.rtl .navbar-menu {
    flex-direction: row-reverse;
}

body.rtl .info-item,
body.rtl .section-header {
    flex-direction: row-reverse;
}

body.rtl .doctor-education li {
    padding-left: 0;
    padding-right: 30px;
}

body.rtl .doctor-education li:before {
    left: auto;
    right: 0;
}

body.rtl .footer-links a::before {
    content: '‹';
}

body.rtl .info-item:hover {
    transform: translateX(-8px);
}

body.rtl .footer-links a:hover {
    transform: translateX(-5px);
}

/* Responsive Design */
@media (max-width: 968px) {
    .navbar-menu {
        display: none;
        position: absolute;
        top: 80px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        gap: 0;
        padding: 20px 0;
        box-shadow: var(--shadow-lg);
    }
    
    .navbar-menu.active {
        display: flex;
    }
    
    .navbar-menu li {
        width: 100%;
        text-align: center;
        padding: 15px 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .navbar-toggle {
        display: flex;
    }
    
    .navbar-lang-btn {
        display: none;
    }
}

@media (max-width: 768px) {
    .welcome-title {
        font-size: 2rem;
    }
    
    .language-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .navbar .container {
        height: 70px;
    }
    
    .navbar-title {
        font-size: 1.3rem;
    }
    
    .section {
        padding: 35px 25px;
    }
    
    .section-header h2 {
        font-size: 1.8rem;
    }
    
    .doctors-grid,
    .services-grid,
    .location-content {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .welcome-title {
        font-size: 1.6rem;
    }
    
    .language-btn {
        padding: 25px 20px;
    }
    
    .language-btn .flag {
        font-size: 3rem;
    }
    
    .section {
        padding: 25px 20px;
        margin: 20px 0;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
}