/* ===== CSS Variables ===== */
:root {
    --primary-color: #3b82f6;
    --secondary-color: #0891b2;
    --accent-color: #059669;
    --bg-light: #1a1a1a;
    --bg-secondary: #242424;
    --bg-card: #2a2a2a;
    --text-primary: #e5e5e5;
    --text-secondary: #a3a3a3;
    --border-color: #3a3a3a;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.light-theme {
    --bg-light: #f0f9ff;
    --bg-secondary: #e0f2fe;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #bae6fd;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    font-weight: 400;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* ===== Loading Animation ===== */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-light);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s, visibility 0.5s;
}

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

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

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loader-content p {
    color: var(--text-secondary);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Navigation ===== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    padding: 1rem 0;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
}

body.light-theme .navbar {
    background: rgba(255, 255, 255, 0.95);
}

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

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

.nav-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logo {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
    letter-spacing: 0.02em;
}

.logo:hover {
    color: var(--secondary-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    position: relative;
    transition: var(--transition);
}

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

.nav-link:hover {
    color: var(--text-primary);
}

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

/* ===== Hero Section ===== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding: 100px 0 50px;
    background: linear-gradient(135deg, #1a1a1a 0%, #242424 100%);
}

body.light-theme .hero {
    background: linear-gradient(135deg, #f8fafc 0%, #e0f2fe 100%);
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(8, 145, 178, 0.1) 0%, transparent 50%);
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
}

.hero-image-container {
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeInScale 1s ease forwards 0.3s;
}

.hero-image {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.hero-image:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 32px rgba(30, 64, 175, 0.2);
}

@keyframes fadeInScale {
    to {
        opacity: 1;
        transform: scale(1);
    }
    from {
        opacity: 0;
        transform: scale(0.8);
    }
}

.hero-title {
    font-size: 4.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    opacity: 0;
    animation: fadeInUp 1s ease forwards 0.5s;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.hero-title .line {
    display: block;
}

.name-highlight {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-tagline {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeInUp 1s ease forwards 0.8s;
}

.tagline-item {
    display: inline-block;
    margin: 0 0.5rem;
}

.separator {
    color: var(--primary-color);
}

.cta-button {
    display: inline-block;
    padding: 0.9rem 2rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    opacity: 0;
    animation: fadeInUp 1s ease forwards 1.1s;
    box-shadow: var(--shadow-sm);
}

.cta-button:hover {
    transform: translateY(-2px);
    background: var(--secondary-color);
    box-shadow: var(--shadow-md);
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    animation: fadeIn 1s ease forwards 1.5s;
}

.mouse {
    width: 25px;
    height: 40px;
    border: 2px solid var(--text-secondary);
    border-radius: 20px;
    position: relative;
}

.mouse::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 2px;
    animation: scroll 2s infinite;
}

@keyframes scroll {
    0% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(15px); }
}

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

@keyframes fadeIn {
    to { opacity: 1; }
}

/* ===== Section Styles ===== */
.section {
    padding: 80px 0;
    position: relative;
    background: var(--bg-light);
}

.section:nth-child(even) {
    background: var(--bg-secondary);
}

/* ===== Stats Section ===== */
.stats-section {
    padding: 50px 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(8, 145, 178, 0.15));
    border: none;
}

.stats-text {
    text-align: center;
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.8;
}

@media (max-width: 768px) {
    .stats-text {
        font-size: 0.9rem;
    }
}

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

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    display: block;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* ===== About Section ===== */
.about-content {
    display: flex;
    justify-content: center;
}

.about-card {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: 12px;
    max-width: 800px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

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

.about-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.about-text:last-child {
    margin-bottom: 0;
}

.highlight {
    color: var(--primary-color);
    font-weight: 600;
}

/* ===== Skills Section ===== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.skill-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.skill-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.skill-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.skill-card:hover .skill-icon {
    transform: scale(1.2);
}

.skill-title {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* ===== Work Experience Section ===== */
.experience-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.experience-card {
    background: var(--bg-card);
    padding: 1.8rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

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

.experience-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 600;
}

.experience-company {
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.experience-duration {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== Achievements Section ===== */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.achievement-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.achievement-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: var(--secondary-color);
}

.achievement-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.achievement-card:hover .achievement-icon {
    transform: scale(1.2) rotateZ(5deg);
}

.achievement-title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.achievement-description {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== Footer ===== */
.footer {
    background: var(--bg-secondary);
    padding: 80px 0 2rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.theme-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-primary);
}

.theme-toggle:hover {
    transform: scale(1.1);
    border-color: var(--primary-color);
}

.sun-icon {
    display: none;
}

body.light-theme .moon-icon {
    display: none;
}

body.light-theme .sun-icon {
    display: block;
}

.map-container {
    max-width: 900px;
    margin: 0 auto;
    box-shadow: var(--shadow-md);
    border-radius: 12px;
    transition: var(--transition);
    cursor: pointer;
}

.map-container:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.footer p {
    color: var(--text-secondary);
    margin: 0.5rem 0;
}

.orcid-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.orcid-link:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* ===== Scroll Animations ===== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Responsive Design ===== */
.custom-alert {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: var(--bg-card);
    border: 1px solid var(--primary-color);
    border-radius: 12px;
    padding: 2rem 3rem;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.custom-alert.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.custom-alert p {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.1rem;
    text-align: center;
    text-transform: lowercase;
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }

    .nav-right {
        gap: 0;
    }

    .hero-image {
        width: 150px;
        height: 150px;
    }

    .hero-title {
        font-size: 3rem;
    }

    .hero-tagline {
        font-size: 1.1rem;
    }

    .tagline-item {
        display: block;
        margin: 0.5rem 0;
    }

    .separator {
        display: none;
    }

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

    .skills-grid,
    .achievements-grid {
        grid-template-columns: 1fr;
    }

    .about-card {
        padding: 2rem;
    }

    .container {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .cta-button {
        padding: 0.8rem 2rem;
    }

    .section {
        padding: 60px 0;
    }
}
