/* ===== CSS VARIABLES ===== */
:root {
    /* Light Theme Colors */
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --secondary-color: #64748b;
    --accent-color: #f59e0b;
    
    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    
    /* Text Colors */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    
    /* Border Colors */
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    
    /* Shadow */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Spacing - Mobile First Approach */
    --section-padding: 3rem 0; /* Start with mobile spacing */
    --container-padding: 0 1rem; /* Mobile-first padding */
    --nav-height: 60px; /* Smaller nav for mobile */
    
    /* Mobile-specific spacing */
    --mobile-section-padding: 2rem 0;
    --mobile-container-padding: 0 1rem;
    --mobile-nav-height: 55px;
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    --font-size-5xl: 3rem;
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 300ms ease-in-out;
    --transition-slow: 500ms ease-in-out;
}

/* Dark Theme Colors */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-light: #94a3b8;
    
    --border-color: #334155;
    --border-light: #475569;
}

/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px; /* Base font size for mobile */
    -webkit-text-size-adjust: 100%; /* Prevent iOS font scaling */
    -ms-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color var(--transition-normal), color var(--transition-normal);
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Prevent horizontal scroll */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-fast);
}

ul {
    list-style: none;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

/* ===== UTILITY CLASSES ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--container-padding);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem; /* Larger padding for mobile */
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: var(--font-size-base);
    text-decoration: none;
    transition: all var(--transition-fast);
    cursor: pointer;
    border: 2px solid transparent;
    min-height: 44px; /* iOS recommended touch target */
    min-width: 120px;
    width: 100%; /* Full width on mobile */
    max-width: 280px; /* Constrain maximum width */
    text-align: center;
    box-sizing: border-box;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: var(--font-size-4xl);
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.section-description {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.highlight {
    color: var(--primary-color);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* All elements are visible by default - NO FLASH */
.animate-on-scroll {
    opacity: 1;
    transform: translateY(0);
}

/* Only prepare elements for animation when IntersectionObserver is confirmed working */
.intersection-observer-supported .animate-on-scroll:not(.animated) {
    opacity: 0.3;
    transform: translateY(20px);
}

/* ===== NAVIGATION ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-primary);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: all var(--transition-normal);
    border-bottom: 1px solid var(--border-color);
    width: 100%; /* Ensure full width on mobile */
}

/* Mobile-first navigation styles */
.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--nav-height);
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--container-padding);
    position: relative;
}

.nav-logo a {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

/* Mobile menu by default */
.nav-menu {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background-color: var(--bg-primary);
    flex-direction: column;
    padding: 2rem var(--container-padding);
    box-shadow: var(--shadow-lg);
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
    border-top: 1px solid var(--border-color);
    z-index: 999;
    max-height: calc(100vh - var(--nav-height));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-menu.active {
    transform: translateX(0);
}

.nav-item {
    margin-bottom: 0.5rem;
    width: 100%;
}

.nav-link {
    display: block;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 1rem 0;
    position: relative;
    transition: color var(--transition-fast);
    text-decoration: none;
    font-size: var(--font-size-base);
    border-bottom: 1px solid var(--border-light);
    text-align: left;
    width: 100%;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width var(--transition-fast);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Theme toggle - mobile optimized */
.theme-toggle {
    padding: 0.75rem;
    border-radius: 0.375rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    margin-left: 1rem;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background-color: var(--bg-secondary);
    color: var(--primary-color);
}

/* Hamburger menu - visible by default on mobile */
.hamburger {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    padding: 0.75rem;
    z-index: 1001;
    border-radius: 0.25rem;
    transition: background-color 0.2s ease;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}

.hamburger:active {
    background-color: var(--bg-secondary);
}

.hamburger span {
    width: 22px;
    height: 2px;
    background-color: var(--text-primary);
    margin: 2px 0;
    transition: all var(--transition-fast);
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-4px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-4px, -5px);
}

.navbar.scrolled {
    box-shadow: var(--shadow-md);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--nav-height);
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--container-padding);
}

