/* CSS Reset and Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary-color: #4f46e5;
    --primary-dark: #4338ca;
    --text-color: #1e293b;
    --text-light: #64748b;
    --bg-color: #ffffff;
    --bg-alt: #f8fafc;
    --border-color: #e2e8f0;
    --card-bg: #ffffff;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 40px rgba(79, 70, 229, 0.15), 0 8px 16px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
    --hero-gradient: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 50%, #c7d2fe 100%);
    --tech-tag-bg: #e0e7ff;
    --navbar-bg: rgba(255, 255, 255, 0.9);
    --accent-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

[data-theme="dark"] {
    --primary-color: #3b82f6;
    --primary-dark: #60a5fa;
    --text-color: #f3f4f6;
    --text-light: #9ca3af;
    --bg-color: #111827;
    --bg-alt: #1f2937;
    --border-color: #374151;
    --card-bg: #1f2937;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.4);
    --hero-gradient: linear-gradient(135deg, #1e3a5f 0%, #1e293b 100%);
    --tech-tag-bg: #1e3a5f;
    --navbar-bg: rgba(17, 24, 39, 0.95);
}

html {
    scroll-behavior: smooth;
}

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

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

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--navbar-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    height: 64px;
}

.nav-logo {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 32px;
    margin-left: auto;
    margin-right: 24px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
}

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

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    color: var(--text-color);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.theme-toggle .sun-icon {
    display: none;
}

.theme-toggle .moon-icon {
    display: block;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: block;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: none;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 20px;
    background: var(--hero-gradient);
}

.hero-content {
    text-align: center;
    max-width: 700px;
}

.hero-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 24px;
    border: 4px solid transparent;
    background:
        linear-gradient(var(--bg-color), var(--bg-color)) padding-box,
        linear-gradient(135deg, var(--primary-color) 0%, #7c3aed 100%) border-box;
    box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .hero-avatar {
    background:
        linear-gradient(var(--bg-color), var(--bg-color)) padding-box,
        linear-gradient(135deg, #3b82f6 0%, #6366f1 100%) border-box;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 16px;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 32px;
    line-height: 1.8;
}

.hero-links {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #7c3aed 100%);
    color: white;
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #6d28d9 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
}

[data-theme="dark"] .btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--bg-alt);
}

/* Sections */
.section {
    padding: 80px 0;
}

.section-alt {
    background: var(--bg-alt);
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 40px;
    text-align: center;
    color: var(--text-color);
}

/* About Section */
.about-text {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    line-height: 1.9;
}

/* Experience Timeline */
.exp-timeline {
    max-width: 800px;
    margin: 0 auto;
}

.exp-item {
    display: flex;
    gap: 24px;
    position: relative;
}

.exp-item:last-child .exp-line {
    display: none;
}

.exp-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 8px;
}

.exp-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-color);
    border: 3px solid var(--text-light);
    flex-shrink: 0;
    z-index: 1;
}

.exp-item.current .exp-dot {
    width: 20px;
    height: 20px;
    border: 4px solid var(--primary-color);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.2);
}

.exp-line {
    width: 2px;
    flex-grow: 1;
    background: var(--border-color);
    margin-top: 8px;
}

.exp-card {
    flex: 1;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.exp-item.current .exp-card {
    border-color: var(--primary-color);
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.15);
}

.exp-card:hover {
    box-shadow: var(--shadow-lg);
}

.exp-badge {
    position: absolute;
    top: -10px;
    right: 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #7c3aed 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.exp-header {
    margin-bottom: 16px;
}

.exp-company {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 6px;
}

.exp-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    align-items: center;
}

.exp-role {
    font-size: 1rem;
    color: var(--primary-color);
    font-weight: 600;
}

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

.exp-highlights {
    list-style: none;
    padding: 0;
    margin: 0 0 12px 0;
}

.exp-highlights li {
    font-size: 1rem;
    color: var(--text-color);
    padding-left: 20px;
    position: relative;
    margin-bottom: 10px;
    line-height: 1.6;
}

.exp-highlights li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.exp-expand-hint {
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 500;
    padding-top: 8px;
    transition: var(--transition);
}

.exp-expand-hint .collapse-text {
    display: none;
}

.exp-card.expanded .exp-expand-hint .expand-text {
    display: none;
}

.exp-card.expanded .exp-expand-hint .collapse-text {
    display: inline;
}

