:root {
    /* Light mode variables */
    --primary-color: #2563eb;
    --secondary-color: #3b82f6;
    --text-color: #1f2937;
    --light-text: #4b5563;
    --background: #f8fafc;
    --section-bg: #f1f5f9;
    --card-bg: #ffffff;
    --nav-bg: rgba(248, 250, 252, 0.95);
    --border-color: #e2e8f0;
    --tech-bg: #f1f5f9;
    --transition: all 0.3s ease;
    --success-color: #059669;
    --highlight-color: #3b82f6;
    --skill-tag-bg: #f1f5f9;
    --skill-tag-text: #2563eb;
    --skill-tag-border: #e2e8f0;
}

[data-theme="dark"] {
    --primary-color: #60a5fa;
    --secondary-color: #93c5fd;
    --text-color: #f1f5f9;
    --light-text: #cbd5e1;
    --background: #0f172a;
    --section-bg: #1e293b;
    --card-bg: #1e293b;
    --nav-bg: rgba(15, 23, 42, 0.95);
    --border-color: #334155;
    --tech-bg: #334155;
    --highlight-color: #60a5fa;
    --skill-tag-bg: #334155;
    --skill-tag-text: #93c5fd;
    --skill-tag-border: #475569;
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.5rem;
    margin-left: 1rem;
    border-radius: 50%;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    transform: scale(1.1);
    background: var(--hover-bg);
}

.theme-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--accent-color);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .theme-toggle {
        margin: 1rem 0;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* Account for fixed header */
}

body {
    line-height: 1.6;
    color: var(--text-color);
    background: var(--background);
    min-height: 100vh;
}

/* Navigation */
header {
    position: fixed;
    width: 100%;
    top: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(5px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 2rem;
}

.logo {
    justify-self: start;
}

.logo a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

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

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

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

/* Auth link styles */
.auth-link {
    margin-left: 1rem;
    position: relative;
}

#account-link {
    display: flex;
    align-items: center;
    padding: 0;
}

#nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-color);
    transition: transform 0.3s, border-color 0.3s;
}

#nav-avatar:hover {
    transform: scale(1.1);
    border-color: var(--accent-color-dark);
}

/* Mobile menu styles */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-color);
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .nav-links.active {
        display: flex;
    }

    .auth-link {
        margin-left: 0;
        margin-top: 0.5rem;
    }

    #nav-avatar {
        width: 24px;
        height: 24px;
    }
}

/* Main content */
main {
    position: relative;
    z-index: 1;
    padding-top: 80px; /* Adjust based on your header height */
}

/* Sections */
section {
    position: relative;
    z-index: 1;
    padding: 5rem 2rem;
    background: var(--section-bg);
}

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

/* Section Titles */
section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--text-color);
    position: relative;
    padding-bottom: 1rem;
}

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

@media (max-width: 768px) {
    section h2 {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
}

/* Hero Section */
.hero {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)),
                url('images/hero-bg.jpg') center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    margin-top: -80px; /* Compensate for header height */
    padding-top: 80px; /* Add back the header height */
}

.hero-content {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    padding: 0 2rem;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4),
                 0 0 30px rgba(255, 255, 255, 0.2);
}

.highlight {
    color: var(--highlight-color);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4),
                 0 0 20px rgba(59, 130, 246, 0.4);
}

.tagline {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3),
                 0 0 20px rgba(255, 255, 255, 0.15);
    letter-spacing: 0.5px;
}

/* Ensure buttons don't inherit text shadow */
.hero-content .btn {
    text-shadow: none;
}

/* Buttons */
.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

.btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    border: 2px solid transparent;
    min-width: 160px;
    text-align: center;
}

