﻿/* ===================================
   Color Scheme Variables - Light Theme
   =================================== */
:root {
    --rice-white: #F5F5F0;
    --warm-white: #FFF9E6;
    --charcoal: #2B2B2B;
    --charcoal-light: #3A3A3A;
    --charcoal-lighter: #5A5A5A;
    --crimson: #DC143C;
    --light-gray: #E8E8E0;
    --medium-gray: #D0D0C8;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-dark: rgba(0, 0, 0, 0.2);
}

/* ===================================
   Global Styles
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--warm-white);
    color: var(--charcoal);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===================================
   Navigation
   =================================== */
.navbar {
    background-color: var(--charcoal) !important;
    padding: 1rem 2rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px var(--shadow);
}

.navbar.scrolled {
    background-color: rgba(43, 43, 43, 0.98) !important;
    padding: 0.5rem 2rem;
}

.navbar-brand {
    color: var(--rice-white) !important;
    font-size: 1.5rem;
    font-weight: bold;
    transition: color 0.3s ease;
}

.navbar-brand:hover {
    color: var(--crimson) !important;
}

.nav-link {
    color: var(--rice-white) !important;
    margin: 0 0.5rem;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--crimson);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

.nav-link.active {
    color: var(--crimson) !important;
}

.navbar-toggler {
    border-color: var(--rice-white);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(245, 245, 240, 0.75)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ===================================
   Hero Section
   =================================== */
.hero-section {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 120%; /* Slightly larger to accommodate parallax movement */
    object-fit: cover;
    z-index: 1;
    will-change: transform; /* Optimize for transform animations */
    transition: transform 0.1s ease-out; /* Smooth parallax movement */
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(23, 23, 23, 0.6), rgba(60, 20, 60, 0.4));
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    color: var(--charcoal);
    padding: 2rem;
    will-change: transform, opacity; /* Optimize for transform and opacity animations */
    transition: transform 0.1s ease-out, opacity 0.1s ease-out; /* Smooth parallax movement */
}

.hero-title {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px var(--shadow);
    color: #ffffff;
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    text-shadow: 1px 1px 2px var(--shadow);
    color: #ffffff;
    text-transform: uppercase;
}

.btn-hero {
    background-color: var(--crimson);
    border: none;
    color: white;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(220, 20, 60, 0.4);
}

.btn-hero:hover {
    background-color: #B01030;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(220, 20, 60, 0.6);
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    animation: bounce 2s infinite;
}

.scroll-indicator i {
    font-size: 2rem;
    color: var(--charcoal);
}

/* ===================================
   Section Styles
   =================================== */
.section {
    padding: 5rem 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

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

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background-color: var(--crimson);
    margin: 1rem auto;
}

.section-subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: var(--charcoal-lighter);
    margin-bottom: 3rem;
}

/* Alternating section backgrounds */
.skills-section {
    background-color: var(--rice-white);
}

.projects-section {
    background-color: var(--warm-white);
}

.resume-section {
    background-color: var(--rice-white);
}

.contact-section {
    background-color: var(--warm-white);
}

/* ===================================
   Skills Grid
   =================================== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
    padding: 1rem 0;
}

.skill-card {
    background-color: white;
    border-radius: 10px;
    padding: 0.2rem;
    text-align: center;
    transition: all 0.25s ease; /* Smooth 250ms transition */
    border: 2px solid var(--light-gray);
    cursor: pointer;
    box-shadow: 0 2px 8px var(--shadow);
    aspect-ratio: 1 / 1; /* Strictly maintain square shape */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden; /* Prevent content from breaking square layout */
}

/* Default state */
.skill-card .skill-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--charcoal-lighter);
    transition: all 0.3s ease;
    flex-shrink: 0; /* Prevent icon from shrinking */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Custom SVG icon styling to match Font Awesome icons */
.skill-card .skill-icon .custom-svg {
    width: 2.5rem;
    height: 2.5rem;
    fill: var(--charcoal-lighter);
    transition: all 0.3s ease;
    display: block;
}

/* Highlighted state for custom SVG icons */
.skill-card.highlighted .skill-icon .custom-svg {
    fill: #FFFFFF !important;
}

.skill-card .skill-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--charcoal);
    transition: all 0.3s ease;
    /* Text overflow handling for long names */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 0.25rem;
}

.skill-card .skill-category {
    display: none; /* Hide category in new design */
}

/* Highlight state - applies to both auto-highlighted and user-interacted */
/* Background color is applied dynamically via JavaScript using inline styles */
.skill-card.highlighted {
    border-color: transparent;
}

.skill-card.highlighted .skill-icon,
.skill-card.highlighted .skill-name {
    color: #FFFFFF !important; /* Always white, regardless of background color */
}


.skill-card .skill-name,
.skill-card.user-interacted .skill-name,
.skill-card.highlighted .skill-name {
    font-weight: 500;
}

/* Glow effect - only for user interactions (hover on desktop/tablet, tap on mobile) */
.skill-card.user-interacted {
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.8), 0 0 60px rgba(255, 255, 255, 0.5);
}

/* Desktop and Tablet hover effect (up to 1024px treated as desktop) */
@media (min-width: 769px) {
    .skill-card:hover {
        transform: translateY(-5px) scale(1.1); /* Scale to 110% on hover */
    }
}



/* ===================================
   Projects Carousel
   =================================== */
