/**
 * Enhanced Portfolio Styles
 * Non-critical CSS for visual enhancements
 * Loaded after critical CSS for progressive enhancement
 */

/* ============================================
   SECTION FOREGROUND IMAGES
   ============================================ */

.section {
    position: relative;
    overflow: hidden;
}

.section-foreground {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
}

.section .container {
    position: relative;
    z-index: 1;
}

/* ============================================
   TYPOGRAPHY SYSTEM
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Manrope:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    /* Display Font (Headings) */
    --font-display: 'DM Serif Display', serif;
    /* Body Font */
    --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    /* Monospace Font (Code/Technical) */
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    
    /* Enhanced Type Scale */
    --fs-900: clamp(2.5rem, 5vw, 3.5rem);   /* Hero title */
    --fs-800: clamp(2rem, 4vw, 2.75rem);    /* Section headings */
    --fs-700: clamp(1.5rem, 3vw, 2rem);     /* Subsection headings */
    --fs-600: clamp(1.125rem, 2vw, 1.25rem); /* Card titles */
    --fs-400: 1rem;                         /* Body */
    --fs-300: 0.875rem;                     /* Small text */
    
    /* Font Weights */
    --fw-normal: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;
    --fw-extrabold: 800;
    
    /* Line Heights */
    --lh-tight: 1.2;
    --lh-normal: 1.5;
    --lh-relaxed: 1.7;
}

/* Apply display font to headings */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: var(--fw-bold);
    line-height: var(--lh-tight);
    letter-spacing: -0.02em;
}

body {
    font-family: var(--font-body);
    line-height: var(--lh-relaxed);
}

code, pre, .mono {
    font-family: var(--font-mono);
}

/* ============================================
   ENHANCED COLOR SYSTEM
   ============================================ */

:root {
    /* Accent Color Variations */
    --accent-glow: rgba(34, 197, 94, 0.3);
    --accent-subtle: rgba(34, 197, 94, 0.1);
    --accent-gradient: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    --accent-gradient-hover: linear-gradient(135deg, #2dd977 0%, #22c55e 100%);
    
    /* Surface Layers for Depth */
    --surface-1: rgba(18, 20, 26, 0.4);
    --surface-2: rgba(18, 20, 26, 0.6);
    --surface-3: rgba(18, 20, 26, 0.8);
    
    /* Enhanced Shadows with Color Tint */
    --shadow-sm: 0 2px 4px rgba(34, 197, 94, 0.05);
    --shadow-md: 0 4px 8px rgba(34, 197, 94, 0.1);
    --shadow-lg: 0 8px 16px rgba(34, 197, 94, 0.15);
    --shadow-xl: 0 16px 32px rgba(34, 197, 94, 0.2);
    --shadow-glow: 0 0 20px var(--accent-glow);
}

[data-theme="light"] {
    --surface-1: rgba(15, 23, 42, 0.04);
    --surface-2: rgba(15, 23, 42, 0.08);
    --surface-3: rgba(15, 23, 42, 0.12);
    --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 8px rgba(15, 23, 42, 0.1);
    --shadow-lg: 0 8px 16px rgba(15, 23, 42, 0.15);
    --shadow-xl: 0 16px 32px rgba(15, 23, 42, 0.2);
}

/* ============================================
   HERO SECTION ENHANCEMENTS
   ============================================ */

.hero {
    position: relative;
    overflow: hidden;
}

/* Hero Foreground Image */
.hero-foreground {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
    z-index: 1;
    opacity: 1;
}

/* Profile Image Enhancements */
.hero-content img {
    position: relative;
    z-index: 2;
    animation: profileReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 
        0 0 0 4px rgba(34, 197, 94, 0.2),
        0 12px 40px rgba(34, 197, 94, 0.3),
        0 0 60px rgba(34, 197, 94, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-content img:hover {
    transform: scale(1.05);
    box-shadow: 
        0 0 0 4px rgba(34, 197, 94, 0.3),
        0 16px 50px rgba(34, 197, 94, 0.4),
        0 0 80px rgba(34, 197, 94, 0.2);
}

@keyframes profileReveal {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Gradient Text Effect for Hero Title */
.hero h1 {
    background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

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

/* Staggered Reveal for Hero Elements */
.hero-content > *:nth-child(2) { animation-delay: 0.1s; }
.hero-content > *:nth-child(3) { animation-delay: 0.2s; }
.hero-content > *:nth-child(4) { animation-delay: 0.3s; }
.hero-content > *:nth-child(5) { animation-delay: 0.4s; }

/* Enhanced CTA Buttons */
.btn-primary {
    position: relative;
    overflow: hidden;
    background: var(--accent-gradient);
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-gradient-hover);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
    box-shadow: var(--shadow-lg), var(--shadow-glow), 0 0 0 3px var(--accent-subtle);
}

.btn-primary span {
    position: relative;
    z-index: 1;
}

.btn-secondary {
    position: relative;
    border: 2px solid var(--accent);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-secondary::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid var(--accent);
    border-radius: inherit;
    opacity: 0;
    animation: borderPulse 2s ease-in-out infinite;
}

@keyframes borderPulse {
    0%, 100% {
        opacity: 0;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.05);
    }
}

.btn-secondary:hover {
    background: var(--accent-subtle);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
    box-shadow: var(--shadow-md), 0 0 0 3px var(--accent-subtle);
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    animation: scrollBounce 2s ease-in-out infinite;
}

.scroll-indicator::after {
    content: '';
    width: 2px;
    height: 30px;
    background: var(--accent-gradient);
    border-radius: 2px;
    animation: scrollLine 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(10px); }
}

@keyframes scrollLine {
    0% { height: 10px; opacity: 0.5; }
    50% { height: 30px; opacity: 1; }
    100% { height: 10px; opacity: 0.5; }
}

/* ============================================
   SCROLL PROGRESS BAR
   ============================================ */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--accent-gradient);
    transform-origin: left;
    z-index: 9999;
    transition: width 0.1s ease-out;
}

