/* ============================================
   PORTFOLIO STYLESHEET - COMPREHENSIVE VERSION
   Responsive design with proper progress bar fixes
============================================ */

/* --------------------------------------
   1. CSS VARIABLES & BASE STYLES
-------------------------------------- */
:root {
    /* Light Mode Colors */
    --light-bg: #f8f9fa;
    --light-surface: rgba(255, 255, 255, 0.6);
    --light-text-primary: #212529;
    --light-text-secondary: #495057;
    --light-accent-primary: #007BFF;
    --light-accent-secondary: #6f42c1;
    --light-accent-tertiary: #17a2b8;
    
    /* Dark Mode Colors */
    --dark-bg: #121212;
    --dark-surface: rgba(255, 255, 255, 0.05);
    --dark-text-primary: #ffffff;
    --dark-text-secondary: #d1d1d1;
    --dark-accent-primary: #66B2FF;
    --dark-accent-secondary: #b188f2;
    --dark-accent-tertiary: #4dd0e1;
    
    /* RGB Values for opacity variations */
    --accent-primary-rgb: 0, 123, 255;
    --accent-secondary-rgb: 111, 66, 193;
    --accent-tertiary-rgb: 23, 162, 184;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #007BFF 0%, #6f42c1 100%);
    --gradient-dark: linear-gradient(135deg, #0d0d0d 0%, #1a1a1a 100%);
    
    /* Default theme (light) */
    --bg: var(--light-bg);
    --surface: var(--light-surface);
    --text-primary: var(--light-text-primary);
    --text-secondary: var(--light-text-secondary);
    --accent-primary: var(--light-accent-primary);
    --accent-secondary: var(--light-accent-secondary);
    --accent-tertiary: var(--light-accent-tertiary);
    
    /* Common variables */
    --border-radius: 10px;
    --transition: all 0.3s ease;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    
    /* Spacing System */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-xxl: 5rem;
    
    /* Typography */
    --font-size-xs: clamp(0.7rem, 0.7rem + 0.2vw, 0.8rem);
    --font-size-sm: clamp(0.8rem, 0.8rem + 0.2vw, 0.95rem);
    --font-size-base: clamp(1rem, 1rem + 0.2vw, 1.1rem);
    --font-size-lg: clamp(1.2rem, 1.2rem + 0.4vw, 1.5rem);
    --font-size-xl: clamp(1.5rem, 1.5rem + 1vw, 2rem);
    --font-size-xxl: clamp(2rem, 2rem + 2vw, 3.5rem);
}

/* Basic Reset & Global Styles */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 100%;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Dark mode toggle */
body.dark-mode {
    --bg: var(--dark-bg);
    --surface: var(--dark-surface);
    --text-primary: var(--dark-text-primary);
    --text-secondary: var(--dark-text-secondary);
    --accent-primary: var(--dark-accent-primary);
    --accent-secondary: var(--dark-accent-secondary);
    --accent-tertiary: var(--dark-accent-tertiary);
}

/* Base container */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* Responsive image handling */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Basic typography */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    margin-bottom: 0.5em;
    font-weight: 700;
}

h1 { font-size: var(--font-size-xxl); }
h2 { font-size: var(--font-size-xl); }
h3 { font-size: var(--font-size-lg); }
h4 { font-size: var(--font-size-base); }

p {
    margin-bottom: 1rem;
    font-size: var(--font-size-base);
}

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

a:hover,
a:focus {
    color: var(--accent-secondary);
}

/* Accessible outline styles */
a:focus-visible, 
button:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Hide focus outlines for mouse users, show for keyboard */
:focus:not(:focus-visible) {
    outline: none;
}

/* Glass card effect */
.glass-card {
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    transition: var(--transition);
}

/* Button styles */
.btn {
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: var(--font-size-base);
    line-height: 1.4;
    text-align: center;
    border: none;
    min-height: 44px; /* Accessibility - touch target size */
    user-select: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(var(--accent-primary-rgb), 0.4);
}