.projects-carousel-container {
    position: relative;
    max-width: 1300px;
    margin: 0 auto;
    padding: 2rem 0;
}

.projects-carousel {
    display: flex;
    overflow: visible; /* Changed from hidden to allow shadow to show */
    position: relative;
    min-height: 400px;
    padding: 1rem 0; /* Add padding to prevent shadow clipping */
}

.project-card {
    min-width: 100%;
    background-color: white;
    border-radius: 15px;
    overflow: visible; /* Changed from hidden to allow shadow to show */
    transition: transform 0.5s ease, box-shadow 0.5s ease; /* Optimized: only animate transform and box-shadow */
    display: none;
    box-shadow: 0 4px 20px var(--shadow-dark);
    border: 1px solid var(--light-gray);
    cursor: pointer; /* Make it clear the card is clickable */
    height: 450px; /* Reduced height for better proportions */
    will-change: transform, box-shadow; /* Performance hint for animations */
}

.project-card.active {
    display: block;
    animation: slideIn 0.5s ease;
}

.project-card:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 30px var(--shadow-dark);
}

.project-card-inner {
    border-radius: 15px;
    overflow: hidden; /* Move overflow hidden to inner container */
    height: 100%; /* Fill parent height */
    display: flex;
    flex-direction: column;
}

.project-image-container {
    position: relative;
    width: 100%;
    height: 66.67%; /* Image takes 2/3 (66%) of card height */
    flex-shrink: 0; /* Prevent image from shrinking */
}

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

.project-info {
    padding: 1.5rem 2rem;
    flex: 1; /* Take remaining space */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Prevent content from expanding card */
}

.project-title {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--charcoal);
    margin-bottom: 1rem;
    flex-shrink: 0; /* Prevent title from shrinking */
}

.project-description {
    color: var(--charcoal-light);
    line-height: 1.8;
    flex: 1; /* Take remaining space */
    overflow: hidden; /* Hide overflow text */
    display: -webkit-box;
    -webkit-line-clamp: 4; /* Limit to 4 lines */
    -webkit-box-orient: vertical;
}

.project-tech {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem;
    background: none; /* No background */
}

/* Override tech tag positioning in modal */
#modalBody .project-tech {
    position: static; /* Remove absolute positioning */
    margin-bottom: 1.5rem;
    padding: 0;
    flex-wrap: wrap; /* Allow tags to wrap to multiple lines */
}

/* Override text truncation in modal - show full content */
#modalBody .project-title {
    white-space: normal; /* Allow title to wrap */
    word-wrap: break-word; /* Break long words if needed */
    overflow: visible; /* Show all content */
}

#modalBody .project-description {
    overflow: visible; /* Remove overflow hidden */
    display: block; /* Remove flexbox display */
    -webkit-line-clamp: unset; /* Remove line clamp */
    -webkit-box-orient: unset; /* Remove box orient */
    white-space: normal; /* Allow text to wrap */
    word-wrap: break-word; /* Break long words if needed */
    line-height: 1.8; /* Maintain line height */
    color: var(--charcoal-light);
    margin-bottom: 1rem; /* Add spacing between paragraphs */
}

#modalBody .project-description:last-of-type {
    margin-bottom: 0; /* Remove margin from last paragraph */
}

.tech-tag {
    background-color: var(--crimson);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.project-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap; /* Allow links to wrap on small screens */
    margin-top: 1.5rem;
}

.project-link {
    color: var(--charcoal);
    text-decoration: none;
    padding: 0.5rem 1.5rem;
    border: 2px solid var(--crimson);
    border-radius: 25px;
    transition: all 0.3s ease;
}

.project-link:hover {
    background-color: var(--crimson);
    color: white;
    transform: translateY(-2px);
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--crimson);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease; /* Optimized: specific properties */
    z-index: 10;
    will-change: transform; /* Performance hint */
}

.carousel-btn:hover {
    background-color: #B01030;
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn-prev {
    left: -25px;
}

.carousel-btn-next {
    right: -25px;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--medium-gray);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    background-color: var(--crimson);
    transform: scale(1.3);
}

/* ===================================
   Modal
   =================================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-content {
    background-color: white;
    border-radius: 15px;
    max-width: 900px;
    width: 100%;
    position: relative;
    animation: slideUp 0.3s ease;
    max-height: 90vh;
    overflow: hidden; /* Hide overflow on modal-content itself */
    border: 1px solid var(--light-gray);
    display: flex;
    flex-direction: column;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: var(--crimson);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    z-index: 10;
}

.modal-close:hover {
    background-color: #B01030;
    transform: rotate(90deg);
}

#modalBody {
    padding: 2rem;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
    will-change: opacity; /* Performance hint for fade transitions */
    overflow-y: auto; /* Enable vertical scrolling for modal content */
    overflow-x: hidden; /* Prevent horizontal scrolling */
    max-height: calc(90vh - 4rem); /* Account for padding */
}

#modalBody.fade-out {
    opacity: 0;
}

.modal-project-image {
    width: 100%;
    height: 400px;
    max-height: 40vh; /* Limit image height to 40% of viewport */
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 2rem;
    flex-shrink: 0; /* Prevent image from shrinking */
}

/* ===================================
   Resume Section
   =================================== */
.coming-soon {
    text-align: center;
    padding: 4rem 2rem;
}

.coming-soon i {
    color: var(--crimson);
    margin-bottom: 2rem;
}

