/* CSS Variables for Theme */
:root {
    --bg-primary: #FFFFFF;
    --bg-secondary: #FAFAFA;
    --text-primary: #0F0F0F;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --accent: #3B82F6;
    --accent-dark: #1D4ED8;
    --gradient-primary: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 100%);
    --gradient-secondary: linear-gradient(135deg, #F8FAFC 0%, #E2E8F0 100%);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 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);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-primary: #0F0F0F;
    --bg-secondary: #1A1A1A;
    --text-primary: #F9FAFB;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;
    --accent: #60A5FA;
    --accent-dark: #3B82F6;
    --gradient-primary: linear-gradient(135deg, #60A5FA 0%, #A78BFA 100%);
    --gradient-secondary: linear-gradient(135deg, #1A1A1A 0%, #2D2D2D 100%);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow-x: hidden;
    transition: var(--transition);
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

.spinner {
    border: 4px solid var(--text-secondary);
    border-top: 4px solid var(--accent);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

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

/* Fixed Dark Mode Toggle */
.dark-mode-toggle-fixed {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(107, 114, 128, 0.3);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    padding: 0.8rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    z-index: 1001;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

[data-theme="dark"] .dark-mode-toggle-fixed {
    background: rgba(15, 15, 15, 0.95);
    border-color: rgba(107, 114, 128, 0.4);
}

.dark-mode-toggle-fixed:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .dark-mode-toggle-fixed:hover {
    background: rgba(15, 15, 15, 1);
}

.social-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(107, 114, 128, 0.1);
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
    border: 1px solid rgba(107, 114, 128, 0.2);
}

.social-link:hover {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.social-link svg {
    width: 18px;
    height: 18px;
}

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

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        /* Medical cross pattern */
        linear-gradient(90deg, transparent 48%, rgba(59, 130, 246, 0.03) 49%, rgba(59, 130, 246, 0.03) 51%, transparent 52%),
        linear-gradient(0deg, transparent 48%, rgba(59, 130, 246, 0.03) 49%, rgba(59, 130, 246, 0.03) 51%, transparent 52%),
        /* Subtle grid */
        linear-gradient(90deg, transparent 24%, rgba(107, 114, 128, 0.02) 25%, rgba(107, 114, 128, 0.02) 75%, transparent 76%),
        linear-gradient(0deg, transparent 24%, rgba(107, 114, 128, 0.02) 25%, rgba(107, 114, 128, 0.02) 75%, transparent 76%),
        /* Animated gradient overlay */
        linear-gradient(135deg, rgba(59, 130, 246, 0.02) 0%, rgba(139, 92, 246, 0.01) 50%, rgba(59, 130, 246, 0.02) 100%);
    background-size: 100px 100px, 100px 100px, 200px 200px, 200px 200px, 100% 100%;
    animation: subtlePulse 8s ease-in-out infinite;
    pointer-events: none;
    opacity: 0.6;
}

[data-theme="dark"] .hero {
    background: var(--gradient-secondary);
}

.hero-content {
    max-width: 900px;
    padding: 60px 20px;
    animation: fadeInUp 1.2s ease-out;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.hero-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
}

.bio-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    transition: var(--transition);
    position: relative;
}

.bio-photo::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.bio-photo:hover::before {
    opacity: 0.2;
}

.bio-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.bio-photo:hover img {
    transform: scale(1.05);
}

.hero-tagline {
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0;
    letter-spacing: -0.01em;
    max-width: 500px;
}

.hero-description {
    text-align: center;
    max-width: 600px;
}

.hero-social {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

/* Animated Background Elements */
.hero-animations {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

.floating-element {
    position: absolute;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.05));
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.floating-element-1 {
    width: 60px;
    height: 60px;
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.floating-element-2 {
    width: 40px;
    height: 40px;
    top: 60%;
    right: 15%;
    animation-delay: 2s;
}

.floating-element-3 {
    width: 80px;
    height: 80px;
    bottom: 20%;
    left: 20%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.3;
    }
    33% {
        transform: translateY(-20px) rotate(120deg);
        opacity: 0.6;
    }
    66% {
        transform: translateY(-10px) rotate(240deg);
        opacity: 0.4;
    }
}

/* Dark mode variants for animated elements */
[data-theme="dark"] .floating-element {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.15), rgba(167, 139, 250, 0.08));
    border-color: rgba(96, 165, 250, 0.3);
}

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

@keyframes subtlePulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.01);
    }
}

@keyframes dataFlow {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: 100% 100%;
    }
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: -0.01em;
    opacity: 0.9;
    line-height: 1.6;
}

.cta-button {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 1.2rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    font-size: 0.9rem;
}

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

.cta-button:hover::before {
    left: 100%;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: var(--gradient-primary);
}