.nav-logo a {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    font-weight: 500;
    color: var(--text-secondary);
    padding: 0.5rem 0;
    position: relative;
    transition: color var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width var(--transition-fast);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.theme-toggle {
    padding: 0.5rem;
    border-radius: 0.375rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    margin-left: 1rem;
}

.theme-toggle:hover {
    background-color: var(--bg-secondary);
    color: var(--primary-color);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    margin: 3px 0;
    transition: all var(--transition-fast);
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* ===== HERO SECTION ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: var(--section-padding);
    padding-top: calc(var(--nav-height) + 2rem);
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    position: relative;
    overflow: hidden;
}

/* Mobile-first: single column layout */
.hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
    width: 100%;
}

/* Profile Image Section */
.hero-profile-image {
    order: 1; /* Show image first on mobile */
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
}

.profile-container {
    position: relative;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 5px solid var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    transition: all 0.3s ease;
}

.profile-container:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15);
}

.profile-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.profile-photo:hover {
    transform: scale(1.05);
}

/* Fallback image placeholder */
.profile-container .image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    color: white;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
}

/* Content Section */
.hero-content {
    order: 2; /* Show content second on mobile */
    text-align: center;
}

.brand-info {
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: var(--font-size-3xl); /* Smaller for mobile */
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    word-wrap: break-word;
    hyphens: auto;
    color: var(--text-primary);
}

.brand-name {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-style: italic;
}

.brand-highlight {
    color: var(--primary-color);
    font-weight: 600;
    font-style: normal;
}