.coming-soon h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.coming-soon p {
    font-size: 1.2rem;
    color: var(--charcoal-lighter);
}

/* ===================================
   Contact Grid
   =================================== */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
    max-width: 1300px;
    margin: 0 auto;
}

.contact-card {
    background-color: white;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid var(--light-gray);
    box-shadow: 0 2px 8px var(--shadow);
}

.contact-card:hover {
    transform: translateY(-10px);
    border-color: var(--crimson);
    box-shadow: 0 10px 30px rgba(220, 20, 60, 0.3);
}

.contact-icon {
    font-size: 3rem;
    color: var(--crimson);
    margin-bottom: 1rem;
}

.contact-label {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 0.5rem;
}

.contact-value {
    color: var(--charcoal-light);
    word-break: break-word;
}

.contact-link {
    color: var(--charcoal);
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-link:hover {
    color: var(--crimson);
}

/* ===================================
   Resume Section
   =================================== */
.resume-section {
    background-color: var(--rice-white);
}

.resume-content {
    display: block;
    animation: fadeIn 0.5s ease;
}

/* Resume Toggle Control - iOS-style Switch */
.resume-toggle-control {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    padding: 1rem;
}

.toggle-switch-label {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    user-select: none;
    font-size: 1rem;
    font-weight: 600;
    color: var(--charcoal);
}

.toggle-label-text {
    order: 1;
}

.toggle-switch {
    order: 2;
    position: relative;
    width: 60px;
    height: 34px;
}

.toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 34px;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Active state - crimson color */
.toggle-input:checked + .toggle-slider {
    background-color: var(--crimson);
    box-shadow: inset 0 2px 4px rgba(220, 20, 60, 0.2);
}

.toggle-input:checked + .toggle-slider:before {
    transform: translateX(26px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Focus state for accessibility */
.toggle-input:focus + .toggle-slider {
    outline: 2px solid var(--crimson);
    outline-offset: 2px;
}

/* Hover effect */
.toggle-switch-label:hover .toggle-slider {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 0 0 3px rgba(220, 20, 60, 0.1);
}

.toggle-switch-label:hover .toggle-input:checked + .toggle-slider {
    box-shadow: inset 0 2px 4px rgba(220, 20, 60, 0.3), 0 0 0 3px rgba(220, 20, 60, 0.1);
}

/* Active feedback animation */
.toggle-switch-label.toggle-active {
    transform: scale(1.02);
    transition: transform 0.2s ease;
}

.toggle-switch-label.toggle-active .toggle-label-text {
    color: var(--crimson);
    transition: color 0.2s ease;
}

/* Timeline Columns Container */
.timeline-columns {
    display: flex;
    justify-content: space-between;
    gap: clamp(40px, 5vw, 80px);
    position: relative;
}

.timeline-columns::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--crimson), var(--medium-gray));
    transform: translateX(-50%);
    z-index: 1;
}

/* Timeline Styles - Centered with Fluid Card Scaling */
.timeline {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    min-height: 400px;
}

.timeline-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 600px; /* Maximum width for readability */
    min-width: 300px; /* Minimum width to prevent too narrow cards */
}

.timeline-column-left {
    align-items: flex-end;
}

.timeline-column-right {
    align-items: flex-start;
}

/* Column Headers - No underline */
.timeline-column-header {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--charcoal);
    margin-bottom: 2rem;
    width: 100%; /* Fluid width matching card width */
}

.timeline-column-left .timeline-column-header {
    text-align: right;
}

.timeline-column-right .timeline-column-header {
    text-align: left;
}

/* Fluid Card Width - Scales continuously with viewport */
.timeline-item {
    position: relative;
    width: 100%; /* Fill column width */
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: slideUp 0.4s ease forwards;
}

/* Work items on LEFT side - stacked */
.timeline-item.work {
    text-align: right;
    margin-right: clamp(20px, 2vw, 30px); /* Fluid margin */
}

/* Study and Certificate items on RIGHT side - stacked */
.timeline-item.study,
.timeline-item.certificate {
    text-align: left;
    margin-left: clamp(20px, 2vw, 30px); /* Fluid margin */
}

/* Timeline Year Label - Positioned above timeline dot */
.timeline-year-label {
    display: none; /* Hide year labels */
    position: absolute;
    top: 0; /* Positioned above dot (dot top: 20px - label height - small gap) */
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--crimson);
    opacity: 0.25;
    z-index: 4;
    white-space: nowrap;
    line-height: 1;
}

/* Timeline Dot - Centered and compact with fluid positioning */
.timeline-dot {
    position: absolute;
    top: 20px;
    width: 12px;
    height: 12px;
    background-color: var(--crimson);
    border: 3px solid var(--rice-white);
    border-radius: 50%;
    z-index: 3;
    box-shadow: 0 0 0 2px rgba(220, 20, 60, 0.2);
}

/* Position year labels for work items (left side) - right aligned */
.timeline-item.work .timeline-year-label {
    right: calc(clamp(20px, 2vw, 30px) * -1 - 6px);
    left: auto;
    transform: translateX(50%); /* Right-align the text */
}

/* Position year labels for study/certificate items (right side) - left aligned */
.timeline-item.study .timeline-year-label,
.timeline-item.certificate .timeline-year-label {
    left: calc(clamp(20px, 2vw, 30px) * -1 - 6px);
    right: auto;
    transform: translateX(-50%); /* Left-align the text */
}