.primary {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.primary:hover {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    transform: translateY(-2px);
}

.secondary {
    background: transparent;
    color: white;
    border-color: white;
    backdrop-filter: blur(4px);
}

.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* About Section */
.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-text {
    text-align: center;
    margin-bottom: 2rem;
}

.skills {
    margin-top: 2rem;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.skill-tags span {
    background: var(--skill-tag-bg);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--skill-tag-text);
    border: 1px solid var(--skill-tag-border);
}

/* Projects Section */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.project-card, .expertise-area {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

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

/* Card Content */
.expertise-area {
    padding: 2rem;
}

.expertise-area h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.expertise-area .skill-tags {
    flex-grow: 1;
    margin-bottom: 1.5rem;
}

/* Card Images */
.expertise-image, .project-image {
    margin-top: auto;
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 8px;
}

.project-image {
    margin-top: 0;
    height: 250px;
    border-radius: 8px 8px 0 0;
}

.expertise-image img, .project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.expertise-image img:hover, .project-image img:hover {
    transform: scale(1.05);
}

/* Project Card Specific */
.project-card {
    height: 100%;
}

.project-card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-card h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
}

.project-card p {
    color: var(--light-text);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.project-tech {
    margin-bottom: 1.5rem;
}

.project-links {
    margin-top: auto;
    padding: 0 1.5rem 1.5rem;
}

.project-links .btn {
    min-width: auto;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

.project-links .btn.small {
    background: var(--skill-tag-bg);
    color: var(--skill-tag-text);
    border-color: var(--skill-tag-border);
}

.project-links .btn.small:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.project-links .btn.small.secondary {
    background: transparent;
    color: var(--light-text);
    border-color: var(--border-color);
}

.project-links .btn.small.secondary:hover {
    background: var(--tech-bg);
    color: var(--text-color);
    border-color: var(--border-color);
}

/* Contact Section */
.contact-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
}

.social-links a {
    color: var(--text-color);
    font-size: 1.5rem;
    transition: var(--transition);
}

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

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    background: var(--section-bg);
    color: var(--light-text);
    border-top: 1px solid var(--border-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .tagline {
        font-size: 1.2rem;
    }
    
    .nav-content {
        grid-template-columns: 1fr auto auto;
        padding: 1rem;
        gap: 1rem;
    }
    
    .theme-toggle {
        order: 1;
    }

    .mobile-menu-btn {
        order: 2;
    }
    
    .nav-links {
        gap: 1rem;
        background: var(--card-bg);
    }
    
    section {
        padding: 3rem 1rem;
    }
    
    section h2 {
        font-size: 2rem;
    }

    .expertise-image, .project-image {
        height: 180px;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .nav-links {
        flex-direction: column;
        text-align: center;
    }
    
    .project-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile Navigation */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--text-color);
    margin: 5px 0;
    transition: var(--transition);
}

@media (max-width: 768px) {
    header {
        z-index: 1000;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }

    .mobile-menu-btn {
        display: block;
    }

    .nav-content {
        padding: 1rem;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 250px;
        background: var(--card-bg);
        flex-direction: column;
        padding: 80px 2rem 2rem;
        transition: var(--transition);
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        z-index: 999;
    }

    .nav-links.active {
        right: 0;
    }

    .mobile-menu-btn.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .mobile-menu-btn.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-btn.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }

    /* Improve mobile touch targets */
    .nav-links a {
        padding: 1rem 0;
        display: block;
        width: 100%;
    }

    .btn {
        padding: 1rem 1.5rem;
        width: 100%;
        text-align: center;
        margin: 0.5rem 0;
    }

    /* Adjust hero section for mobile */
    .hero {
        padding: 0 1rem;
        min-height: 100vh;
        height: auto;
    }

    .hero-content {
        padding: 6rem 0;
    }

    .hero-content h1 {
        font-size: 2.5rem;
        line-height: 1.2;
    }

    /* Improve form elements for touch */
    input, textarea, button {
        font-size: 16px !important; /* Prevent iOS zoom on focus */
    }

    /* Adjust section spacing */
    section {
        padding: 3rem 1rem;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2rem;
    }

    .cta-buttons {
        flex-direction: column;
        width: 100%;
    }

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

    .skill-tags {
        justify-content: flex-start;
    }

    .skill-tags span {
        margin: 0.25rem;
    }
}

/* Add overlay for mobile menu */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

/* Expertise Grid */
.expertise-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.expertise-area::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    opacity: 0.1;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.expertise-area:nth-child(1)::before {
    background-image: url('images/engineering-icon.svg');
}

.expertise-area:nth-child(2)::before {
    background-image: url('images/integration-icon.svg');
}

.expertise-area:nth-child(3)::before {
    background-image: url('images/software-icon.svg');
}

.expertise-area:nth-child(4)::before {
    background-image: url('images/analysis-icon.svg');
}

.expertise-area h3 i {
    font-size: 1.2em;
}

/* Project Tech Tags */
.project-tech span {
    background: var(--tech-bg);
    color: var(--light-text);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.85rem;
}

/* Publications Section */
.publications {
    background: var(--section-bg);
    padding: 5rem 2rem;
}

.publications-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.publication-card {
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.publication-card h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.publication-card ul {
    list-style: none;
    padding: 0;
}

.publication-card li {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--tech-bg);
}

.publication-card li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.pub-title {
    display: block;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.pub-journal,
.pub-number {
    display: block;
    font-size: 0.9rem;
    color: var(--light-text);
}

/* Enhanced Project Cards */
.project-card {
    display: flex;
    flex-direction: column;
}

/* Responsive Design Updates */
@media (max-width: 768px) {
    .expertise-grid {
        grid-template-columns: 1fr;
    }

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

    .expertise-area {
        padding: 1.5rem;
    }

    .publication-card {
        padding: 1.5rem;
    }
}

.expertise-image {
    margin-top: 1.5rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.expertise-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.expertise-image img:hover {
    transform: scale(1.05);
}

.expertise-area:hover {
    transform: translateY(-5px);
}

/* SVG icons in dark mode */
[data-theme="dark"] .expertise-area svg path {
    fill: var(--text-color);
}

/* Adjust box shadows for dark mode */
[data-theme="dark"] .project-card,
[data-theme="dark"] .expertise-area,
[data-theme="dark"] .publication-card {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    background: #243147;
}

[data-theme="dark"] .hero {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)),
                url('images/hero-bg.jpg') center/cover;
}

/* Ensure smooth scrolling behavior */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}
