:root {
    --bg: #071029;
    --card: #0e1630;
    --muted: #98a0b3;
    --accent: #d4af37;
    --primary: #1a5276;
    --glass: rgba(255, 255, 255, 0.04);
    --radius: 14px;
    --container: 1024px;
    font-family: 'Cairo', sans-serif;
    color-scheme: dark;
}

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

html,
body {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(180deg, #061225 0%, #071029 70%);
    color: #e9eef8;
    font-family: 'Cairo', sans-serif;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

/* Header Styles - Improved Compact Design */
.site-header {
    background: rgba(7, 16, 41, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    padding: 8px 0;
    /* Reduced padding */
}

.header-container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
    /* Reduced padding */
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    /* Removed padding */
    gap: 15px;
    /* Added gap for better spacing */
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    /* Reduced gap */
    flex-shrink: 0;
}

/* Header Logo with Doctor Image - Compact */
.brand .logo {
    width: 50px;
    /* Reduced from 60px */
    height: 50px;
    /* Reduced from 60px */
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    flex-shrink: 0;
}

.brand .logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.brand-text h1 {
    margin: 0;
    font-family: 'Tajawal', sans-serif;
    font-size: 18px;
    /* Reduced from 20px */
    background: linear-gradient(45deg, var(--accent), #fff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.brand-text p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    /* Reduced from 13px */
    line-height: 1.2;
}

/* Language Switcher - Compact */
.language-switcher {
    margin-right: 0;
    /* Removed margin */
}

.lang-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--accent);
    padding: 6px 12px;
    /* Reduced padding */
    border-radius: 16px;
    /* Slightly smaller */
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
    font-size: 12px;
    /* Smaller font */
}

.lang-btn:hover {
    background: rgba(212, 175, 55, 0.2);
    transform: translateY(-1px);
    /* Reduced animation */
}

/* Navigation - Compact */
.main-nav ul {
    display: flex;
    gap: 3px;
    /* Reduced gap */
    list-style: none;
    padding: 0;
    margin: 0;
}

.main-nav a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 700;
    padding: 6px 12px;
    /* Reduced padding */
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 13px;
    /* Smaller font */
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--accent);
    background: rgba(212, 175, 55, 0.15);
    box-shadow: inset 0 -2px 0 var(--accent);
}

.mobile-menu {
    display: none;
    background: none;
    border: none;
    color: var(--accent);
    font-size: 1.3rem;
    /* Slightly smaller */
    cursor: pointer;
    padding: 5px;
}

/* Main Content - Adjust for smaller header */
.main-content {
    flex: 1;
    width: 100%;
    margin-top: 80px;
    /* Reduced from 100px to compensate for smaller header */
    margin-bottom: 40px;
}

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 28px;
}

/* Card Styles */
.card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.03);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.section-title {
    margin-bottom: 30px;
}

.section-title h2 {
    margin: 0 0 10px 0;
    font-family: 'Tajawal';
    color: var(--accent);
    font-size: 1.8rem;
}

.section-title p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

/* Doctor Profile Styles */
.doctor-profile {
    display: flex;
    align-items: flex-start;
    gap: 30px;
    margin-bottom: 30px;
}

.doctor-image {
    flex: 0 0 300px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.doctor-image img {
    width: 100%;
    height: auto;
    display: block;
}

.doctor-info {
    flex: 1;
}

.doctor-info h2 {
    font-family: 'Tajawal', sans-serif;
    font-size: 32px;
    margin-bottom: 15px;
    color: var(--accent);
}

.doctor-info p {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 20px;
}

/* For Bio Page - Smaller Image */
.bio-image {
    flex: 0 0 250px;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), #e8c44d);
    color: #071029;
    font-weight: 800;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    text-align: center;
    font-family: 'Cairo', sans-serif;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
    color: #071029;
}

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

.btn-secondary:hover {
    background: rgba(212, 175, 55, 0.1);
}

.muted {
    color: var(--muted);
}

/* Form Styles */
.input {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: inherit;
    margin-bottom: 16px;
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s ease;
}

.input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

textarea.input {
    resize: vertical;
    min-height: 100px;
}

/* Timeline Styles */
.timeline {
    position: relative;
    padding-right: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    right: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--accent), rgba(212, 175, 55, 0.25));
}

.event {
    position: relative;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    border-left: 3px solid var(--accent);
}

.event::before {
    content: '';
    position: absolute;
    right: -26px;
    top: 25px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--card);
}

.event .date {
    font-weight: 800;
    color: var(--accent);
    font-size: 14px;
    margin-bottom: 8px;
}

.event h4 {
    margin: 8px 0;
    color: #fff;
}

.event p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

/* Grid Layouts */
.grid {
    display: grid;
    gap: 20px;
}

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

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* Works Grid */
.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.work {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.work img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.work:hover img {
    transform: scale(1.05);
}

.work-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 20px;
    color: white;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.work:hover .work-overlay {
    transform: translateY(0);
}

/* Lightbox */
#lightbox {
    display: none;
    position: fixed;
    inset: 0;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    padding: 20px;
}

#lightbox img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

#lightbox-close {
    position: absolute;
    top: 30px;
    right: 30px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    font-size: 35px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2100;
}

#lightbox-close:hover {
    background: var(--accent);
    color: #071029;
    transform: rotate(90deg);
}

/* Footer Styles - Compact */
.site-footer {
    background-color: var(--dark);
    color: white;
    padding: 20px 0 10px;
    margin-top: auto;
}