/* Position dots for work items (left side) - fluid positioning */
.timeline-item.work .timeline-dot {
    right: calc(clamp(20px, 2vw, 30px) * -1 - 6px);
}

/* Position dots for study/certificate items (right side) - fluid positioning */
.timeline-item.study .timeline-dot,
.timeline-item.certificate .timeline-dot {
    left: calc(clamp(20px, 2vw, 30px) * -1 - 6px);
}

.timeline-item.current .timeline-dot {
    width: 14px;
    height: 14px;
    background-color: var(--crimson);
    box-shadow: 0 0 0 3px rgba(220, 20, 60, 0.3), 0 0 10px rgba(220, 20, 60, 0.4);
    animation: pulse 2s infinite;
}

/* Horizontal Connector Lines - fluid width matching margins */
.timeline-connector {
    position: absolute;
    top: 26px;
    height: 2px;
    background-color: var(--crimson);
    opacity: 0.4;
    z-index: 2;
}

/* Connector for work items (left side) - extends from dot to card */
.timeline-item.work .timeline-connector {
    right: calc(clamp(20px, 2vw, 30px) * -1);
    width: clamp(20px, 2vw, 30px);
}

/* Connector for study/certificate items (right side) - extends from dot to card */
.timeline-item.study .timeline-connector,
.timeline-item.certificate .timeline-connector {
    left: calc(clamp(20px, 2vw, 30px) * -1);
    width: clamp(20px, 2vw, 30px);
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(220, 20, 60, 0.3), 0 0 10px rgba(220, 20, 60, 0.4);
    }
    50% {
        box-shadow: 0 0 0 5px rgba(220, 20, 60, 0.2), 0 0 15px rgba(220, 20, 60, 0.5);
    }
}

/* Resume Card - Compact Design */
.resume-card {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px var(--shadow);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch; /* Allow children to stretch to full height */
    overflow: hidden; /* Allow content to expand beyond card bounds */
    min-height: 80px;
}

/* Border styling based on type */
.timeline-item.work .resume-card {
    border-right: 3px solid var(--crimson);
}

.timeline-item.study .resume-card,
.timeline-item.certificate .resume-card {
    border-left: 3px solid var(--crimson);
}

.resume-card:hover {
    box-shadow: 0 4px 15px var(--shadow-dark);
    /* Remove align-items change to prevent content shifting */
}

/* Organization Icon Container */
.organization-icon-container {
    width: 50px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px var(--shadow);
    background-color: var(--light-gray);
    border-radius: 0;
    transition: all 0.4s linear;
    margin: 0;
    overflow: hidden;
    /* Use padding instead of margin to avoid layout shifts */
    padding: 0;
}

.work .organization-icon-container {
    border-radius: 0 10px 10px 0;
}

.study .organization-icon-container {
    border-radius: 10px 0 0 10px;
}