/* ============================================
   NAVIGATION ENHANCEMENTS
   ============================================ */

nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(11, 15, 20, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: all 0.3s ease;
}

nav.scrolled {
    box-shadow: var(--shadow-md);
    background: rgba(11, 15, 20, 0.95);
}

[data-theme="light"] nav {
    background: rgba(255, 255, 255, 0.8);
}

[data-theme="light"] nav.scrolled {
    background: rgba(255, 255, 255, 0.95);
}

/* Active Link Indicator */
.nav-links {
    position: relative;
}

.nav-indicator {
    position: absolute;
    bottom: 0;
    height: 2px;
    background: var(--accent-gradient);
    border-radius: 2px 2px 0 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.nav-links a {
    position: relative;
    transition: color 0.2s ease;
}

.nav-links a.active {
    color: var(--accent);
}

/* ============================================
   SKILLS SECTION ENHANCEMENTS
   ============================================ */

.skill-category-card {
    background: rgba(18, 20, 26, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.skill-category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.skill-category-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: var(--shadow-lg);
}

.skill-category-card:hover::before {
    transform: scaleX(1);
}

.skill-category-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.skill-category-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-subtle);
    border-radius: 10px;
    color: var(--accent);
}

.skill-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.skill-item:last-child {
    border-bottom: none;
}

.skill-name {
    font-weight: var(--fw-medium);
    color: var(--text);
}

.skill-strength {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.skill-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.3);
    transition: all 0.2s ease;
}

.skill-dot.filled {
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}

.skill-progress-bar {
    width: 100px;
    height: 4px;
    background: rgba(148, 163, 184, 0.2);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.skill-progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 2px;
    transition: width 0.6s ease;
}

/* Skill Badges */
.skill-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--accent-subtle);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 20px;
    color: var(--accent);
    font-weight: var(--fw-medium);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.skill-badge:hover {
    transform: translateY(-2px) scale(1.05);
    background: rgba(34, 197, 94, 0.15);
    box-shadow: var(--shadow-sm);
}