.btn-primary:hover,
.btn-primary:focus {
    transform: translateY(-3px);
    box-shadow: 0 7px 20px rgba(var(--accent-primary-rgb), 0.5);
    color: white;
}

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

.btn-secondary:hover,
.btn-secondary:focus {
    background: var(--accent-primary);
    color: white;
    transform: translateY(-3px);
}

.btn-hire-me {
    background: #29b2fe;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    font-size: 1.05rem;
    border: none;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 15px rgba(41,178,254,0.1);
    transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
    padding: 0.8rem 1.2rem;
}

.btn-hire-me:hover,
.btn-hire-me:focus {
    background: #0099e5;
    color: #fff;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 24px rgba(41,178,254,0.2);
    text-decoration: none;
}

.freelancer-icon {
    width: 28px;
    height: 28px;
    display: inline-block;
    vertical-align: middle;
}

/* Section styling */
section {
    padding: var(--space-xxl) 0;
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-line {
    width: 80px;
    height: 4px;
    background: var(--gradient-primary);
    margin: 0 auto;
    border-radius: 2px;
}

/* --------------------------------------
   2. NAVIGATION
-------------------------------------- */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    z-index: 1000;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.1);
}

nav.scrolled {
    background: var(--surface);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    padding: 0.8rem 2rem;
}

.logo {
    font-weight: 700;
    font-size: 1.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: var(--transition);
}

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

.nav-links a {
    color: var(--text-primary);
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a:focus::after {
    width: 100%;
}

.nav-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-primary);
    transition: var(--transition);
    background: transparent;
    border: none;
    padding: 0.5rem;
}

.theme-toggle:hover,
.theme-toggle:focus {
    color: var(--accent-primary);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 1001;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    transition: var(--transition);
}

/* --------------------------------------
   3. HERO SECTION
-------------------------------------- */
.hero {
    min-height: 100vh;
    padding-top: 6rem;
    display: flex;
    align-items: center;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    z-index: -1;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.hero-text {
    flex: 1;
    max-width: 600px;
    opacity: 0;
    animation: slideInLeft 1s ease forwards;
}

.hero-title {
    font-size: var(--font-size-xxl);
    line-height: 1.2;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
}

.greeting {
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 0.9em;
}

.name {
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.role {
    font-weight: 600;
}

.hero-description {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 90%;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

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

.hero-social a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    color: var(--text-primary);
    font-size: 1.2rem;
    transition: var(--transition);
}

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

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    opacity: 0;
    animation: slideInRight 1s 0.3s ease forwards;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(20px);
    z-index: -1;
}

.shape-1 {
    background: var(--accent-primary);
    width: 200px;
    height: 200px;
    top: -50px;
    right: 0;
    opacity: 0.3;
}

.shape-2 {
    background: var(--accent-secondary);
    width: 300px;
    height: 300px;
    bottom: -100px;
    right: 100px;
    opacity: 0.2;
}

.shape-3 {
    background: var(--accent-tertiary);
    width: 150px;
    height: 150px;
    top: 100px;
    right: 200px;
    opacity: 0.3;
}

.hero-img-container {
    width: 240px;
    height: 260px;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    overflow: hidden;
    border: 5px solid rgba(var(--accent-primary-rgb), 0.3);
    box-shadow: var(--shadow);
    margin: 0 auto;
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    animation: fadeIn 1s 1s forwards;
}

.mouse {
    width: 30px;
    height: 50px;
    border: 2px solid var(--text-secondary);
    border-radius: 20px;
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.wheel {
    width: 4px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 2px;
    margin-top: 10px;
    animation: scroll 1.5s infinite;
}

.arrows {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.arrows span {
    display: block;
    width: 10px;
    height: 10px;
    border-bottom: 2px solid var(--text-secondary);
    border-right: 2px solid var(--text-secondary);
    transform: rotate(45deg);
    margin: -3px;
    animation: arrowDown 1.5s infinite;
}

.arrows span:nth-child(2) {
    animation-delay: 0.2s;
}

.arrows span:nth-child(3) {
    animation-delay: 0.4s;
}

/* --------------------------------------
   4. ABOUT SECTION
-------------------------------------- */
.about-content {
    display: flex;
    align-items: center;
    gap: 4rem;
    margin-top: 2rem;
}

.about-image {
    flex: 1;
    position: relative;
    max-width: 400px;
}

.image-border {
    width: 240px;
    height: 260px;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    overflow: hidden;
    border: 5px solid rgba(var(--accent-primary-rgb), 0.3);
    box-shadow: var(--shadow);
    transition: var(--transition);
    animation: morphing 10s ease-in-out infinite;
    margin: 0 auto;
}

.experience-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 5px 15px rgba(var(--accent-primary-rgb), 0.5);
    animation: pulse 2s infinite;
}

.experience-badge .number {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
}

.experience-badge .text {
    font-size: 0.7rem;
    text-align: center;
    max-width: 80%;
}

.about-text {
    flex: 1.5;
}

.about-intro {
    font-size: var(--font-size-lg);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.highlight {
    font-weight: 700;
    color: var(--accent-primary);
}

.about-description {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.about-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.detail-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: var(--shadow);
}

.detail-content h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.detail-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.about-cta {
    display: flex;
    gap: 1rem;
}

/* --------------------------------------
   5. SKILLS SECTION
-------------------------------------- */
.skills::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 300px;
    background: var(--accent-primary);
    opacity: 0.05;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 0;
}

.skills-content {
    position: relative;
    z-index: 1;
}

.skills-text {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 3rem;
}

.skills-subtitle {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--accent-primary);
}

.skills-description {
    color: var(--text-secondary);
    line-height: 1.8;
}

.skills-categories {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.skill-category {
    background: var(--surface);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.skill-category:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.category-title {
    font-size: var(--font-size-lg);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--accent-primary);
}

.category-title i {
    font-size: 1.2rem;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.skill-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 150px;
}

.skill-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: white;
    font-size: 1.8rem;
    box-shadow: 0 5px 15px rgba(var(--accent-primary-rgb), 0.3);
}

.skill-item h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
}