/* Organization Icon Image */
.organization-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Fallback styling when image fails to load */
.organization-icon-container.icon-fallback {
    background-color: var(--charcoal-lighter);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.organization-icon-container.icon-fallback::before {
    content: attr(data-fallback-text);
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    text-transform: uppercase;
    line-height: 1;
}

/* Work items (left side) - icon on the right (towards center) */
.timeline-item.work .organization-icon-container {
    order: 2;
}

.timeline-item.work .resume-card-title {
    order: 1;
}

/* Study/Certificate items (right side) - icon on the left (towards center) */
.timeline-item.study .organization-icon-container,
.timeline-item.certificate .organization-icon-container {
    order: 1;
}

.timeline-item.study .resume-card-title,
.timeline-item.certificate .resume-card-title {
    order: 2;
}

.resume-card-header {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    margin-bottom: 0; /* No margin by default */
}

/* Remove header bottom padding when content is expanded or on hover */
.resume-card:hover .resume-card-header,
.resume-card.expand-all-active .resume-card-header {
    padding-bottom: 0;
}

.resume-card-title {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: start;
    padding: 1.25rem;
}

/* Resume Card Content Container */
.resume-card-content {
    flex: 1;
    padding: 0 2.5rem;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Add bottom padding only when content is expanded or on hover */
.resume-card:hover .resume-card-content,
.resume-card.expand-all-active .resume-card-content {
    padding-bottom: 1.25rem;
}

/* Work items (left side) - text aligned right */
.timeline-item.work .resume-card-content {
    text-align: right;
}

/* Study/Certificate items (right side) - text aligned left */
.timeline-item.study .resume-card-content,
.timeline-item.certificate .resume-card-content {
    text-align: left;
}

/* Expandable Content */
.resume-card-expandable {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out, opacity 0.3s ease;
    opacity: 0;
    margin: 0; /* Ensure no margin in collapsed state */
    padding: 0; /* Ensure no padding in collapsed state */
}

.resume-card-expandable.expanded {
    max-height: 1200px; /* Significantly increased to accommodate longer content */
    opacity: 1;
    padding: 0; /* Keep padding at 0, let child elements handle their own spacing */
}

/* Ensure expanded content is fully visible during hover and toggle states */
.resume-card:hover .resume-card-expandable,
.resume-card.expand-all-active .resume-card-expandable {
    max-height: 1200px;
    opacity: 1;
}

/* Organization Icon Container Expanded State - Square Shape */
.resume-card:hover .organization-icon-container,
.resume-card.expand-all-active .organization-icon-container,
.resume-card.mobile-expanded .organization-icon-container {
    height: 60px; /* Only change height to make it square, keep width same */
    width: 60px;
    margin-top: 15px;
    border-radius: 10px;
    /* Remove width and padding changes to prevent layout shifts */
}

.work .resume-card:hover .organization-icon-container,
.work .resume-card.expand-all-active .organization-icon-container,
.work .resume-card.mobile-expanded .organization-icon-container {
    margin-left: 0;
    margin-right: 15px;
}

.study .resume-card:hover .organization-icon-container,
.study .resume-card.expand-all-active .organization-icon-container,
.study .resume-card.mobile-expanded .organization-icon-container {
    margin-left: 15px;
    margin-right: 0;
}

.resume-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--charcoal);
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.resume-organization {
    font-size: 1rem;
    color: var(--crimson);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

/* Date and Location on Same Line */
.resume-date-location {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    color: var(--charcoal-lighter);
    font-size: 0.85rem;
    margin: 0 0 0.5rem 0;
}

/* Add margin only when content is expanded */
.resume-card-expandable.expanded .resume-date-location {
}

/* Work items (left side) - align right */
.timeline-item.work .resume-date-location {
    justify-content: flex-end;
}

/* Study/Certificate items (right side) - align left */
.timeline-item.study .resume-date-location,
.timeline-item.certificate .resume-date-location {
    justify-content: flex-start;
}

.resume-date {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.resume-date i {
    color: var(--crimson);
    font-size: 0.8rem;
}

.current-badge {
    display: inline-block;
    background-color: var(--crimson);
    color: white;
    padding: 0.15rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 0.3rem;
}

.resume-location-separator {
    color: var(--medium-gray);
    font-weight: bold;
    font-size: 1rem;
}

.resume-location {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--charcoal-lighter);
    font-size: 0.85rem;
}

.resume-location i {
    color: var(--crimson);
    font-size: 0.8rem;
}

.resume-description {
    color: var(--charcoal-light);
    line-height: 1.6;
    margin: 0; /* Remove default margin */
    font-size: 0.9rem;
}

/* Add margin only when content is expanded */
.resume-card-expandable.expanded .resume-description {
    margin-bottom: 1rem;
}

/* Description always left-aligned for readability */
.resume-description {
    text-align: justify !important;
}

.resume-description h1,
.resume-description h2,
.resume-description h3 {
    color: var(--charcoal);
    margin-top: 0.8rem;
    margin-bottom: 0.4rem;
    font-size: 1rem;
}

.resume-description strong {
    color: var(--charcoal);
    font-weight: 600;
}

.resume-description ul {
    margin: 0.4rem 0;
    padding-left: 1.5rem;
}

.resume-description li {
    margin-bottom: 0.2rem;
}

.resume-description a {
    color: var(--crimson);
    text-decoration: none;
    font-weight: 600;
}

.resume-description a:hover {
    text-decoration: underline;
}

.resume-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

/* Work items (left side) - align tags right */
.timeline-item.work .resume-tags {
    justify-content: flex-end;
}

/* Study/Certificate items (right side) - align tags left */
.timeline-item.study .resume-tags,
.timeline-item.certificate .resume-tags {
    justify-content: flex-start;
}

.resume-tag {
    background-color: var(--light-gray);
    color: var(--charcoal);
    padding: 0.3rem 0.7rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.resume-tag:hover {
    background-color: var(--crimson);
    color: white;
    transform: translateY(-2px);
}

/* ===================================
   Certificate Cards - Simplified Design
   =================================== */

/* Certificate card styling - crimson background, title only */
.certificate-card {
    background-color: var(--crimson) !important;
    border: none !important;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(220, 20, 60, 0.3);
    transition: all 0.3s ease;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.certificate-card:hover {
    box-shadow: 0 6px 20px rgba(220, 20, 60, 0.4);
}

.certificate-content {
    padding: 1rem 1.5rem;
    text-align: left;
    width: 100%;
}

.certificate-title {
    color: white;
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.certificate-icon {
    font-size: 1rem;
    color: white;
    flex-shrink: 0;
}

/* Remove organization icon for certificate cards */
.timeline-item.certificate .organization-icon-container {
    display: none;
}

/* Ensure certificate cards don't have expandable content */
.timeline-item.certificate .resume-card-expandable {
    display: none;
}

/* Certificate timeline dot styling */
.timeline-item.certificate .timeline-dot {
    background-color: var(--crimson);
    border: 3px solid white;
    box-shadow: 0 0 0 2px var(--crimson);
}

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

.footer p {
    margin: 0.5rem 0;
}

.footer-tagline {
    font-size: 0.9rem;
}

/* ===================================
   Loading Spinner
   =================================== */
.loading-spinner {
    text-align: center;
    padding: 3rem;
    color: var(--crimson);
}

.loading-spinner p {
    margin-top: 1rem;
    color: var(--charcoal-lighter);
}

/* ===================================
   Animations
   =================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-20px);
    }
    60% {
        transform: translateX(-50%) translateY(-10px);
    }
}

.animate-fade-in {
    animation: fadeIn 1s ease;
}

.animate-fade-in-delay {
    animation: fadeIn 1s ease 0.3s both;
}

.animate-fade-in-delay-2 {
    animation: fadeIn 1s ease 0.6s both;
}

/* Scroll-triggered animations */
.fade-in-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===================================
   Country Tooltip
   =================================== */
.country-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    transform: translateY(2px) scale(0.8);
    transition: opacity 0.2s ease, transform 0.2s ease, width 0.25s ease;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    max-width: none;
    min-width: fit-content;
    overflow: hidden;
}

.country-tooltip.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.country-tooltip.updating {
    transform: translateY(0) scale(0.9);
    transition: transform 0.1s ease;
}

.country-tooltip .flag {
    font-size: 0.7em !important;
    margin-right: 6px;
    display: inline-block;
}

/* Twemoji flag images in tooltip */
.country-tooltip .flag img.emoji {
    width: 20px !important;
    height: 20px !important;
    vertical-align: middle;
    margin-right: 4px;
}

.country-tooltip .name {
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-block;
    vertical-align: middle;
}

/* ===================================
   Responsive Design
   =================================== */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .hero-title {
        font-size: 2.5rem;
    }

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

    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 0.5rem;
    }

    .carousel-btn-prev {
        left: -15px;
    }

    .carousel-btn-next {
        right: -15px;
    }
}

/* Tablet/Small Laptop (769px - 1024px) - Minor adjustments for smaller screens */
@media (max-width: 1024px) {
    .timeline {
        padding: 1rem 1rem;
    }

    /* Toggle switch tablet adjustments */
    .resume-toggle-control {
        margin-bottom: 1.75rem;
    }

    .toggle-switch-label {
        font-size: 0.95rem;
    }

    .timeline-column-header {
        font-size: 1.3rem;
    }

    .organization-icon-container {
        width: 60px;
    }

    /* Tablet hover state - same square behavior as desktop */
    .resume-card:hover .organization-icon-container,
    .resume-card.expand-all-active .organization-icon-container,
    .resume-card.mobile-expanded .organization-icon-container {
        height: 45px; /* Square shape on hover (60px width, 45px height for tablet) */
        width: 45px;
        margin-top: 7px;
        margin-inline: 7px;
        border-radius: 6px;
    }

    .resume-title {
        font-size: 1.1rem;
    }

}

/* ===================================
   Languages Section
   =================================== */
.languages-section {
    background-color: var(--warm-white);
}

/* Make container full-width when it contains infinite scroll carousel */
.languages-section .container.infinite-scroll-parent {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.language-carousel-container {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 60px;
    overflow: hidden; /* Hide overflow for infinite scroll */
}

/* Remove all padding and make full-width when infinite scroll is active */
.language-carousel-container.infinite-scroll-active {
    padding: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
}

.language-carousel {
    display: flex;
    gap: 2rem;
    overflow: hidden;
    scroll-behavior: smooth;
    padding: 2rem 0;
}

/* Infinite Carousel Animation */
.language-carousel.infinite-scroll {
    display: flex;
    gap: 2rem;
    animation: infiniteScroll 60s linear infinite;
    width: max-content;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Pause animation on hover to allow users to read */
.language-carousel.infinite-scroll:hover {
    animation-play-state: paused;
}

/* When dragging, completely disable animation so manual transform works */
.language-carousel.infinite-scroll.dragging {
    cursor: grabbing;
    animation: none !important; /* Completely disable animation during drag */
}

.language-carousel.infinite-scroll.paused {
    animation: none !important; /* Completely disable animation when paused */
}

@keyframes infiniteScroll {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

.language-card {
    flex: 0 0 calc(20% - 1.6rem); /* Show 5 cards */
    min-width: 220px;
    background: white;
    border-radius: 15px;
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: 0 4px 15px var(--shadow);
    transition: all 0.3s ease;
    border-top: 4px solid var(--crimson);
}

/* Language card for infinite scroll */
.language-carousel.infinite-scroll .language-card {
    flex: 0 0 280px;
    min-width: 280px;
}

/* Disable hover effect on cards when in infinite scroll mode */
.language-carousel.infinite-scroll .language-card:hover {
    transform: none;
    box-shadow: 0 4px 15px var(--shadow);
}

/* Only allow hover effect when carousel is paused/dragging */
.language-carousel.infinite-scroll.paused .language-card:hover,
.language-carousel.infinite-scroll.dragging .language-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px var(--shadow-dark);
}

.language-card.has-accent {
    border-top-color: var(--accent-color, var(--crimson));
}

.language-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 25px var(--shadow-dark);
}

.language-flag {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
    line-height: 1;
}

.language-flag img {
    width: 80px !important;
    height: 80px !important;
    object-fit: contain;
    border-radius: 5px;
    display: inline-block;
}

/* Twemoji emoji images */
.language-flag img.emoji {
    width: 80px !important;
    height: 80px !important;
    vertical-align: middle;
}

.language-name {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--charcoal);
    margin-bottom: 0.5rem;
}

.language-native-name {
    font-size: 1.1rem;
    color: var(--charcoal-lighter);
    margin-bottom: 1rem;
    font-style: italic;
}

.language-proficiency {
    margin: 1rem 0;
}

.proficiency-stars {
    color: var(--crimson);
    font-size: 1.3rem;
    letter-spacing: 3px;
}

.proficiency-stars.has-accent {
    color: var(--accent-color, var(--crimson));
}

.language-certification {
    font-size: 0.9rem;
    color: var(--charcoal-lighter);
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--light-gray);
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--crimson);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.carousel-nav:hover {
    background: var(--charcoal);
    transform: translateY(-50%) scale(1.1);
}

.carousel-prev {
    left: 0;
}

.carousel-next {
    right: 0;
}

.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 2rem;
}