/* ============================================
   PROJECTS SECTION ENHANCEMENTS
   ============================================ */

.project-card {
    background: rgba(18, 20, 26, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid transparent;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--accent-subtle), transparent) border-box;
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--accent);
}

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

.project-card:focus-within {
    border-color: var(--accent);
    box-shadow: var(--shadow-lg), 0 0 0 3px var(--accent-subtle);
    outline: none;
}

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

.project-thumbnail {
    width: 100%;
    height: 100%;
    background: var(--accent-gradient);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.3s ease;
}

.project-thumbnail::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.project-thumbnail svg {
    position: relative;
    z-index: 2;
}

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

.project-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    background: rgba(11, 15, 20, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--accent);
    border-radius: 20px;
    color: var(--accent);
    font-weight: var(--fw-bold);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    50% { box-shadow: 0 0 0 4px rgba(34, 197, 94, 0); }
}

.project-content {
    padding: 1.5rem;
}

.project-stats {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.project-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.project-stat svg {
    width: 16px;
    height: 16px;
    color: var(--accent);
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.tech-badge {
    padding: 0.4rem 0.8rem;
    background: var(--accent-subtle);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 12px;
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: var(--fw-medium);
    transition: all 0.2s ease;
    position: relative;
}

.tech-badge:hover {
    transform: translateY(-2px) scale(1.05);
    background: rgba(34, 197, 94, 0.15);
    box-shadow: var(--shadow-sm);
}

.tech-badge:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

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

.link-primary,
.link-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: var(--fw-semibold);
    transition: all 0.2s ease;
}

.link-primary {
    background: var(--accent-gradient);
    color: white;
}

.link-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.link-primary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

.link-secondary {
    border: 1px solid var(--border);
    color: var(--text);
}

.link-secondary:hover {
    border-color: var(--accent);
    background: var(--accent-subtle);
}

.link-secondary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

/* Stagger animation delays */
.animate-on-scroll:nth-child(1) { transition-delay: 0s; }
.animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.animate-on-scroll:nth-child(4) { transition-delay: 0.3s; }
.animate-on-scroll:nth-child(5) { transition-delay: 0.4s; }

/* ============================================
   LINK ANIMATIONS
   ============================================ */

a:not(.btn):not(.badge-link):not(.tech-badge) {
    position: relative;
    text-decoration: none;
}

a:not(.btn):not(.badge-link):not(.tech-badge)::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

a:not(.btn):not(.badge-link):not(.tech-badge):hover::after {
    width: 100%;
}

/* ============================================
   CHATBOT WIDGET ENHANCEMENTS
   ============================================ */

/* Enhanced Chatbot Widget Styles */
.mm-chatbot-launcher {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent-gradient);
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: chatPulse 3s ease-in-out infinite;
}

#chat-toggle,
.mm-chatbot-launcher {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--accent-gradient);
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: chatPulse 3s ease-in-out infinite;
}

@keyframes chatPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: var(--shadow-lg), var(--shadow-glow);
    }
    50% {
        transform: scale(1.05);
        box-shadow: var(--shadow-xl), 0 0 30px var(--accent-glow);
    }
}

#chat-toggle:hover,
.mm-chatbot-launcher:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-xl), 0 0 40px var(--accent-glow);
}

#chat-toggle::before,
.mm-chatbot-launcher::before {
    content: 'Ask me anything!';
    position: absolute;
    right: 70px;
    white-space: nowrap;
    background: rgba(11, 15, 20, 0.95);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    font-size: 0.875rem;
}

#chat-toggle:hover::before,
.mm-chatbot-launcher:hover::before {
    opacity: 1;
}

