:root {
    /* Color Palette - Light Theme (Default) */
    --primary-color: #0F172A;
    --secondary-bg: #F8FAFC;
    --sidebar-bg: #FFFFFF;
    --card-bg: #FFFFFF;
    --accent-color: #38BDF8;
    --text-main: #334155;
    --text-muted: #64748B;
    --border-color: #E2E8F0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    
    /* Fonts */
    --font-body: 'Inter', sans-serif;
    --font-heading: 'Poppins', sans-serif;
    
    /* Layout */
    --sidebar-width: 280px;
    --content-max-width: 900px;
}

[data-theme="dark"] {
    /* Color Palette - Dark Theme */
    --primary-color: #F8FAFC; /* Inverted for text headings */
    --secondary-bg: #0F172A;
    --sidebar-bg: #1E293B;
    --card-bg: #1E293B;
    --accent-color: #38BDF8;
    --text-main: #E2E8F0;
    --text-muted: #94A3B8;
    --border-color: #334155;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--secondary-bg);
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--primary-color);
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Layout Wrapper */
.layout-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    z-index: 100;
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

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

.profile-img-container {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    overflow: hidden;
    border: 3px solid var(--accent-color);
    padding: 3px;
    background-color: var(--sidebar-bg);
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.profile-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.profile-title {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.nav-menu {
    flex: 1;
    overflow-y: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.2s;
}

.nav-link i {
    width: 24px;
    margin-right: 0.75rem;
}

.nav-link:hover, .nav-link.active {
    background-color: rgba(56, 189, 248, 0.1);
    color: var(--accent-color);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.social-icons a {
    color: var(--text-muted);
    font-size: 1.2rem;
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-family: var(--font-heading);
}

.btn-primary {
    background-color: var(--accent-color);
    color: #FFFFFF;
}

.btn-primary:hover {
    background-color: #0EA5E9; /* Darker Sky Blue */
    transform: translateY(-1px);
}

.btn-block {
    width: 100%;
    display: flex;
}

.btn i {
    margin-left: 0.5rem;
}

/* Theme Switch */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1.5rem;
    gap: 0.75rem;
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: .4s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
    font-size: 12px;
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    z-index: 2;
}

input:checked + .slider {
    background-color: var(--accent-color);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.theme-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 0;
    max-width: 100%;
    overflow-x: hidden;
}

.section {
    padding: 4rem 3rem;
    max-width: var(--content-max-width);
    margin: 0 auto;
    min-height: 80vh; /* Make sections substantial */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.section-heading {
    font-size: 2rem;
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 1rem;
}

.section-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background-color: var(--accent-color);
    border-radius: 2px;
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
}

.greeting {
    font-size: 1.1rem;
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 1rem;
    display: block;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.cursor {
    color: var(--accent-color);
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-bio {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin-bottom: 3rem;
}

.stats-counter {
    display: flex;
    gap: 3rem;
    padding: 1.5rem;
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    width: fit-content;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Experience Section */
.timeline {
    position: relative;
    max-width: 800px;
}

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

.timeline-item {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 3rem;
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.6s ease;
}

.timeline-item.visible {
    opacity: 1;
    transform: translateX(0);
}

.timeline-dot {
    position: absolute;
    left: -4px;
    top: 0;
    width: 10px;
    height: 10px;
    background-color: var(--accent-color);
    border-radius: 50%;
    border: 2px solid var(--secondary-bg);
}

.timeline-date {
    display: block;
    font-size: 0.875rem;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.timeline-role {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.timeline-company {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 1rem;
}

.timeline-content p {
    color: var(--text-muted);
}

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

.category-title {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.skill-bar-wrapper {
    margin-bottom: 1.5rem;
}

.skill-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.skill-progress-bg {
    width: 100%;
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.skill-progress-fill {
    height: 100%;
    background-color: var(--accent-color);
    border-radius: 4px;
    width: 0; /* Animated via JS */
    transition: width 1.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.skill-tag {
    padding: 0.5rem 1rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    font-size: 0.875rem;
    color: var(--text-main);
    transition: all 0.2s;
}

.skill-tag:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-2px);
}

/* Projects Section */
.project-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.2s;
}

.filter-btn:hover, .filter-btn.active {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

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

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

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

.project-img {
    height: 180px;
    overflow: hidden;
}

.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover .project-img img {
    transform: scale(1.05);
}

.project-content {
    padding: 1.5rem;
}

.project-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.project-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.link-btn {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-color);
}

.link-btn.outline {
    color: var(--text-main);
}

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

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

.testimonial-card {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    position: relative;
}

.quote {
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.author-info h4 {
    font-size: 1rem;
    margin-bottom: 0;
}

.author-info span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Contact Section */
.contact-sub {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: var(--font-body);
    color: var(--text-main);
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
}

/* Mobile Header */
.mobile-header {
    display: none;
    padding: 1rem;
    background-color: var(--sidebar-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    justify-content: space-between;
    align-items: center;
}

.mobile-header .logo {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
}

/* Responsive */
@media (max-width: 992px) {
    .layout-wrapper {
        flex-direction: column;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        position: fixed;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding-top: 0;
    }

    .mobile-header {
        display: flex;
    }

    .section {
        padding: 3rem 1.5rem;
        min-height: auto;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .stats-counter {
        flex-wrap: wrap;
        width: 100%;
        gap: 2rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}