/* Enhanced skill progress bars with better responsive support */
.skill-progress-container {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.skill-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: var(--gradient-primary);
    border-radius: 4px;
    transform-origin: left;
    transform: scaleX(0);
    will-change: transform;
}

.skill-note {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    margin-top: 0.5rem;
    line-height: 1.4;
    text-align: center;
}

/* Ensure all screen sizes display progress bars correctly */
@media (max-width: 1200px) {
    .skill-progress-container {
        width: 100% !important; /* Force width at all screen sizes */
        min-width: 100px;
    }
    
    .skill-progress {
        width: 100% !important; /* Ensure width is set to 100% */
    }
}

/* Specific fix for tablet sizes where the issue appears */
@media (min-width: 577px) and (max-width: 991px) {
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .skill-item {
        width: 100%;
    }
    
    /* Ensure transforms work on this screen size */
    .skill-progress {
        transform: scaleX(0); /* Reset transform */
        transition: transform 1.5s ease !important; /* Force transition */
    }
}

/* Fallback for when JavaScript doesn't load */
.no-js .skill-progress {
    transform: none !important;
    width: var(--skill-percent);
}

/* --------------------------------------
   6. PROJECTS SECTION
-------------------------------------- */
.projects::before {
    content: '';
    position: absolute;
    bottom: -100px;
    left: -100px;
    width: 400px;
    height: 400px;
    background: var(--accent-secondary);
    opacity: 0.05;
    border-radius: 50%;
    filter: blur(100px);
    z-index: 0;
}

.projects-filter {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--surface);
    color: var(--text-primary);
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.filter-btn:hover {
    transform: translateY(-3px);
}

.filter-btn.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(var(--accent-primary-rgb), 0.3);
}

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

