/* Base Styles & Variables */
:root {
    --primary-color: #4a90e2;
    --secondary-color: #357abd;
    --accent-color: #f8a978;
    --background-color: #f0f2f5;
    --sidebar-bg: rgba(255, 255, 255, 0.95);
    --content-bg: rgba(255, 255, 255, 0.95);
    --text-color: #333333;
    --text-muted: #666666;
    --heading-color: #2c3e50;
    --border-color: #e0e0e0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --timeline-line: #e0e0e0;
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --primary-color: #64b5f6;
    --secondary-color: #42a5f5;
    --background-color: #121212;
    --sidebar-bg: rgba(30, 30, 30, 0.95);
    --content-bg: rgba(30, 30, 30, 0.95);
    --text-color: #e0e0e0;
    --text-muted: #a0a0a0;
    --heading-color: #ffffff;
    --border-color: #444444;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --timeline-line: #444444;
}

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

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--background-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--heading-color);
    margin-bottom: 1rem;
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

/* Layout */
.container {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    gap: 2rem;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    border-radius: 16px;
    padding: 2rem;
    position: sticky;
    top: 2rem;
    height: calc(100vh - 4rem);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    backdrop-filter: blur(10px);
    z-index: 100;
}

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

.menu-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--heading-color);
    letter-spacing: 1px;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

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

nav ul {
    list-style: none;
}

nav ul li {
    margin-bottom: 0.5rem;
}

nav ul li a {
    display: block;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    color: var(--text-muted);
    font-weight: 500;
}

nav ul li a:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateX(5px);
}

/* Main Content */
.content {
    flex: 1;
    min-width: 0;
    /* Prevent overflow on flex items */
}

/* Sections & Timeline */
.timeline-section {
    position: relative;
    padding-left: 3rem;
    /* Space for line */
    margin-bottom: 4rem;
}

.timeline-section::before {
    content: '';
    position: absolute;
    left: 11px;
    /* Align deeply with icon center */
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--timeline-line);
}

.timeline-icon {
    position: absolute;
    left: 0;
    top: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--primary-color);
    border: 4px solid var(--background-color);
    /* Creates gap effect */
    z-index: 1;
    box-shadow: 0 0 0 2px var(--primary-color);
}

.timeline-content {
    background-color: var(--content-bg);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
    width: 100%;
    /* Fix fixed width issue */
    transition: transform 0.3s ease;
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

/* Profile Section */
.profile-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.profile-image {
    width: 220px;
    height: 280px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 20%;
    border: 2px solid var(--primary-color);
    box-shadow: var(--shadow);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.profile-image:hover {
    transform: scale(1.05) rotate(2deg);
}

.profile-name {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.profile-title {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.contact-info p {
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.contact-info span {
    color: var(--heading-color);
    font-weight: 600;
}

/* Social Links */
.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.social-links a {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--background-color);
    /* Subtle bg */
    border-radius: 50%;
    color: var(--text-muted);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

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

/* Project & Experience Items */
.timeline-content h3 {
    margin-top: 1.5rem;
    font-size: 1.25rem;
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
}

.timeline-content h3:first-of-type {
    margin-top: 0;
}

.timeline-content p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* Skills */
.skill-container {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.skill-category h3 {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
    border: none;
    padding: 0;
    color: var(--primary-color);
}

.skill-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-list li {
    background-color: var(--background-color);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.skill-list li:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
    border: 2px solid var(--primary-color);
    background-color: transparent;
    color: inherit;
    width: 100%;
}

.btn:hover {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 10px rgba(74, 144, 226, 0.3);
}

/* Theme Toggle */
.theme-switch {
    display: flex;
    justify-content: center;
    margin-top: auto;
    padding-top: 2rem;
}

#theme-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    padding: 10px;
    border-radius: 50%;
}

#theme-toggle:hover {
    background-color: var(--background-color);
    color: var(--primary-color);
    transform: rotate(15deg);
}

/* Animations */
.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, visibility;
}

.fade-in-section.visible {
    opacity: 1;
    transform: none;
}

/* Footer */
footer {
    text-align: center;
    padding: 3rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 2rem;
}

footer h1 {
    font-size: 1rem;
    font-weight: 400;
    opacity: 0.7;
}

/* Responsive */
.menu-btn {
    display: none;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    background: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    padding: 10px;
    border-radius: 8px;
    font-size: 1.5rem;
    color: var(--text-color);
}

@media (max-width: 992px) {
    .container {
        flex-direction: column;
        padding: 1rem;
    }

    .sidebar {
        position: fixed;
        left: -300px;
        top: 0;
        height: 100vh;
        width: 260px;
        margin: 0;
        transition: left 0.3s ease;
        border-radius: 0 16px 16px 0;
    }

    .sidebar.active {
        left: 0;
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    }

    .menu-btn {
        display: block;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .profile-image {
        margin: 0 auto;
    }

    .social-links {
        justify-content: center;
    }

    .timeline-section {
        padding-left: 2rem;
        /* Adjusted for smaller screens */
    }
}

/* Tag Styles for Certificates */
.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.tag {
    background-color: var(--background-color);
    color: var(--text-muted);
    padding: 0.35rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tag:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}