.cta-button:active {
    transform: translateY(0);
}

/* Projects Section */
.projects {
    padding: 100px 0;
    background: var(--bg-primary);
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-secondary);
}

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

.project-card {
    background: var(--bg-primary);
    padding: 2.5rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(59, 130, 246, 0.1);
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.project-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.02) 0%, rgba(139, 92, 246, 0.02) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

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

.project-card:hover::after {
    opacity: 1;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(59, 130, 246, 0.2);
}

.project-card h4 {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.project-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.project-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition-fast);
    cursor: pointer;
    z-index: 10;
}

.project-link::after {
    content: '→';
    transition: transform 0.3s ease;
    font-size: 1.1rem;
}

.project-link:hover {
    color: var(--accent-dark);
    text-decoration: none;
}

.project-link:hover::after {
    transform: translateX(4px);
}

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

[data-theme="dark"] .subscribe {
    background: var(--gradient-secondary);
}

.subscribe::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

.subscribe-intro {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 2;
}

.subscribe-form {
    display: flex;
    max-width: 600px;
    margin: 3rem auto;
    gap: 1rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

#email {
    flex: 1;
    padding: 1.2rem 1.5rem;
    border: 2px solid rgba(107, 114, 128, 0.2);
    border-radius: var(--border-radius-lg);
    font-size: 1rem;
    min-width: 280px;
    background: var(--bg-primary);
    transition: var(--transition-fast);
    font-family: inherit;
}

#email:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-message {
    text-align: center;
    margin-top: 1.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    position: relative;
    z-index: 2;
}

.privacy-note {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 1rem;
    position: relative;
    z-index: 2;
}

.subscribe-form button[type="submit"] {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 1.2rem 2rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--border-radius-lg);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    min-width: 140px;
}

.subscribe-form button[type="submit"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.subscribe-form button[type="submit"]:hover::before {
    left: 100%;
}

.subscribe-form button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Footer */
.footer {
    padding: 2rem 0;
    text-align: center;
    background: var(--gradient-secondary);
    color: var(--text-secondary);
}

.social-links {
    margin-top: 1rem;
}

.social-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--accent);
}

/* Tooltip */
.tooltip {
    position: absolute;
    background: var(--text-primary);
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1001;
}

.tooltip.show {
    opacity: 1;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {

    .hero-content {
        padding: 40px 15px;
        gap: 1.5rem;
    }

    .dark-mode-toggle-fixed {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
        padding: 0.7rem;
    }

    .hero-social {
        margin: 1.5rem 0;
    }

    .floating-element-1 {
        width: 40px;
        height: 40px;
        top: 15%;
        left: 5%;
    }

    .floating-element-2 {
        width: 30px;
        height: 30px;
        top: 65%;
        right: 10%;
    }

    .floating-element-3 {
        width: 50px;
        height: 50px;
        bottom: 15%;
        left: 15%;
    }

    .hero-nav-link {
        font-size: 0.9rem;
    }

    .social-links {
        gap: 0.8rem;
    }

    .social-link {
        width: 36px;
        height: 36px;
    }

    .social-link svg {
        width: 16px;
        height: 16px;
    }

    .hero-profile {
        gap: 1rem;
    }

    .bio-photo {
        width: 100px;
        height: 100px;
    }

    .hero-title {
        font-size: clamp(1.8rem, 7vw, 2.5rem);
    }

    .hero-tagline {
        font-size: clamp(1rem, 3.5vw, 1.1rem);
    }

    .hero-subtitle {
        font-size: clamp(0.95rem, 3vw, 1.05rem);
    }

    .cta-button {
        padding: 1rem 2rem;
        font-size: 0.85rem;
    }

    .projects {
        padding: 60px 0;
    }

    .section-title {
        font-size: 2rem;
    }

    .section-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .project-card {
        padding: 1.5rem;
    }

    .project-card h4 {
        font-size: 1.2rem;
    }

    .project-card p {
        font-size: 0.9rem;
    }

    .subscribe {
        padding: 80px 0;
    }

    .subscribe-intro {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .subscribe-form {
        flex-direction: column;
        gap: 1.5rem;
        margin: 2rem auto;
    }

    #email {
        min-width: auto;
        padding: 1rem;
    }

    .subscribe-form button[type="submit"] {
        padding: 1rem 1.5rem;
        min-width: auto;
    }

    .footer {
        padding: 1.5rem 0;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .hero-content {
        padding: 90px 10px 30px;
    }

    .cta-button {
        padding: 0.9rem 1.8rem;
    }

    .project-card {
        padding: 1.2rem;
    }

    .subscribe-form {
        max-width: 100%;
    }
}

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

/* All sections are visible by default */
section {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s ease;
}