.project-card {
    background: var(--surface);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    transform: translateY(0);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.project-img {
    position: relative;
    overflow: hidden;
    height: 200px;
}

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

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

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(var(--accent-primary-rgb), 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

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

.project-link {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    font-size: 1.2rem;
    transition: var(--transition);
    transform: translateY(20px);
    opacity: 0;
}

.project-card:hover .project-link {
    transform: translateY(0);
    opacity: 1;
}

.project-link:hover {
    background: var(--accent-secondary);
    color: white;
}

.project-link:nth-child(1) {
    transition-delay: 0.1s;
}

.project-link:nth-child(2) {
    transition-delay: 0.2s;
}

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

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

.project-tag {
    background: rgba(var(--accent-primary-rgb), 0.1);
    color: var(--accent-primary);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: var(--font-size-xs);
    font-weight: 500;
}

.project-title {
    font-size: var(--font-size-lg);
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.project-description {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    line-height: 1.6;
}

.project-card.hide {
    display: none;
}

/* Animation for project filtering */
.animate-filter {
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0;
    transform: scale(0.9);
}

.project-card:not(.hide) {
    opacity: 1;
    transform: scale(1);
}

/* --------------------------------------
   7. EDUCATION/EXPERIENCE SECTION
-------------------------------------- */
.education::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: var(--accent-tertiary);
    opacity: 0.05;
    border-radius: 50%;
    filter: blur(100px);
    z-index: 0;
}

.timeline-wrapper {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
}

.timeline-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.timeline-tab {
    background: var(--surface);
    color: var(--text-primary);
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    min-width: 150px;
}

.timeline-tab:hover {
    transform: translateY(-3px);
}

.timeline-tab.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(var(--accent-primary-rgb), 0.3);
}

.timeline-container {
    position: relative;
}

.timeline {
    display: none;
    position: relative;
}

.timeline.active {
    display: block;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--accent-primary);
    opacity: 0.3;
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin-bottom: 4rem;
    width: 100%;
}

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

.timeline-dot {
    position: absolute;
    left: 50%;
    width: 20px;
    height: 20px;
    background: var(--gradient-primary);
    border-radius: 50%;
    transform: translateX(-50%);
    z-index: 2;
    box-shadow: 0 0 0 4px rgba(var(--accent-primary-rgb), 0.2);
}

.timeline-date {
    position: absolute;
    top: 0;
    left: 0;
    width: calc(50% - 30px);
    text-align: right;
    padding-right: 30px;
    font-weight: 600;
    color: var(--accent-primary);
}

.timeline-content {
    margin-left: calc(50% + 30px);
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    position: relative;
    transition: var(--transition);
}

.timeline-content::before {
    content: '';
    position: absolute;
    top: 10px;
    left: -10px;
    width: 20px;
    height: 20px;
    background: var(--surface);
    transform: rotate(45deg);
}