/* Chatbot Panel Enhancements */
.mm-chatbot-panel {
    background: rgba(18, 20, 26, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
    box-shadow: var(--shadow-xl) !important;
}

.mm-chatbot-bubble {
    animation: messageSlideIn 0.3s ease;
}

.mm-chatbot-msg[data-role="user"] .mm-chatbot-bubble {
    background: var(--accent-gradient) !important;
}

.mm-chatbot-msg[data-role="bot"] .mm-chatbot-bubble {
    background: rgba(148, 163, 184, 0.1) !important;
}

#chat-widget,
.mm-chatbot-panel {
    position: fixed;
    bottom: 90px;
    right: 2rem;
    width: 380px;
    max-width: calc(100vw - 4rem);
    height: 500px;
    max-height: calc(100vh - 120px);
    background: rgba(18, 20, 26, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    display: none;
    flex-direction: column;
    z-index: 998;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#chat-widget.open,
.mm-chatbot-panel[data-open="true"] {
    display: flex;
    transform: translateY(0) scale(1);
    opacity: 1;
}

.chat-header,
.mm-chatbot-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-input-container {
    padding: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.5rem;
    background: rgba(18, 20, 26, 0.95);
}

.chat-input-container input {
    flex: 1;
    padding: 0.75rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.9rem;
}

.chat-input-container input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.chat-input-container button {
    padding: 0.75rem 1rem;
    background: var(--accent-gradient);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-input-container button:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.chat-message,
.mm-chatbot-bubble {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    max-width: 80%;
    animation: messageSlideIn 0.3s ease;
}

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

.chat-message.user,
.mm-chatbot-msg[data-role="user"] .mm-chatbot-bubble {
    align-self: flex-end;
    background: var(--accent-gradient);
    color: white;
}

.chat-message.bot,
.mm-chatbot-msg[data-role="bot"] .mm-chatbot-bubble {
    align-self: flex-start;
    background: rgba(148, 163, 184, 0.1);
    color: var(--text);
}

.typing-indicator,
.mm-chatbot-typing {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(148, 163, 184, 0.1);
    border-radius: 12px;
    max-width: 80px;
}

.typing-dot,
.mm-chatbot-typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    animation: typingDot 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(2),
.mm-chatbot-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3),
.mm-chatbot-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* ============================================
   ACCESSIBILITY ENHANCEMENTS
   ============================================ */

/* Skip Link Enhancement */
.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    z-index: 10000;
    padding: 0.75rem 1.5rem;
    background: var(--accent-gradient);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: var(--fw-semibold);
    box-shadow: var(--shadow-lg);
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 1rem;
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

/* Focus visible for all interactive elements */
*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .scroll-indicator {
        animation: none;
    }
    
    .project-badge {
        animation: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card,
    .project-card,
    .skill-category-card {
        border-width: 2px;
    }
    
    .btn-primary,
    .btn-secondary {
        border-width: 2px;
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .hero {
        min-height: 70vh;
        padding: 4rem 1rem 2rem;
    }
    
    .hero h1 {
        font-size: clamp(2rem, 8vw, 2.5rem);
    }
    
    .project-card {
        margin-bottom: 1.5rem;
    }
    
    .project-header {
        height: 150px;
    }
    
    .project-thumbnail {
        height: 100%;
    }
    
    .tech-stack {
        gap: 0.4rem;
    }
    
    .tech-badge {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
    
    #chat-widget,
    .mm-chatbot-panel {
        width: calc(100vw - 2rem);
        right: 1rem;
        bottom: 80px;
        max-height: calc(100vh - 100px);
    }
    
    #chat-toggle,
    .mm-chatbot-launcher {
        right: 1rem;
        bottom: 1rem;
        width: 50px;
        height: 50px;
    }
    
    .skill-category-card {
        padding: 1rem;
    }
    
    .scroll-indicator {
        bottom: 1rem;
        font-size: 0.65rem;
    }
    
    .nav-links {
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .hero {
        min-height: 60vh;
        padding: 3rem 1rem 1.5rem;
    }
    
    .project-header {
        height: 120px;
    }
    
    .project-content {
        padding: 1rem;
    }
    
    .project-links {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .link-primary,
    .link-secondary {
        width: 100%;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