.hero-subtitle {
    font-size: var(--font-size-xl);
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.7;
    max-width: 100%;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* Resume Button Specific Styles */
.btn-resume {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    position: relative;
    overflow: hidden;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.btn-resume::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn-resume:hover::before {
    left: 100%;
}

.btn-resume:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

.btn-resume:active {
    transform: translateY(-1px);
}

.btn-resume i {
    margin-right: 0.5rem;
    font-size: 0.9rem;
}

/* Outline Button Style */
.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-placeholder {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 120px;
    color: white;
    box-shadow: var(--shadow-xl);
}

/* ===== ABOUT SECTION ===== */
.about {
    padding: var(--section-padding);
    background-color: var(--bg-secondary);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr; /* Single column for mobile */
    gap: 2rem;
    align-items: center;
    text-align: center; /* Center content on mobile */
}

.about-profile-photo {
    width: 250px;
    height: 250px;
    border-radius: 1rem;
    object-fit: cover;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 3px solid rgba(255, 255, 255, 0.8);
}

.about-profile-photo:hover {
    transform: scale(1.05) rotateZ(2deg);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.about-image .image-placeholder {
    width: 250px;
    height: 250px;
    border-radius: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
}

.about-text h3 {
    font-size: var(--font-size-2xl);
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.about-text p {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.about-stats {
    display: grid;
    grid-template-columns: 1fr; /* Single column for mobile */
    gap: 1rem;
    margin-top: 2rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.stat {
    text-align: center;
    padding: 1.5rem;
    background-color: var(--bg-primary);
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast);
}

.stat:hover {
    transform: translateY(-5px);
}

.stat h4 {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat p {
    color: var(--text-secondary);
    font-weight: 500;
    margin: 0;
}

/* ===== SKILLS SECTION ===== */
.skills {
    padding: var(--section-padding);
    background-color: var(--bg-primary);
}

.skills-content {
    display: grid;
    grid-template-columns: 1fr; /* Single column for mobile */
    gap: 2rem;
    align-items: start;
}

.skills-category h3 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.skill-item {
    margin-bottom: 2rem;
}

.skill-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.skill-info span:first-child {
    font-weight: 500;
    color: var(--text-primary);
}

.skill-info span:last-child {
    color: var(--primary-color);
    font-weight: 600;
}

.skill-bar {
    height: 8px;
    background-color: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    width: 0;
    transition: width 1s ease-out;
    border-radius: 4px;
}

.skills-grid {
    display: grid;
    grid-template-columns: 1fr; /* Single column for mobile */
    gap: 1.5rem;
}

.skill-card {
    background-color: var(--bg-secondary);
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
    border: 1px solid var(--border-color);
}

.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.skill-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.skill-card h4 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.skill-card p {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

/* ===== PROJECTS SECTION ===== */
.projects {
    padding: var(--section-padding);
    background-color: var(--bg-secondary);
}

.projects-grid {
    display: grid;
    grid-template-columns: 1fr; /* Single column for mobile */
    gap: 2rem;
    max-width: 400px;
    margin: 0 auto;
}

.project-card {
    background-color: var(--bg-primary);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    border: 1px solid var(--border-color);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
}

.project-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.project-image .image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    border-radius: 0;
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-link {
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    transition: all var(--transition-fast);
}

.project-link:hover {
    background-color: var(--accent-color);
    transform: scale(1.1);
}

.project-info {
    padding: 2rem;
}

.project-info h3 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.project-info p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.project-tech span {
    background-color: var(--bg-tertiary);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: var(--font-size-sm);
    font-weight: 500;
}

/* ===== CONTACT SECTION ===== */
.contact {
    padding: var(--section-padding);
    background-color: var(--bg-primary);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr; /* Single column for mobile */
    gap: 2rem;
    align-items: start;
}

.contact-info h3 {
    font-size: var(--font-size-2xl);
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.contact-info p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.contact-details {
    margin-bottom: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.contact-item i {
    width: 20px;
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    width: 50px;
    height: 50px;
    background-color: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1.2rem;
    transition: all var(--transition-fast);
    border: 1px solid var(--border-color);
}

.social-link:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

.contact-form {
    background-color: var(--bg-secondary);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: var(--font-size-base);
    transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* ===== FOOTER ===== */
.footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    text-align: center;
}

.footer p {
    color: var(--text-secondary);
}

/* ===== BACK TO TOP BUTTON ===== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-normal);
    z-index: 100;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background-color: var(--primary-dark);
    transform: translateY(-3px);
}

/* ===== MOBILE-FIRST RESPONSIVE DESIGN ===== */

/* Default styles are mobile-first (320px+) */

/* Small Mobile Devices (320px - 374px) */
@media (max-width: 374px) {
    :root {
        --section-padding: 1.5rem 0;
        --container-padding: 0 0.75rem;
        --nav-height: 50px;
        --font-size-5xl: 1.5rem;
        --font-size-4xl: 1.25rem;
        --font-size-3xl: 1.125rem;
        --font-size-2xl: 1rem;
        --font-size-xl: 0.95rem;
    }
    
    .hero {
        min-height: 70vh;
        padding-top: calc(var(--nav-height) + 1rem);
    }
    
    .hero-image .image-placeholder,
    .about-image .image-placeholder,
    .about-profile-photo {
        width: 150px;
        height: 150px;
        font-size: 40px;
    }
    
    .btn {
        padding: 0.75rem 1rem;
        font-size: var(--font-size-sm);
    }
    
    .nav-logo a {
        font-size: var(--font-size-base);
    }
    
    .hamburger span {
        width: 18px;
        height: 2px;
    }
}

/* Large Mobile Devices (375px - 479px) */
@media (min-width: 375px) and (max-width: 479px) {
    :root {
        --section-padding: 2rem 0;
        --container-padding: 0 1rem;
        --nav-height: 55px;
        --font-size-5xl: 1.75rem;
        --font-size-4xl: 1.5rem;
        --font-size-3xl: 1.25rem;
    }
    
    .hero-image .image-placeholder {
        width: 200px;
        height: 200px;
        font-size: 60px;
    }
    
    .about-image .image-placeholder,
    .about-profile-photo {
        width: 180px;
        height: 180px;
        font-size: 55px;
    }
}

/* Mobile Landscape / Small Tablet (480px - 767px) */
@media (min-width: 480px) and (max-width: 767px) {
    :root {
        --section-padding: 2.5rem 0;
        --container-padding: 0 1.25rem;
        --nav-height: 60px;
        --font-size-5xl: 2rem;
        --font-size-4xl: 1.75rem;
        --font-size-3xl: 1.5rem;
    }
    
    .hero-image .image-placeholder {
        width: 250px;
        height: 250px;
        font-size: 80px;
    }
    
    .about-image .image-placeholder,
    .about-profile-photo {
        width: 220px;
        height: 220px;
        font-size: 70px;
    }
    
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet Portrait (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    :root {
        --section-padding: 3.5rem 0;
        --container-padding: 0 2rem;
        --nav-height: 65px;
        --font-size-5xl: 2.5rem;
        --font-size-4xl: 2rem;
    }
    
    /* Hero Section for Tablets */
    .hero {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
        align-items: center;
    }
    
    .hero-profile-image {
        order: 1;
        justify-content: center;
    }
    
    .hero-content {
        order: 2;
        text-align: center;
    }
    
    .profile-container {
        width: 280px;
        height: 280px;
    }
    
    .hero-title {
        font-size: var(--font-size-3xl);
    }
    
    .brand-name {
        font-size: var(--font-size-lg);
    }
    
    .hero-subtitle {
        font-size: var(--font-size-xl);
    }
    
    .hero-description {
        font-size: var(--font-size-base);
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero-buttons {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .btn {
        width: auto;
        min-width: 150px;
        padding: 0.875rem 2rem;
    }
    
    .about-content {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }
    
    .skills-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

/* Large Desktop / Desktop (1024px - 1199px) */
@media (min-width: 1024px) {
    :root {
        --section-padding: 5rem 0;
        --container-padding: 0 2rem;
        --nav-height: 70px;
        --font-size-5xl: 3rem;
        --font-size-4xl: 2.25rem;
    }
    
    .container {
        max-width: 1200px;
        padding: var(--container-padding);
    }
    
    /* Navigation becomes horizontal */
    .nav-menu {
        position: static;
        transform: none;
        flex-direction: row;
        background: transparent;
        padding: 0;
        box-shadow: none;
        border: none;
        max-height: none;
        gap: 2rem;
        align-items: center;
    }
    
    .nav-item {
        margin-bottom: 0;
        width: auto;
    }
    
    .nav-link {
        display: inline-block;
        padding: 0.5rem 0;
        border-bottom: none;
        text-align: left;
        width: auto;
        font-size: var(--font-size-base);
    }
    
    .hamburger {
        display: none; /* Hide hamburger on desktop */
    }
    
    /* Hero section - 2 columns (image left, content right) */
    .hero {
        grid-template-columns: 400px 1fr;
        gap: 4rem;
        text-align: left;
        align-items: center;
    }
    
    .hero-profile-image {
        order: 0; /* Image on left */
        justify-content: flex-start;
        margin-bottom: 0;
    }
    
    .hero-content {
        order: 1; /* Content on right */
        text-align: left;
    }
    
    .profile-container {
        width: 350px;
        height: 350px;
    }
    
    .hero-title {
        font-size: var(--font-size-4xl);
    }
    
    .hero-subtitle {
        font-size: var(--font-size-2xl);
    }
    
    .brand-name {
        font-size: var(--font-size-xl);
    }
    
    .hero-description {
        font-size: var(--font-size-lg);
        max-width: 600px;
    }
    
    .hero-buttons {
        flex-direction: row;
        justify-content: flex-start;
        width: auto;
        flex-wrap: wrap;
    }
    
    .btn {
        width: auto;
        padding: 0.75rem 2rem;
    }
    
    /* About section - 2 columns */
    .about-content {
        grid-template-columns: 1fr 2fr;
        gap: 4rem;
        text-align: left;
    }
    
    .about-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
        max-width: none;
    }
    
    /* Skills section - 2 columns */
    .skills-content {
        grid-template-columns: 1fr 1fr;
        gap: 4rem;
    }
    
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    /* Projects section - 3 columns */
    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
        max-width: none;
        margin: 0;
    }
    
    /* Contact section - 2 columns */
    .contact-content {
        grid-template-columns: 1fr 1fr;
        gap: 4rem;
    }
}

/* Extra Large Desktop (1200px+) */
@media (min-width: 1200px) {
    .container {
        max-width: 1400px;
    }
    
    .hero .container {
        gap: 5rem;
    }
    
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablet Landscape (768px - 1023px) */
@media (max-width: 1023px) {
    :root {
        --section-padding: 4rem 0;
        --container-padding: 0 2rem;
        --font-size-5xl: 2.75rem;
        --font-size-4xl: 2.25rem;
        --nav-height: 65px;
    }
    
    /* Hero Section - Stack on tablet */
    .hero .container {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        text-align: center;
    }
    
    .hero {
        padding-top: calc(var(--nav-height) + 1.5rem);
        min-height: 90vh;
    }
    
    /* About Section */
    .about-content {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        text-align: center;
    }
    
    .about-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
        max-width: 600px;
        margin: 2rem auto 0;
    }
    
    /* Skills Section */
    .skills-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    /* Projects Section */
    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: 2rem;
    }
    
    /* Contact Section */
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    
    .social-links {
        justify-content: center;
        margin-top: 1.5rem;
    }
}

/* Mobile Landscape / Small Tablet (480px - 767px) */
@media (max-width: 767px) {
    :root {
        --section-padding: 3rem 0;
        --container-padding: 0 1.5rem;
        --font-size-5xl: 2.25rem;
        --font-size-4xl: 1.875rem;
        --font-size-3xl: 1.5rem;
        --font-size-2xl: 1.25rem;
        --nav-height: 60px;
    }
    
    /* Navigation - Mobile Menu */
    .nav-container {
        padding: 0 1.5rem;
    }
    
    .nav-menu {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background-color: var(--bg-primary);
        flex-direction: column;
        padding: 2rem 1.5rem;
        box-shadow: var(--shadow-lg);
        transform: translateX(-100%);
        transition: transform var(--transition-normal);
        border-top: 1px solid var(--border-color);
        z-index: 999;
        max-height: calc(100vh - var(--nav-height));
        overflow-y: auto;
    }
    
    .nav-menu.active {
        transform: translateX(0);
    }
    
    .nav-item {
        margin-bottom: 1rem;
        width: 100%;
        text-align: center;
    }
    
    .nav-link {
        display: block;
        padding: 1rem 0;
        font-size: var(--font-size-lg);
        border-bottom: 1px solid var(--border-light);
    }
    
    .nav-link:last-child {
        border-bottom: none;
    }
    
    .hamburger {
        display: flex;
        z-index: 1000;
    }
    
    .theme-toggle {
        margin-left: 1rem;
        padding: 0.75rem;
    }
    
    /* Hero Section */
    .hero {
        min-height: 85vh;
        padding-top: calc(var(--nav-height) + 1rem);
    }
    
    .hero-title {
        font-size: var(--font-size-4xl);
        line-height: 1.1;
        margin-bottom: 1rem;
    }
    
    .hero-subtitle {
        font-size: var(--font-size-xl);
        margin-bottom: 1rem;
    }
    
    .hero-description {
        font-size: var(--font-size-base);
        margin-bottom: 2rem;
        max-width: 100%;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        width: 100%;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
        padding: 1rem 2rem;
        font-size: var(--font-size-base);
        justify-content: center;
    }
    
    /* Image placeholders */
    .hero-image .image-placeholder {
        width: 250px;
        height: 250px;
        font-size: 80px;
    }
    
    .about-image .image-placeholder {
        width: 200px;
        height: 200px;
        font-size: 70px;
    }
    
    /* About Stats */
    .about-stats {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-top: 2rem;
    }
    
    .stat {
        padding: 1.5rem;
        text-align: center;
    }
    
    /* Skills Section */
    .skills-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .skill-card {
        padding: 2rem 1.5rem;
        text-align: center;
    }
    
    .skill-card i {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }
    
    /* Projects Section */
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .project-card {
        margin: 0 auto;
        max-width: 400px;
    }
    
    .project-image {
        height: 180px;
    }
    
    .project-info {
        padding: 1.5rem;
    }
    
    .project-tech {
        gap: 0.75rem;
        justify-content: center;
    }
    
    /* Contact Section */
    .contact-form {
        padding: 1.5rem;
        margin: 0 auto;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 1rem;
        font-size: var(--font-size-base);
    }
    
    .social-links {
        justify-content: center;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .social-link {
        width: 45px;
        height: 45px;
    }
    
    /* Back to top button */
    .back-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
    
    /* Section spacing adjustments */
    .section-header {
        margin-bottom: 2.5rem;
    }
    
    .section-title {
        font-size: var(--font-size-3xl);
        margin-bottom: 0.75rem;
    }
    
    .section-description {
        font-size: var(--font-size-base);
        max-width: 100%;
    }
}

/* Mobile Portrait (320px - 479px) */
@media (max-width: 479px) {
    :root {
        --section-padding: 2.5rem 0;
        --container-padding: 0 1rem;
        --font-size-5xl: 1.875rem;
        --font-size-4xl: 1.5rem;
        --font-size-3xl: 1.25rem;
        --font-size-2xl: 1.125rem;
        --nav-height: 55px;
    }
    
    /* Navigation */
    .nav-container {
        padding: 0 1rem;
    }
    
    .nav-logo a {
        font-size: var(--font-size-lg);
    }
    
    .theme-toggle {
        padding: 0.5rem;
        margin-left: 0.75rem;
    }
    
    .hamburger {
        padding: 0.25rem;
    }
    
    .hamburger span {
        width: 20px;
        height: 2px;
    }
    
    /* Hero Section */
    .hero {
        min-height: 80vh;
        padding-top: calc(var(--nav-height) + 0.5rem);
    }
    
    .hero-title {
        font-size: var(--font-size-3xl);
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: var(--font-size-lg);
    }
    
    .hero-description {
        font-size: var(--font-size-sm);
        line-height: 1.6;
    }
    
    .btn {
        width: 100%;
        max-width: 100%;
        padding: 0.875rem 1.5rem;
        font-size: var(--font-size-sm);
    }
    
    /* Images */
    .hero-image .image-placeholder {
        width: 200px;
        height: 200px;
        font-size: 60px;
    }
    
    .about-image .image-placeholder {
        width: 180px;
        height: 180px;
        font-size: 60px;
    }
    
    /* Sections */
    .section-header {
        margin-bottom: 2rem;
    }
    
    .section-title {
        font-size: var(--font-size-2xl);
    }
    
    .section-description {
        font-size: var(--font-size-sm);
    }
    
    /* About */
    .about-text h3 {
        font-size: var(--font-size-xl);
    }
    
    .about-text p {
        font-size: var(--font-size-sm);
    }
    
    /* Skills */
    .skill-card {
        padding: 1.5rem 1rem;
    }
    
    .skill-card i {
        font-size: 2rem;
    }
    
    .skill-card h4 {
        font-size: var(--font-size-base);
    }
    
    .skill-card p {
        font-size: var(--font-size-xs);
    }
    
    /* Projects */
    .project-image {
        height: 150px;
    }
    
    .project-info {
        padding: 1.25rem;
    }
    
    .project-info h3 {
        font-size: var(--font-size-lg);
    }
    
    .project-info p {
        font-size: var(--font-size-sm);
    }
    
    .project-tech span {
        font-size: var(--font-size-xs);
        padding: 0.25rem 0.5rem;
    }
    
    /* Contact */
    .contact-info h3 {
        font-size: var(--font-size-xl);
    }
    
    .contact-info p {
        font-size: var(--font-size-sm);
    }
    
    .contact-item {
        font-size: var(--font-size-sm);
    }
    
    .contact-form {
        padding: 1.25rem;
    }
    
    .form-group {
        margin-bottom: 1.25rem;
    }
    
    .form-group label {
        font-size: var(--font-size-sm);
        margin-bottom: 0.375rem;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 0.875rem;
        font-size: var(--font-size-sm);
    }
    
    /* Social links */
    .social-link {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    /* Back to top */
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
        font-size: 0.875rem;
    }
}

/* Extra Small Screens (below 360px) */
@media (max-width: 359px) {
    :root {
        --container-padding: 0 0.75rem;
        --font-size-5xl: 1.75rem;
        --font-size-4xl: 1.375rem;
        --nav-height: 50px;
    }
    
    .nav-container {
        padding: 0 0.75rem;
    }
    
    .hero-image .image-placeholder,
    .about-image .image-placeholder {
        width: 160px;
        height: 160px;
        font-size: 50px;
    }
    
    .btn {
        padding: 0.75rem 1rem;
        font-size: var(--font-size-xs);
    }
    
    .skill-card,
    .project-info,
    .contact-form {
        padding: 1rem;
    }
}

/* ===== COMPREHENSIVE MOBILE OPTIMIZATIONS ===== */

/* All mobile devices (up to 767px) */
@media (max-width: 767px) {
    /* Hero Section Mobile Optimizations */
    .hero {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
        padding-top: calc(var(--nav-height) + 1rem);
        min-height: 90vh;
    }
    
    .hero-profile-image {
        order: 1;
        margin-bottom: 1rem;
    }
    
    .hero-content {
        order: 2;
        text-align: center;
    }
    
    .profile-container {
        width: 200px;
        height: 200px;
        margin: 0 auto;
    }
    
    .hero-title {
        font-size: var(--font-size-2xl);
        line-height: 1.2;
        margin-bottom: 0.5rem;
    }
    
    .brand-name {
        font-size: var(--font-size-base);
        margin-bottom: 0.5rem;
    }
    
    .hero-subtitle {
        font-size: var(--font-size-lg);
        margin-bottom: 1rem;
    }
    
    .hero-description {
        font-size: var(--font-size-sm);
        margin-bottom: 1.5rem;
        padding: 0 1rem;
    }
    
    .hero-buttons {
        gap: 0.75rem;
        padding: 0 1rem;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
        padding: 1rem;
        font-size: var(--font-size-sm);
    }
    
    /* Ensure all interactive elements meet touch target guidelines */
    .btn,
    .nav-link,
    .theme-toggle,
    .hamburger,
    .back-to-top,
    .social-link,
    .project-link,
    .form-group input,
    .form-group textarea {
        min-height: 44px; /* iOS recommended touch target */
        min-width: 44px;
    }
    
    /* Improve text readability on mobile */
    body {
        font-size: 16px; /* Prevent zoom on iOS */
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
    }
    
    /* Optimize images for mobile */
    .image-placeholder {
        max-width: 100%;
        height: auto;
    }
    
    .hero-image .image-placeholder {
        width: 200px;
        height: 200px;
        font-size: 60px;
        margin: 0 auto;
    }
    
    .about-image .image-placeholder {
        width: 180px;
        height: 180px;
        font-size: 55px;
        margin: 0 auto;
    }
    
    /* Improve form usability */
    .form-group input,
    .form-group textarea {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 1rem;
        border-radius: 0.5rem;
    }
    
    /* Better spacing for mobile */
    .section-header {
        margin-bottom: 2rem;
        text-align: center;
    }
    
    .section-title {
        font-size: var(--font-size-2xl);
        line-height: 1.2;
        margin-bottom: 0.75rem;
    }
    
    .section-description {
        font-size: var(--font-size-sm);
        line-height: 1.6;
    }
    
    /* Improve button layout */
    .hero-buttons,
    .button-group {
        width: 100%;
        gap: 1rem;
    }
    
    /* Card optimizations */
    .skill-card,
    .project-card,
    .stat {
        padding: 1.5rem;
        margin-bottom: 1rem;
        border-radius: 1rem;
        box-shadow: var(--shadow-sm);
    }
    
    .project-info {
        padding: 1.5rem;
    }
    
    .project-tech {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    /* Social links */
    .social-links {
        justify-content: center;
        flex-wrap: wrap;
        gap: 1rem;
        margin-top: 1.5rem;
    }
    
    .social-link {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
    
    /* Contact optimizations */
    .contact-form {
        padding: 1.5rem;
        border-radius: 1rem;
        margin: 0;
        width: 100%;
    }
    
    .contact-info {
        text-align: center;
        margin-bottom: 2rem;
    }
    
    .contact-details {
        max-width: 300px;
        margin: 0 auto 2rem;
    }
    
    .contact-item {
        justify-content: center;
        text-align: center;
        margin-bottom: 1rem;
    }
}

/* Touch device specific optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .btn:hover,
    .nav-link:hover,
    .theme-toggle:hover,
    .social-link:hover,
    .skill-card:hover,
    .project-card:hover,
    .stat:hover,
    .back-to-top:hover {
        transform: none;
        box-shadow: inherit;
    }
    
    /* Add active/pressed states for better feedback */
    .btn:active {
        transform: scale(0.95);
        opacity: 0.8;
    }
    
    .social-link:active,
    .project-link:active,
    .back-to-top:active {
        transform: scale(0.9);
        opacity: 0.8;
    }
    
    .nav-link:active {
        background-color: var(--bg-secondary);
        color: var(--primary-color);
    }
    
    /* Improve scroll performance on touch devices */
    * {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Prevent text selection on touch for UI elements */
    .btn,
    .nav-link,
    .hamburger,
    .theme-toggle,
    .back-to-top {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
    }
}

/* ===== MOBILE MENU BACKDROP ===== */
.mobile-backdrop {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* ===== IMPROVED MOBILE NAVIGATION ===== */
@media (max-width: 767px) {
    .hamburger {
        position: relative;
        z-index: 1001;
        padding: 0.75rem;
        border-radius: 0.25rem;
        transition: background-color 0.2s ease;
    }
    
    .hamburger:active {
        background-color: var(--bg-secondary);
    }
    
    .nav-menu {
        /* Improve mobile menu performance */
        will-change: transform;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-menu.active {
        transform: translateX(0);
    }
    
    .nav-item {
        border-bottom: 1px solid var(--border-light);
    }
    
    .nav-item:last-child {
        border-bottom: none;
    }
    
    .nav-link {
        display: block;
        width: 100%;
        text-align: left;
        padding: 1.25rem 0;
        font-weight: 500;
        transition: color 0.2s ease, padding-left 0.2s ease;
    }
    
    .nav-link:active {
        padding-left: 1rem;
        color: var(--primary-color);
    }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
.hero,
.about,
.skills,
.projects,
.contact {
    /* Improve scrolling performance */
    will-change: scroll-position;
}

.animate-on-scroll {
    /* Optimize animations */
    will-change: transform, opacity;
}

.animate-on-scroll.fade-in,
.animate-on-scroll.slide-in-left,
.animate-on-scroll.slide-in-right {
    will-change: auto; /* Reset after animation */
}

/* ===== PREFERS REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
    
    .animate-on-scroll {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ===== HIGH DPI DISPLAYS ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Optimize for retina displays */
    .image-placeholder {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}