.timeline-content h3 {
    font-size: var(--font-size-lg);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.timeline-content h4 {
    font-size: var(--font-size-base);
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.timeline-content p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

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

.timeline-tag {
    background: rgba(var(--accent-primary-rgb), 0.1);
    color: var(--accent-primary);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: var(--font-size-xs);
    font-weight: 500;
}

/* Alternating timeline items */
.timeline-item:nth-child(even) .timeline-date {
    left: auto;
    right: 0;
    text-align: left;
    padding-right: 0;
    padding-left: 30px;
}

.timeline-item:nth-child(even) .timeline-content {
    margin-left: 0;
    margin-right: calc(50% + 30px);
}

.timeline-item:nth-child(even) .timeline-content::before {
    left: auto;
    right: -10px;
}

.timeline-item.animated .timeline-content {
    animation: slideUp 0.6s ease forwards;
}

/* --------------------------------------
   8. CONTACT SECTION
-------------------------------------- */
.contact {
    background-color: var(--bg);
    position: relative;
    overflow: hidden;
}

.contact::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    width: 400px;
    height: 400px;
    background: var(--accent-tertiary);
    border-radius: 50%;
    filter: blur(100px);
    z-index: 0;
    transform: translateX(-50%);
    pointer-events: none;
    opacity: 0; /* default: hidden for light mode */
}

body.dark-mode .contact::before {
    opacity: 0.18;
}

.contact-content {
    display: flex;
    gap: 3rem;
    position: relative;
    z-index: 1;
}

.contact-info {
    flex: 1;
    background: var(--surface);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.contact-subtitle {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--accent-primary);
}

.contact-description {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.contact-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.contact-icon {
    width: 45px;
    height: 45px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
    box-shadow: 0 5px 15px rgba(var(--accent-primary-rgb), 0.3);
}

.contact-text h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.contact-text a, 
.contact-text p {
    color: var(--text-secondary);
    transition: var(--transition);
}

.contact-text a:hover {
    color: var(--accent-primary);
}

.contact-social {
    margin-top: auto;
}

.contact-social h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.social-links {
    display: flex;
    gap: 0.8rem;
}

.social-link {
    width: 40px;
    height: 40px;
    background: var(--bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.social-link:hover {
    background: var(--gradient-primary);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(var(--accent-primary-rgb), 0.3);
}

.contact-form-wrapper {
    flex: 1.2;
    background: var(--surface);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.form-group input, 
.form-group textarea {
    padding: 0.8rem 1rem;
    border-radius: var(--border-radius);
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: var(--bg);
    color: var(--text-primary);
    transition: var(--transition);
    font-family: inherit;
    resize: none;
}

.form-group input:focus, 
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb), 0.2);
}

.form-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 0.8rem 1.5rem;
    margin-top: 1rem;
}

.submit-icon {
    transition: transform 0.3s ease;
}

.form-submit:hover .submit-icon {
    transform: translateX(5px);
}

.form-success {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    transform: translateY(100%);
    transition: transform 0.5s ease;
    z-index: 2;
}

.form-success.active {
    transform: translateY(0);
}

.success-icon {
    width: 80px;
    height: 80px;
    background: rgba(var(--accent-primary-rgb), 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.form-success h3 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: 1rem;
}

.form-success p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* --------------------------------------
   9. FOOTER
-------------------------------------- */
.footer {
    background: var(--surface);
    padding: 4rem 0 2rem;
    position: relative;
    z-index: 1;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.footer-logo h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.footer-logo p {
    color: var(--text-secondary);
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-primary);
    transition: var(--transition);
}

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

.footer-social {
    display: flex;
    gap: 1rem;
}

.footer-social a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    color: var(--text-primary);
    transition: var(--transition);
}

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

.footer-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}

.footer-bottom p {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* --------------------------------------
   10. RESPONSIVE STYLES
-------------------------------------- */

/* Mobile Navigation */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 80%;
        max-width: 300px;
        flex-direction: column;
        gap: 2rem;
        background: var(--surface);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: 5rem 2rem;
        transition: right 0.3s ease;
        z-index: 100;
    }
    
    .nav-links.active {
        right: 0;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    }
    
    .hamburger {
        display: flex;
        width: 30px;
        height: 24px;
        position: relative;
        justify-content: space-between;
    }
    
    .hamburger.active .bar:nth-child(1) {
        transform: translateY(10.5px) rotate(45deg);
    }
    
    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-10.5px) rotate(-45deg);
    }
}

