/* ===== CSS Variables ===== */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #0f172a;
    --text: #334155;
    --text-light: #64748b;
    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    line-height: 1.6;
    background: var(--bg);
}

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

section {
    padding: 6rem 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary);
    margin: 1rem auto 0;
    border-radius: 2px;
}

/* ===== Navigation ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: var(--transition);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
}

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

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

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

.nav-menu a:hover {
    color: var(--primary);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    width: 25px;
    height: 2px;
    background: var(--secondary);
    transition: var(--transition);
}

/* ===== Hero Section ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding-top: 80px;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-greeting {
    font-size: 1.25rem;
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.hero-name {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--secondary);
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.hero-title {
    font-size: 1.5rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text);
    margin-bottom: 2rem;
    max-width: 500px;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-image {
    display: flex;
    justify-content: center;
}

.hero-image img {
    width: 350px;
    height: 350px;
    object-fit: cover;
    border-radius: 50%;
    border: 5px solid var(--bg);
    box-shadow: var(--shadow-lg);
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    border-radius: var(--radius);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    text-align: center;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

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

/* ===== About Section ===== */
.about {
    background: var(--bg);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.about-text p {
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
}

.skills-grid h3 {
    font-size: 1.5rem;
    color: var(--secondary);
    margin-bottom: 1.5rem;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

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

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

/* ===== Experience Section ===== */
.experience {
    background: var(--bg-alt);
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 3rem;
}

.timeline-dot {
    position: absolute;
    left: 12px;
    top: 5px;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    border: 3px solid var(--bg);
}

.timeline-content {
    background: var(--bg);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.timeline-content h3 {
    font-size: 1.5rem;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

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

.timeline-date {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.timeline-content ul {
    list-style-position: inside;
    color: var(--text);
}

.timeline-content li {
    margin-bottom: 0.5rem;
}

/* ===== Education Section ===== */
.education {
    background: var(--bg);
}

.education-grid {
    display: grid;
    gap: 2rem;
}

.education-card {
    background: var(--bg-alt);
    padding: 2rem;
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
}

.education-card h3 {
    font-size: 1.5rem;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.education-school {
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.education-date {
    color: var(--text-light);
    font-size: 0.875rem;
}

.certs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.cert-card {
    background: var(--bg-alt);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: var(--transition);
}

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

.cert-card h4 {
    font-size: 1rem;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.cert-card p {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* ===== Projects Section ===== */
.projects {
    background: var(--bg-alt);
}

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

.project-card {
    background: var(--bg);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.project-header h3 {
    font-size: 1.5rem;
    color: var(--secondary);
}

.project-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    white-space: nowrap;
}

.project-link:hover {
    text-decoration: underline;
}

.project-description {
    color: var(--text);
    margin-bottom: 1.5rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: var(--bg-alt);
    color: var(--text-light);
    padding: 0.375rem 0.75rem;
    border-radius: 15px;
    font-size: 0.75rem;
}

/* ===== Project Screenshots ===== */
.project-screenshots {
    margin-top: 1.5rem;
}

.screenshot-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
}

.screenshot-item {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid var(--border);
    transition: var(--transition);
}

.screenshot-item:hover {
    border-color: var(--primary);
    transform: scale(1.03);
    box-shadow: var(--shadow-lg);
}

.screenshot-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.screenshot-item:hover img {
    transform: scale(1.05);
}

/* ===== Lightbox ===== */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s ease;
}

.lightbox.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    z-index: 2001;
}

.lightbox-close:hover {
    color: var(--primary);
    transform: scale(1.1);
}

.lightbox-prev,
.lightbox-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    font-weight: bold;
    transition: var(--transition);
    user-select: none;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-caption {
    color: #ccc;
    text-align: center;
    margin-top: 15px;
    font-size: 0.875rem;
}

/* ===== Research Section ===== */
.research {
    background: var(--bg);
}

.research-list {
    display: grid;
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.research-item {
    background: var(--bg-alt);
    padding: 2rem;
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
}

.research-item h3 {
    font-size: 1.25rem;
    color: var(--secondary);
    margin-bottom: 0.75rem;
}

.research-authors {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.research-journal {
    color: var(--primary);
    font-size: 0.875rem;
    font-style: italic;
    margin-bottom: 1rem;
}

.research-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
}

.research-link:hover {
    text-decoration: underline;
}

/* ===== Contact Section ===== */
.contact {
    background: var(--bg-alt);
}

.contact-description {
    text-align: center;
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto 3rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.contact-card {
    background: var(--bg);
    padding: 2rem;
    border-radius: var(--radius);
    text-align: center;
    text-decoration: none;
    color: var(--text);
    transition: var(--transition);
    box-shadow: var(--shadow);
}

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

.contact-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.contact-card h3 {
    font-size: 1.25rem;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.contact-card p {
    color: var(--text-light);
    font-size: 0.875rem;
}

.languages {
    text-align: center;
}

.languages h3 {
    font-size: 1.5rem;
    color: var(--secondary);
    margin-bottom: 1rem;
}

.language-tags {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

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

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

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--bg);
        flex-direction: column;
        padding: 2rem;
        gap: 1.5rem;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
        box-shadow: var(--shadow);
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-name {
        font-size: 2.5rem;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-image img {
        width: 250px;
        height: 250px;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

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

    section {
        padding: 4rem 0;
    }

    .container {
        padding: 0 1.5rem;
    }
}

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

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

    .hero-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .project-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .screenshot-gallery {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 0.5rem;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }
}

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

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

.hero-text {
    animation: fadeIn 0.8s ease-out;
}

.hero-image {
    animation: fadeIn 1s ease-out;
}

.timeline-item {
    animation: fadeIn 0.6s ease-out;
}

.project-card {
    animation: fadeIn 0.6s ease-out;
}