.carousel-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--light-gray);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-indicator.active {
    background: var(--crimson);
    width: 30px;
    border-radius: 6px;
}

/* ===================================
   Travels Section
   =================================== */
.travels-section {
    background-color: var(--rice-white);
}

.world-map-container {
    max-width: 1200px;
    margin: 0 auto 3rem;
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 20px var(--shadow);
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.world-map-container svg {
    width: 100%;
    height: auto;
    max-height: 600px;
}



.travel-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.stat-item {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 15px var(--shadow);
    transition: all 0.3s ease;
    border-top: 4px solid var(--crimson);
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--shadow-dark);
}

.stat-item i {
    font-size: 3rem;
    color: var(--crimson);
    margin-bottom: 1rem;
}

.stat-item h3 {
    font-size: 3rem;
    font-weight: bold;
    color: var(--charcoal);
    margin-bottom: 0.5rem;
}

.stat-item p {
    font-size: 1.1rem;
    color: var(--charcoal-lighter);
    margin: 0;
}

/* Mobile (<768px) */
@media (max-width: 768px) {
    /* Extend hero and sections beyond safe area on mobile */
    .hero-section {
        height: 100dvh; /* Use dynamic viewport height to extend beyond safe area */
    }

    .section {
        min-height: 100dvh; /* Use dynamic viewport height to extend beyond safe area */
        padding: 3rem 0;
    }

    /* Navigation */
    .navbar {
        padding: 1rem;
    }

    /* Hero Section */
    .hero-title {
        font-size: 2rem;
    }

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

    .btn-hero {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }

    /* Disable parallax on mobile for performance */
    .hero-image,
    .hero-content {
        transform: none !important;
        will-change: auto !important;
    }

    .hero-image {
        height: 100% !important; /* Reset height on mobile */
    }

    .hero-content {
        opacity: 1 !important; /* Ensure content is always visible on mobile */
    }

    /* Section Titles */
    .section-title {
        font-size: 2rem;
    }

    /* Skills Grid - Horizontal Layout */
    .skills-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .skill-card {
        /* Change to horizontal inline layout for mobile */
        aspect-ratio: auto; /* Remove square constraint */
        flex-direction: row; /* Horizontal layout */
        flex-grow: 1;
        justify-content: flex-start; /* Align to left */
        text-align: left; /* Left-align text */
        padding: 0.75rem 1rem; /* Adjust padding for horizontal layout */
        gap: 0.5rem; /* Space between icon and text */
        transform: none; /* Ensure no hover effects on mobile */
    }

    .skill-card .skill-icon {
        font-size: 1.75rem; /* Adjust icon size for horizontal layout */
        margin-bottom: 0; /* Remove bottom margin */
        flex-shrink: 0; /* Prevent icon from shrinking */
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .skill-card .skill-icon .custom-svg {
        width: 1.75rem;
        height: 1.75rem;
        display: block;
    }

    .skill-card .skill-name {
        font-size: 1rem; /* Adjust text size */
        white-space: normal; /* Allow text to wrap if needed */
        text-overflow: clip; /* Remove ellipsis */
        max-width: none; /* Remove max-width constraint */
        padding: 0; /* Remove padding */
    }

    /* Disable tap/press interactions on skill cards for mobile */
    .skill-card {
        pointer-events: none; /* Disable all touch interactions */
        cursor: default; /* Remove pointer cursor */
    }

    .skill-card:hover,
    .skill-card:active,
    .skill-card.user-interacted {
        transform: none !important; /* Remove any transform effects */
        box-shadow: 0 2px 8px var(--shadow) !important; /* Keep default shadow only */
    }

    /* Projects */
    .project-card {
        height: 400px; /* Reduced height for mobile */
    }

    .project-image-container {
        height: 66.67%; /* Maintain 2/3 ratio on mobile */
    }

    .project-info {
        padding: 1.5rem;
    }

    .project-title {
        font-size: 1.4rem;
    }

    .project-description {
        -webkit-line-clamp: 3; /* Limit to 3 lines on mobile */
    }

    /* Carousel */
    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }

    .carousel-btn-prev {
        left: 5px;
    }

    .carousel-btn-next {
        right: 5px;
    }

    /* Hide carousel navigation arrows on mobile */
    .carousel-btn-prev,
    .carousel-btn-next {
        display: none;
    }

    /* Contact */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Resume - Mobile Timeline */
    .timeline {
        padding: 1rem 0;
        flex-direction: column;
        gap: 0;
    }

    .timeline::before {
        left: 30px; /* Move timeline to left on mobile */
    }

    .timeline-column {
        width: 100%;
        max-width: none; /* Remove max-width constraint on mobile */
        min-width: 0; /* Remove min-width constraint on mobile */
        align-items: flex-start !important;
    }

    /* Toggle switch responsive adjustments */
    .resume-toggle-control {
        margin-bottom: 1.5rem;
        padding: 0.5rem;
    }

    .toggle-switch-label {
        font-size: 0.9rem;
        gap: 0.75rem;
    }

    .toggle-switch {
        width: 50px;
        height: 28px;
    }

    .toggle-slider:before {
        height: 22px;
        width: 22px;
        left: 3px;
        bottom: 3px;
    }

    .toggle-input:checked + .toggle-slider:before {
        transform: translateX(22px);
    }

    /* Timeline columns mobile layout */
    .timeline-columns {
        flex-direction: column;
        gap: 0;
    }

    .timeline-columns::before {
        left: 30px;
        transform: none;
    }

    .timeline-column-header {
        width: 100%;
        text-align: center !important;
        font-size: 1.3rem;
        margin-bottom: 1.5rem;
        padding-left: 70px;
    }

    .timeline-item {
        width: 100% !important;
        padding-left: 70px !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        text-align: left !important;
    }

    .timeline-year-label {
        left: 30px !important;
        right: auto !important;
        transform: translateX(-50%);
    }

    .timeline-dot {
        left: 30px !important;
        right: auto !important;
        transform: translateX(-50%);
    }

    .timeline-connector {
        display: none; /* Hide horizontal connectors on mobile */
    }

    /* Hide timeline elements on mobile */
    .timeline-columns::before {
        display: none; /* Hide vertical timeline line */
    }

    .timeline-dot {
        display: none; /* Hide timeline dots */
    }

    .timeline-year-label {
        display: none; /* Hide 2-digit year labels */
    }

    /* Extend resume cards to full width on mobile */
    .timeline-item {
        padding-left: 0 !important; /* Remove left padding to extend cards to full width */
    }

    .timeline-column-header {
        padding-left: 0; /* Remove left padding from headers as well */
    }

    .resume-card-header {
        flex-direction: row !important;
        text-align: left !important;
    }

    .organization-icon-container {
        width: 50px;
    }

    .resume-title {
        font-size: 1.2rem;
    }

    .resume-organization {
        font-size: 1rem;
    }

    .resume-date-location {
        justify-content: flex-start !important;
        font-size: 0.85rem;
    }

    .resume-date,
    .resume-location {
        font-size: 0.85rem;
    }

    .resume-tags {
        justify-content: flex-start !important;
    }

    .resume-tag {
        font-size: 0.75rem;
        padding: 0.3rem 0.7rem;
    }

    /* Mobile Resume Card Interactions */
    .resume-card {
        border-left: 3px solid var(--crimson);
        border-right: 3px solid var(--crimson);
        cursor: pointer; /* Show pointer cursor on mobile for tap indication */
        touch-action: manipulation; /* Remove 300ms click delay on mobile */
    }

    /* Ensure smooth transitions on mobile */
    .resume-card-expandable {
        transition: max-height 0.4s ease-in-out, opacity 0.3s ease;
    }

    /* Add subtle tap feedback for mobile */
    .resume-card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    /* Certificate cards mobile adjustments */
    .certificate-card {
        min-height: 50px;
    }

    .certificate-content {
        padding: 0.75rem 1rem;
    }

    .certificate-title {
        font-size: 0.9rem;
        gap: 0.4rem;
    }

    .certificate-icon {
        font-size: 0.9rem;
    }

    /* Fallback icon text mobile adjustments */
    .organization-icon-container.icon-fallback::before {
        font-size: 1rem;
    }
    
    /* Modal */
    .modal-overlay.active {
        padding: 1rem; /* Reduce padding on mobile */
    }

    .modal-content {
        margin: 0;
        max-height: 95vh; /* Increase max height on mobile */
    }

    #modalBody {
        padding: 1.5rem; /* Reduce padding on mobile */
        max-height: calc(95vh - 3rem); /* Adjust for reduced padding */
    }

    .modal-project-image {
        height: 250px;
        max-height: 30vh; /* Reduce image height on mobile */
    }

    .modal-close {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }

    /* Languages Section - Mobile */
    .language-carousel-container {
        padding: 0 50px;
    }

    /* Keep full-width for infinite scroll on mobile */
    .language-carousel-container.infinite-scroll-active {
        padding: 0 !important;
    }

    .language-card {
        flex: 0 0 calc(50% - 1rem); /* Show 2 cards on tablet */
        min-width: 180px;
    }

    .carousel-nav {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    /* Travels Section - Mobile */
    .world-map-container {
        padding: 1rem;
        min-height: 400px;
    }

    .travel-stats {
        gap: 1rem;
    }

    .stat-item {
        padding: 1.5rem;
    }

    .stat-item i {
        font-size: 2.5rem;
    }

    .stat-item h3 {
        font-size: 2.5rem;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .hero-title {
        font-size: 1.5rem;
    }

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

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

    .section-subtitle {
        font-size: 1rem;
    }

    /* Languages Section - Extra Small */
    .language-carousel-container {
        padding: 0 40px;
    }

    /* Keep full-width for infinite scroll on extra small screens */
    .language-carousel-container.infinite-scroll-active {
        padding: 0 !important;
    }

    .language-card {
        flex: 0 0 100%; /* Show 1 card on mobile */
        min-width: 100%;
    }

    .language-name {
        font-size: 1.2rem;
    }

    .language-native-name {
        font-size: 1rem;
    }

    .carousel-nav {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }

    /* Travels Section - Extra Small */
    .world-map-container {
        padding: 0.5rem;
        min-height: 300px;
    }

    .stat-item {
        padding: 1rem;
    }

    .stat-item i {
        font-size: 2rem;
    }

    .stat-item h3 {
        font-size: 2rem;
    }

    .stat-item p {
        font-size: 1rem;
    }
}