/* Extra small devices (phones, 576px and down) */
@media (max-width: 576px) {
    section {
        padding: 3rem 0;
    }
    
    .hero-content,
    .about-content,
    .contact-content {
        flex-direction: column;
    }
    
    .hero-image {
        margin-top: 2rem;
        order: -1;
    }
    
    .hero-text,
    .hero-description,
    .about-text {
        text-align: center;
    }
    
    .hero-cta,
    .hero-social,
    .about-cta {
        justify-content: center;
    }
    
    .about-image {
        margin: 0 auto 2rem;
    }
    
    .about-details {
        grid-template-columns: 1fr;
    }
    
    .detail-item {
        justify-content: center;
    }
    
    .skills-grid,
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .timeline-tabs {
        flex-direction: row;
        width: 100%;
    }
    
    .timeline-tab {
        flex: 1;
        min-width: auto;
        padding: 0.8rem 0.5rem;
        font-size: var(--font-size-sm);
    }
    
    .timeline::before {
        left: 20px;
    }
    
    .timeline-dot {
        left: 20px;
        width: 16px;
        height: 16px;
    }
    
    .timeline-date {
        position: relative;
        width: 100%;
        left: 0;
        text-align: left;
        margin-left: 50px;
        padding: 0;
        margin-bottom: 0.5rem;
    }
    
    .timeline-content {
        margin-left: 50px;
        margin-right: 0;
        width: calc(100% - 50px);
        padding: 1rem;
    }
    
    .timeline-item:nth-child(even) .timeline-date {
        left: 0;
        text-align: left;
        margin-left: 50px;
        padding: 0;
    }
    
    .timeline-item:nth-child(even) .timeline-content {
        margin-left: 50px;
        margin-right: 0;
    }
    
    .timeline-content::before,
    .timeline-item:nth-child(even) .timeline-content::before {
        display: none;
    }
    
    .projects-filter {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .filter-btn {
        width: 100%;
        padding: 0.5rem;
        font-size: var(--font-size-sm);
    }
    
    .contact-form-wrapper, 
    .contact-info {
        padding: 1.5rem;
    }
    
    .footer-content, 
    .footer-bottom,
    .footer-links {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-cta,
    .about-cta {
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        width: 100%;
    }
}

/* Small devices (landscape phones, 576px to 767px) */
@media (min-width: 577px) and (max-width: 767px) {
    .hero-img-container {
        width: 240px;
        height: 260px;
    }
    
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .timeline::before {
        left: 30px;
    }
    
    .timeline-dot {
        left: 30px;
    }
    
    .timeline-date {
        position: relative;
        width: 100%;
        left: 0;
        text-align: left;
        margin-left: 60px;
        padding: 0;
        margin-bottom: 0.5rem;
    }
    
    .timeline-content {
        margin-left: 60px;
        margin-right: 0;
        width: calc(100% - 60px);
    }
    
    .timeline-item:nth-child(even) .timeline-date {
        left: 0;
        text-align: left;
        margin-left: 60px;
        padding: 0;
    }
    
    .timeline-item:nth-child(even) .timeline-content {
        margin-left: 60px;
        margin-right: 0;
    }
    
    .timeline-content::before {
        display: none;
    }
}

/* Medium devices (tablets, 768px to 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .hero-content {
        flex-direction: column-reverse;
        text-align: center;
    }
    
    .hero-text,
    .hero-description {
        max-width: 100%;
    }
    
    .hero-cta,
    .hero-social {
        justify-content: center;
    }
    
    .about-content {
        flex-direction: column;
    }
    
    .about-image {
        margin: 0 auto 2rem;
    }
    
    .about-text {
        text-align: center;
    }
    
    .about-details {
        justify-content: center;
    }
    
    .detail-item {
        justify-content: flex-start;
    }
    
    .about-cta {
        justify-content: center;
    }
    
    .contact-content {
        flex-direction: column;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .container {
        padding: 0;
    }
    
    .contact-content {
        display: grid;
        grid-template-columns: 1fr 1.2fr;
        gap: 3rem;
    }
}

/* Very large devices */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

/* Fix for very small devices */
@media (max-width: 360px) {
    :root {
        --font-size-base: 0.95rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .hero-social, 
    .footer-social {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .social-link,
    .hero-social a {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
}

/* Print styles for resumes */
@media print {
    body {
        background: white;
        color: black;
    }
    
    nav, 
    .hero-social, 
    .scroll-indicator, 
    .contact-form-wrapper, 
    .footer {
        display: none;
    }
    
    section {
        padding: 1rem 0;
        min-height: auto;
    }
    
    .about-content,
    .skills-content,
    .timeline-content {
        break-inside: avoid;
    }
}