.exp-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.exp-card.expanded .exp-details {
    max-height: 600px;
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid var(--border-color);
}

.exp-full-list {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
}

.exp-full-list li {
    font-size: 0.95rem;
    color: var(--text-light);
    padding-left: 20px;
    position: relative;
    margin-bottom: 12px;
    line-height: 1.6;
}

.exp-full-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.exp-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.exp-tech span {
    font-size: 0.8rem;
    padding: 5px 14px;
    background: var(--tech-tag-bg);
    color: var(--primary-color);
    border-radius: 20px;
    font-weight: 500;
}

@media (max-width: 600px) {
    .exp-item {
        gap: 16px;
    }

    .exp-marker {
        padding-top: 4px;
    }

    .exp-card {
        padding: 20px;
    }

    .exp-company {
        font-size: 1.2rem;
    }

    .exp-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .exp-highlights li {
        font-size: 0.95rem;
    }
}

@media (max-width: 600px) {
    .career-timeline {
        padding: 20px 15px;
    }

    .track-year {
        font-size: 0.65rem;
    }

    .track-tooltip {
        padding: 8px 10px;
    }

    .track-tooltip strong {
        font-size: 0.8rem;
    }

    .track-tooltip span {
        font-size: 0.7rem;
    }
}

/* Timeline */
.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

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

.timeline-item {
    position: relative;
    padding-left: 40px;
    margin-bottom: 40px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -5px;
    top: 8px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 2px solid white;
    box-shadow: var(--shadow);
}

.timeline-content {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.timeline-header {
    margin-bottom: 16px;
}

.timeline-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
}

.timeline-header .company {
    display: block;
    font-size: 1rem;
    color: var(--primary-color);
    font-weight: 500;
}

.timeline-header .location,
.timeline-header .date {
    display: inline-block;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-right: 16px;
}

.timeline-details {
    list-style: none;
    margin-bottom: 16px;
}

.timeline-details li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.7;
}

.timeline-details li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary-color);
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tech-tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--tech-tag-bg);
    color: var(--primary-color);
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 20px;
}

/* Skills Section */
.skills-list {
    max-width: 800px;
    margin: 0 auto;
}

.skill-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 16px;
}

.skill-label {
    width: 280px;
    flex-shrink: 0;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
    padding-top: 8px;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 50px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.skill-tag i {
    font-size: 1.1rem;
}

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

@media (max-width: 600px) {
    .skill-row {
        flex-direction: column;
        gap: 8px;
    }

    .skill-label {
        min-width: auto;
        padding-top: 0;
    }
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
}

.project-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

.project-banner {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.project-banner.backend {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

.project-banner.infra {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
}

.project-type {
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.project-content {
    padding: 20px;
}

.project-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 12px;
}

.project-description {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 16px;
}

.project-metrics {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
}

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

.metric-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.metric-label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.project-tech .tech-tag {
    font-size: 0.75rem;
    padding: 4px 10px;
}

@media (max-width: 700px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

/* Education Section */
.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.education-card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.education-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}

.education-card .institution {
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 4px;
}

.education-card .location {
    color: var(--text-light);
    font-size: 0.9rem;
}

.education-card .year {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-top: 8px;
}

/* Contact Section */
.contact-text {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 32px;
    font-size: 1.1rem;
}

.contact-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: var(--bg-alt);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.contact-item:hover {
    background: var(--card-bg);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.contact-item svg {
    flex-shrink: 0;
}

/* Footer */
.footer {
    background: #111827;
    color: white;
    padding: 24px 0;
    text-align: center;
}

[data-theme="dark"] .footer {
    background: #0a0f1a;
}

.footer p {
    font-size: 0.9rem;
    opacity: 0.8;
}

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

    .theme-toggle {
        margin-left: auto;
    }

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

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

    .hero-description {
        font-size: 1rem;
    }

    .section {
        padding: 60px 0;
    }

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

    .timeline::before {
        left: 5px;
    }

    .timeline-item {
        padding-left: 30px;
    }

    .timeline-marker {
        left: 0;
    }

    .contact-links {
        flex-direction: column;
        align-items: center;
    }

    .contact-item {
        width: 100%;
        max-width: 350px;
        justify-content: center;
    }
}

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

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

    .btn {
        width: 100%;
        text-align: center;
    }
}