.footer-container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 28px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 25px;
}

.footer-column {
    display: flex;
    flex-direction: column;
}

.footer-column h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    position: relative;
    padding-bottom: 8px;
    color: white;
}

.footer-column h3:after {
    content: '';
    position: absolute;
    width: 50px;
    height: 2px;
    background-color: var(--accent);
    bottom: 0;
    right: 0;
}

.footer-column p {
    color: #ccc;
    line-height: 1.5;
    margin-bottom: 15px;
    flex: 1;
    font-size: 0.9rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

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

.footer-links a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
    display: block;
    padding: 2px 0;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--secondary);
    transform: translateX(-5px);
}

.footer-contact-info {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-contact-info li {
    margin-bottom: 8px;
    color: #ccc;
    display: flex;
    align-items: center;
    padding: 2px 0;
    font-size: 0.9rem;
}

.footer-contact-info i {
    margin-left: 10px;
    color: var(--secondary);
    width: 20px;
    text-align: center;
}

@media (max-width: 768px) {
    .site-footer {
        padding: 20px 0 10px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-bottom: 15px;
        text-align: center;
    }

    .footer-column h3 {
        margin-bottom: 10px;
        font-size: 1.1rem;
    }

    .footer-column h3:after {
        right: 50%;
        transform: translateX(50%);
    }

    .footer-links li,
    .footer-contact-info li {
        justify-content: center;
        margin-bottom: 5px;
    }

    .social-links {
        justify-content: center;
        margin-top: 10px;
    }

    .copyright {
        padding-top: 10px;
    }
}

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

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

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

.copyright {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.8rem;
    color: #aaa;
}

/* Responsive Design - Improved for compact header */
@media (max-width: 1024px) {
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

@media (max-width: 992px) {
    .header-content {
        flex-wrap: wrap;
        gap: 10px;
    }

    .brand {
        order: 1;
    }

    .language-switcher {
        order: 2;
        margin-left: auto;
    }

    .mobile-menu {
        order: 3;
    }

    .main-nav {
        order: 4;
        width: 100%;
    }

    .doctor-profile {
        flex-direction: column;
    }

    .doctor-image,
    .bio-image {
        flex: 0 0 auto;
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .site-header {
        padding: 5px 0;
        /* Even smaller padding on mobile */
    }

    .header-container {
        padding: 0 15px;
    }

    .header-content {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 10px;
    }

    .mobile-menu {
        display: block;
        order: 1;
        margin-right: 0;
    }

    .brand {
        order: 2;
        flex: 1;
        justify-content: center;
    }

    .language-switcher {
        order: 3;
        margin-left: 0;
    }

    .main-nav {
        order: 4;
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--card);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
        padding: 15px;
    }

    .main-nav.active {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 8px;
    }

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

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }

    .footer-column h3:after {
        right: 50%;
        transform: translateX(50%);
    }

    .social-links {
        justify-content: center;
    }

    .main-content {
        margin-top: 70px;
        /* Further reduced for mobile */
    }

    .brand .logo {
        width: 45px;
        height: 45px;
    }

    .brand-text h1 {
        font-size: 16px;
    }

    .brand-text p {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .brand {
        flex-direction: row;
        gap: 8px;
    }

    .brand-text h1 {
        font-size: 14px;
    }

    .brand-text p {
        font-size: 10px;
    }

    .lang-btn {
        padding: 5px 10px;
        font-size: 11px;
    }

    .main-nav a {
        padding: 5px 10px;
        font-size: 12px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .container,
    .header-container,
    .footer-container {
        padding: 0 15px;
    }

    .main-content {
        margin-top: 65px;
        /* Smallest margin for very small screens */
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #e8c44d;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-30 {
    margin-bottom: 30px;
}

.mt-30 {
    margin-top: 30px;
}

/* Language Direction Support */
[dir="rtl"] {
    text-align: right;
}

[dir="ltr"] {
    text-align: left;
}

body[dir="ltr"] .header-content,
body[dir="ltr"] .footer-content,
body[dir="ltr"] .doctor-profile,
body[dir="ltr"] .grid,
body[dir="ltr"] .main-nav ul {
    direction: ltr;
}

body[dir="ltr"] .brand {
    flex-direction: row;
}

body[dir="ltr"] .footer-column h3:after {
    right: auto;
    left: 0;
}

body[dir="ltr"] .footer-links a:hover {
    transform: translateX(5px);
}

body[dir="ltr"] .timeline {
    padding-right: 0;
    padding-left: 30px;
}

body[dir="ltr"] .timeline::before {
    right: auto;
    left: 15px;
}

body[dir="ltr"] .event::before {
    right: auto;
    left: -26px;
}

body[dir="ltr"] .event {
    border-left: none;
    border-right: 3px solid var(--accent);
}

body[dir="ltr"] .footer-contact-info i {
    margin-left: 0;
    margin-right: 10px;
}

/* Ensure content doesn't shift when language changes */
body[dir="ltr"] .header-content,
body[dir="ltr"] .brand {
    direction: ltr;
}

body[dir="ltr"] .language-switcher {
    margin-right: 0;
    margin-left: 0;
}

/* Smooth transition for header resize */
.site-header,
.brand .logo,
.brand-text h1,
.brand-text p,
.lang-btn,
.main-nav a {
    transition: all 0.3s ease;
}