

/* ================================================
   1. CSS VARIABLES & RESET
   ================================================ */
:root {
    /* Colors - Light Mode */
    --bg-primary: #fafafa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f5f5f5;
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a68;
    --text-muted: #8a8aa3;
    --accent: #00d4aa;
    --accent-dark: #00b894;
    --accent-light: rgba(0, 212, 170, 0.1);
    --border: rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
    --gradient-1: linear-gradient(135deg, #00d4aa 0%, #00b894 100%);
    --gradient-2: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-hero: radial-gradient(ellipse at 30% 20%, rgba(0, 212, 170, 0.15) 0%, transparent 50%),
                     radial-gradient(ellipse at 70% 80%, rgba(102, 126, 234, 0.1) 0%, transparent 50%);
    
    /* Typography */
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    
    /* Spacing */
    --section-padding: 120px;
    --container-max: 1200px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --text-primary: #ffffff;
    --text-secondary: #b8b8c8;
    --text-muted: #6a6a80;
    --accent: #00ffcc;
    --accent-dark: #00d4aa;
    --accent-light: rgba(0, 255, 204, 0.1);
    --border: rgba(255, 255, 255, 0.08);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --gradient-hero: radial-gradient(ellipse at 30% 20%, rgba(0, 255, 204, 0.1) 0%, transparent 50%),
                     radial-gradient(ellipse at 70% 80%, rgba(102, 126, 234, 0.08) 0%, transparent 50%);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    overflow-x: hidden;
    transition: background-color var(--transition-base), color var(--transition-base);
}

/* Hide scrollbar during preloader */
body.loading {
    overflow: hidden;
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

ul, ol {
    list-style: none;
}

input, textarea {
    font-family: inherit;
    font-size: inherit;
}

/* Container */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

/* Section Base */
.section {
    padding: var(--section-padding) 0;
    position: relative;
}

/* ================================================
   2. PRELOADER
   ================================================ */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.preloader-inner {
    text-align: center;
}

.preloader-line {
    width: 200px;
    height: 3px;
    background: var(--border);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 16px;
}

.preloader-line::after {
    content: '';
    display: block;
    width: 40%;
    height: 100%;
    background: var(--gradient-1);
    border-radius: var(--radius-full);
    animation: preloaderLine 1s ease-in-out infinite;
}

@keyframes preloaderLine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

.preloader-text {
    font-family: var(--font-display);
    font-size: 14px;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ================================================
   3. CUSTOM CURSOR
   ================================================ */
.cursor,
.cursor-follower {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cursor {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.cursor-follower {
    width: 40px;
    height: 40px;
    border: 1px solid var(--accent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: transform 0.15s ease, width 0.3s ease, height 0.3s ease;
}

body:hover .cursor,
body:hover .cursor-follower {
    opacity: 1;
}

.cursor-follower.hovering {
    width: 60px;
    height: 60px;
    background: var(--accent-light);
}

/* Hide custom cursor on mobile */
@media (max-width: 1024px) {
    .cursor,
    .cursor-follower {
        display: none !important;
    }
}

/* ================================================
   4. NAVIGATION
   ================================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 20px 0;
    transition: padding var(--transition-base), background-color var(--transition-base), box-shadow var(--transition-base);
}

.navbar.scrolled {
    padding: 12px 0;
    background: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo */
.nav-logo {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-text {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

/* Nav Menu */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    padding: 10px 16px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast), background-color var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent);
    background: var(--accent-light);
}

/* Nav Actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Theme Toggle */
.theme-toggle {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.theme-toggle:hover {
    transform: scale(1.05);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

.theme-toggle .moon-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: block;
}

/* Mobile Toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.nav-toggle span {
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: var(--radius-full);
    transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.nav-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Menu */
@media (max-width: 900px) {
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        max-width: 320px;
        height: 100vh;
        flex-direction: column;
        align-items: stretch;
        padding: 100px 24px 40px;
        background: var(--bg-secondary);
        box-shadow: var(--shadow-lg);
        transition: right var(--transition-base);
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-link {
        padding: 16px;
        font-size: 18px;
        border-radius: var(--radius-md);
    }
    
    .nav-toggle {
        display: flex;
    }
}

/* ================================================
   5. HERO SECTION
   ================================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding-top: 80px;
}

/* Hero Background */
.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-hero);
}

#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.6;
}

/* Hero Content */
.hero-content {
    position: relative;
    z-index: 1;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

/* Hero Text */
.hero-text {
    max-width: 600px;
}

.hero-greeting {
    font-size: 18px;
    color: var(--accent);
    margin-bottom: 12px;
    font-weight: 500;
}

.wave {
    display: inline-block;
    animation: wave 2.5s infinite;
    transform-origin: 70% 70%;
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    10% { transform: rotate(14deg); }
    20% { transform: rotate(-8deg); }
    30% { transform: rotate(14deg); }
    40% { transform: rotate(-4deg); }
    50% { transform: rotate(10deg); }
    60% { transform: rotate(0deg); }
}

.hero-name {
    font-family: var(--font-display);
    font-size: clamp(40px, 8vw, 72px);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 16px;
}

.name-line {
    display: block;
    color: var(--text-primary);
}

.name-highlight {
    display: block;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-size: 24px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.title-prefix {
    color: var(--accent);
    font-weight: 700;
}

.title-cursor {
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-desc {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    max-width: 480px;
}

/* Buttons */
.hero-cta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.btn svg {
    width: 18px;
    height: 18px;
    transition: transform var(--transition-fast);
}

.btn-primary {
    background: var(--gradient-1);
    color: #000;
    box-shadow: 0 4px 20px rgba(0, 212, 170, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(0, 212, 170, 0.4);
}

.btn-primary:hover svg {
    transform: translateX(4px);
}

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

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

/* Hero Visual */
.hero-visual {
    display: flex;
    justify-content: center;
    position: relative;
}

.hero-avatar {
    position: relative;
}

.avatar-frame {
    width: 320px;
    height: 320px;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    overflow: hidden;
    position: relative;
    z-index: 2;
    animation: morphAvatar 8s ease-in-out infinite;
}

@keyframes morphAvatar {
    0%, 100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
    25% { border-radius: 58% 42% 75% 25% / 76% 46% 54% 24%; }
    50% { border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%; }
    75% { border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%; }
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-decoration {
    position: absolute;
    top: -20px;
    left: -20px;
    width: calc(100% + 40px);
    height: calc(100% + 40px);
    border: 2px dashed var(--accent);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation: morphDecoration 8s ease-in-out infinite;
    opacity: 0.5;
}

@keyframes morphDecoration {
    0%, 100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; transform: rotate(0deg); }
    25% { border-radius: 58% 42% 75% 25% / 76% 46% 54% 24%; transform: rotate(5deg); }
    50% { border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%; transform: rotate(0deg); }
    75% { border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%; transform: rotate(-5deg); }
}

/* Floating Badges */
.floating-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.float-badge {
    position: absolute;
    background: var(--bg-secondary);
    padding: 16px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    gap: 4px;
    animation: float 6s ease-in-out infinite;
}

.badge-1 {
    top: 20%;
    right: 0;
    animation-delay: 0s;
}

.badge-2 {
    bottom: 20%;
    left: 0;
    animation-delay: 3s;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.badge-number {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
}

.badge-text {
    font-size: 13px;
    color: var(--text-muted);
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 13px;
    animation: bounce 2s ease-in-out infinite;
}

.scroll-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, var(--accent), transparent);
    animation: scrollLine 2s ease-in-out infinite;
}

@keyframes scrollLine {
    0%, 100% { transform: scaleY(1); opacity: 1; }
    50% { transform: scaleY(0.5); opacity: 0.5; }
}

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

/* Hero Responsive */
@media (max-width: 900px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-text {
        max-width: 100%;
    }
    
    .hero-desc {
        max-width: 100%;
    }
    
    .hero-cta {
        justify-content: center;
    }
    
    .hero-visual {
        order: -1;
    }
    
    .avatar-frame {
        width: 240px;
        height: 240px;
    }
    
    .float-badge {
        display: none;
    }
    
    .scroll-indicator {
        display: none;
    }
}

/* ================================================
   6. ABOUT SECTION
   ================================================ */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 80px;
    align-items: center;
}

.about-image {
    position: relative;
}

.image-wrapper {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.about-img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.image-wrapper:hover .about-img {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 212, 170, 0.2), transparent);
}

/* Experience Card */
.experience-card {
    position: absolute;
    bottom: -30px;
    right: -30px;
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 16px;
}

.exp-icon {
    width: 50px;
    height: 50px;
    background: var(--accent-light);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.exp-icon svg {
    width: 24px;
    height: 24px;
    color: var(--accent);
}

.exp-number {
    display: block;
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 700;
    color: var(--accent);
}

.exp-text {
    font-size: 13px;
    color: var(--text-muted);
}

/* About Text */
.about-intro {
    font-size: 22px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.about-intro strong {
    color: var(--accent);
}

.about-desc {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* Info List */
.about-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 32px 0;
    padding: 24px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 13px;
    color: var(--text-muted);
}

.info-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* About Responsive */
@media (max-width: 900px) {
    .about-content {
        grid-template-columns: 1fr;
        gap: 60px;
    }
    
    .about-img {
        height: 400px;
    }
    
    .experience-card {
        right: 20px;
        bottom: -20px;
    }
    
    .about-info {
        grid-template-columns: 1fr;
    }
}

/* ================================================
   7. SKILLS SECTION
   ================================================ */
.skills {
    background: var(--bg-tertiary);
}

.skills-content {
    display: flex;
    flex-direction: column;
    gap: 60px;
}

.skill-categories {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
}

/* Skill Category */
.skill-category {
    background: var(--bg-secondary);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.category-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.category-icon {
    width: 48px;
    height: 48px;
    background: var(--accent-light);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-icon svg {
    width: 24px;
    height: 24px;
    color: var(--accent);
}

.category-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
}

/* Skill Item */
.skill-item {
    margin-bottom: 20px;
}

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

.skill-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.skill-name {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.skill-percent {
    font-size: 14px;
    color: var(--accent);
    font-weight: 600;
}

.skill-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: var(--gradient-1);
    border-radius: var(--radius-full);
    width: 0;
    transition: width 1.5s ease;
}

/* Tech Stack */
.tech-stack {
    text-align: center;
}

.stack-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--text-secondary);
}

.stack-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.stack-item {
    width: 60px;
    height: 60px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    position: relative;
    cursor: pointer;
}

.stack-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.stack-item svg {
    width: 28px;
    height: 28px;
    color: var(--text-primary);
}

.stack-item::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-fast), visibility var(--transition-fast);
}

.stack-item:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Skills Responsive */
@media (max-width: 768px) {
    .skill-categories {
        grid-template-columns: 1fr;
    }
}

/* ================================================
   8. EDUCATION SECTION
   ================================================ */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 2px;
    height: 100%;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-left: 40px;
    padding-bottom: 50px;
}

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

.timeline-marker {
    position: absolute;
    left: -6px;
    top: 0;
    width: 14px;
    height: 14px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 0 4px var(--bg-primary);
}

.timeline-content {
    background: var(--bg-secondary);
    padding: 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}

.timeline-content:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(5px);
}

.timeline-date {
    display: inline-block;
    padding: 4px 12px;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-full);
    margin-bottom: 12px;
}

.timeline-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.timeline-company {
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 8px;
}

.timeline-desc {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Timeline Responsive */
@media (max-width: 600px) {
    .timeline::before {
        left: 6px;
    }
    
    .timeline-item {
        padding-left: 30px;
    }
    
    .timeline-marker {
        left: 0;
    }
}

/* ================================================
   9. PROJECTS SECTION
   ================================================ */
.projects {
    background: var(--bg-tertiary);
}

/* Filter */
.projects-filter {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 50px;
}

.filter-btn {
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.filter-btn:hover,
.filter-btn.active {
    color: #000;
    background: var(--accent);
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

/* Project Card */
.project-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

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

.project-image {
    position: relative;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

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

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

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

.project-links {
    display: flex;
    gap: 16px;
}

.project-link {
    width: 50px;
    height: 50px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(20px);
    opacity: 0;
    transition: transform var(--transition-fast), opacity var(--transition-fast);
}

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

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

.project-link svg {
    width: 22px;
    height: 22px;
    color: #000;
}

.project-content {
    padding: 24px;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.tag {
    padding: 4px 12px;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--radius-full);
}

.project-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.project-desc {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Projects Responsive */
@media (max-width: 600px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

/* ================================================
   10. CONTACT SECTION
   ================================================ */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 60px;
}

/* Contact Info */
.contact-info {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.info-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    transition: transform var(--transition-fast);
}

.info-card:hover {
    transform: translateX(5px);
}

.info-icon {
    width: 50px;
    height: 50px;
    background: var(--accent-light);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.info-icon svg {
    width: 24px;
    height: 24px;
    color: var(--accent);
}

.info-details h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.info-details a,
.info-details span {
    font-size: 14px;
    color: var(--text-secondary);
}

.info-details a:hover {
    color: var(--accent);
}

/* Social Links */
.social-links {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.social-link {
    width: 44px;
    height: 44px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.social-link:hover {
    background: var(--accent);
    transform: translateY(-3px);
}

.social-link svg {
    width: 20px;
    height: 20px;
    color: var(--text-primary);
    transition: color var(--transition-fast);
}

.social-link:hover svg {
    color: #000;
}

/* Contact Form */
.contact-form {
    background: var(--bg-secondary);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    font-size: 15px;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-light);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-error {
    display: block;
    font-size: 12px;
    color: #ff6b6b;
    margin-top: 6px;
}

/* Submit Button */
.btn-submit {
    width: 100%;
    justify-content: center;
    position: relative;
}

.btn-submit .btn-loading {
    display: none;
}

.btn-submit.loading .btn-text,
.btn-submit.loading .btn-icon {
    opacity: 0;
}

.btn-submit.loading .btn-loading {
    display: block;
    position: absolute;
}

.spinner {
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Form Status */
.form-status {
    margin-top: 16px;
    padding: 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    display: none;
}

.form-status.success {
    display: block;
    background: rgba(0, 212, 170, 0.1);
    color: var(--accent);
}

.form-status.error {
    display: block;
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
}

/* Contact Responsive */
@media (max-width: 900px) {
    .contact-content {
        grid-template-columns: 1fr;
    }
}

/* ================================================
   11. FOOTER
   ================================================ */
.footer {
    padding: 60px 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
}

.footer-content {
    text-align: center;
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 16px;
}

.footer-text {
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.footer-copyright {
    font-size: 14px;
    color: var(--text-muted);
}

/* ================================================
   12. MUSIC PLAYER
   ================================================ */
.music-player {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 900;
}

.player-content {
    display: none;
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    width: 300px;
    animation: slideUp 0.3s ease;
}

.music-player.active .player-content {
    display: block;
}

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

.player-art {
    float: left;
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-right: 12px;
}

.player-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-info {
    overflow: hidden;
}

.track-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.track-artist {
    font-size: 12px;
    color: var(--text-muted);
}

.player-progress {
    clear: both;
    margin-top: 12px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    cursor: pointer;
}

.progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
}

.progress-bar::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.player-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 12px;
}

.control-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color var(--transition-fast);
}

.control-btn svg {
    width: 20px;
    height: 20px;
    color: var(--text-primary);
}

.control-btn:hover {
    background: var(--bg-tertiary);
}

.play-btn {
    width: 44px;
    height: 44px;
    background: var(--accent);
}

.play-btn svg {
    color: #000;
}

.play-btn .pause-icon {
    display: none;
}

.play-btn.playing .play-icon {
    display: none;
}

.play-btn.playing .pause-icon {
    display: block;
}

.player-volume {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.player-volume svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.volume-bar {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    cursor: pointer;
}

.volume-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
}

.volume-bar::-moz-range-thumb {
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Player Toggle */
.player-toggle {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 50px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-fast);
}

.player-toggle:hover {
    transform: scale(1.1);
}

.player-toggle svg {
    width: 24px;
    height: 24px;
    color: #000;
}

.player-toggle .close-icon {
    display: none;
}

.music-player.active .player-toggle .music-icon {
    display: none;
}

.music-player.active .player-toggle .close-icon {
    display: block;
}

.music-player.active .player-toggle {
    position: static;
    margin-top: 12px;
    margin-left: auto;
}

/* ================================================
   13. CHATBOT
   ================================================ */
.chatbot {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 900;
}

/* Chat Toggle */
.chat-toggle {
    width: 60px;
    height: 60px;
    background: var(--gradient-1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 212, 170, 0.4);
    transition: transform var(--transition-fast);
    position: relative;
}

.chat-toggle:hover {
    transform: scale(1.1);
}

.chat-toggle svg {
    width: 28px;
    height: 28px;
    color: #000;
}

.chat-toggle .close-icon {
    display: none;
}

.chatbot.active .chat-toggle .chat-icon {
    display: none;
}

.chatbot.active .chat-toggle .close-icon {
    display: block;
}

.chat-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    background: #ff6b6b;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot.active .chat-badge {
    display: none;
}

/* Chat Window */
.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 360px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: none;
    animation: slideUp 0.3s ease;
}

.chatbot.active .chat-window {
    display: block;
}

/* Chat Header */
.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--gradient-1);
}

.chat-avatar {
    position: relative;
}

.chat-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background: #22c55e;
    border: 2px solid var(--bg-secondary);
    border-radius: 50%;
}

.chat-info h4 {
    font-size: 16px;
    font-weight: 600;
    color: #000;
}

.chat-info span {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.6);
}

/* Chat Messages */
.chat-messages {
    height: 320px;
    overflow-y: auto;
    padding: 16px;
}

.message {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    flex-shrink: 0;
}

.message-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.message-content {
    max-width: 80%;
    background: var(--bg-tertiary);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border-top-left-radius: 4px;
}

.message.user .message-content {
    background: var(--accent-light);
    border-top-left-radius: var(--radius-md);
    border-top-right-radius: 4px;
}

.message-content p {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
}

.message-time {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.quick-action {
    padding: 8px 14px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    font-size: 13px;
    color: var(--text-primary);
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.quick-action:hover {
    background: var(--accent);
    color: #000;
}

/* Chat Input */
.chat-input-wrapper {
    display: flex;
    gap: 8px;
    padding: 16px;
    border-top: 1px solid var(--border);
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--radius-full);
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.chat-send {
    width: 44px;
    height: 44px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast);
}

.chat-send:hover {
    transform: scale(1.05);
}

.chat-send svg {
    width: 18px;
    height: 18px;
    color: #000;
}

/* Chatbot Responsive */
@media (max-width: 400px) {
    .chat-window {
        width: calc(100vw - 40px);
        right: -10px;
    }
}

/* ================================================
   14. BACK TO TOP
   ================================================ */
.back-to-top {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-fast);
    z-index: 800;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--accent);
}

.back-to-top svg {
    width: 20px;
    height: 20px;
    color: var(--text-primary);
    transition: color var(--transition-fast);
}

.back-to-top:hover svg {
    color: #000;
}

/* ================================================
   15. UTILITIES & ANIMATIONS
   ================================================ */

/* Section Header */
.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-tag {
    display: inline-block;
    padding: 6px 16px;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-full);
    margin-bottom: 16px;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 700;
    color: var(--text-primary);
}

.title-number {
    color: var(--accent);
    margin-right: 12px;
}

.section-desc {
    max-width: 600px;
    margin: 16px auto 0;
    color: var(--text-secondary);
}

/* Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger Animation */
.reveal:nth-child(1) { transition-delay: 0.1s; }
.reveal:nth-child(2) { transition-delay: 0.2s; }
.reveal:nth-child(3) { transition-delay: 0.3s; }
.reveal:nth-child(4) { transition-delay: 0.4s; }
.reveal:nth-child(5) { transition-delay: 0.5s; }
.reveal:nth-child(6) { transition-delay: 0.6s; }

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* Focus Visible */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Selection */
::selection {
    background: var(--accent);
    color: #000;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-dark);
}

/* ================================================
   13. CHATBOT (ĐÃ TỐI ƯU KÍCH THƯỚC & MOBILE)
   ================================================ */
.chatbot {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 900;
}

/* Chat Toggle */
.chat-toggle {
    width: 56px; /* Giảm nhẹ kích thước nút */
    height: 56px;
    background: var(--gradient-1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 212, 170, 0.4);
    transition: transform var(--transition-fast);
    position: relative;
    border: none;
    cursor: pointer;
}

.chat-toggle:hover { transform: scale(1.1); }
.chat-toggle svg { width: 26px; height: 26px; color: #000; }
.chat-toggle .close-icon { display: none; }
.chatbot.active .chat-toggle .chat-icon { display: none; }
.chatbot.active .chat-toggle .close-icon { display: block; }

.chat-badge {
    position: absolute;
    top: -2px; right: -2px;
    width: 18px; height: 18px;
    background: #ff6b6b; color: #fff;
    font-size: 10px; font-weight: 600;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.chatbot.active .chat-badge { display: none; }

/* Chat Window - GIẢM KÍCH THƯỚC MÀN HÌNH DESKTOP */
.chat-window {
    position: absolute;
    bottom: 70px; right: 0;
    width: 340px;  /* Giảm từ 380px xuống 340px */
    height: 480px; /* Giảm từ 600px xuống 480px */
    background: var(--bg-secondary);
    border-radius: var(--radius-md); /* Bo tròn nhẹ hơn cho gọn */
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: none;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}
.chatbot.active .chat-window { display: flex; }

/* Header */
.chat-header {
    display: flex; align-items: center; gap: 10px;
    padding: 12px; /* Giảm padding */
    background: var(--gradient-1);
    flex-shrink: 0;
}
.chat-avatar { position: relative; }
.chat-avatar img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; } /* Giảm size avatar */
.status-dot { width: 10px; height: 10px; }
.chat-info h4 { font-size: 15px; font-weight: 600; color: #000; margin: 0; } /* Giảm font */
.chat-info span { font-size: 11px; color: rgba(0, 0, 0, 0.6); }

/* Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px; /* Giảm padding */
    background: var(--bg-primary);
    display: flex; flex-direction: column; gap: 12px;
}

.message { display: flex; gap: 8px; }
.message.user { flex-direction: row-reverse; }
.message-avatar { flex-shrink: 0; }
.message-avatar img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; } /* Giảm size avatar tin nhắn */

.message-content {
    max-width: 85%;
    background: var(--bg-secondary);
    padding: 10px 14px; /* Giảm padding */
    border-radius: var(--radius-md);
    border-top-left-radius: 4px;
    box-shadow: var(--shadow-sm);
}
.message.user .message-content {
    background: var(--accent-light);
    border-top-left-radius: var(--radius-md);
    border-top-right-radius: 4px;
}

/* Font-size chính của tin nhắn */
.message-content p { 
    font-size: 13px; /* Giảm từ 14px xuống 13px cho gọn */
    color: var(--text-primary); 
    line-height: 1.5; 
    margin: 0; 
}
.message-time { 
    font-size: 9px; /* Giảm size time */
    color: var(--text-muted); 
    margin-top: 4px; 
    text-align: right; 
}

/* Input Wrapper */
.chat-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px; /* Giảm padding */
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.chat-action-btn {
    background: transparent;
    border: none;
    padding: 0;
    width: 34px; height: 34px; /* Giảm size nút */
    cursor: pointer;
    color: var(--text-muted);
    transition: color var(--transition-fast);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.chat-action-btn:hover { color: var(--accent); }
.chat-action-btn svg { width: 18px; height: 18px; } /* Giảm size icon */

/* File Preview */
.file-upload-wrapper { display: none; position: relative; }
.file-upload-wrapper.file-uploaded { display: inline-block; }
.file-upload-wrapper img { width: 35px; height: 35px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.file-upload-wrapper #file-cancel {
    position: absolute; top: -7px; right: -7px;
    width: 18px; height: 18px; border-radius: 50%;
    background: #ff6b6b; color: #fff; border: none;
    font-size: 12px; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}

/* Input Text */
.chat-input {
    flex: 1;
    height: 38px; /* Giảm height input */
    padding: 0 12px;
    background: var(--bg-tertiary);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 13px; /* Giảm font input */
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition-fast);
}
.chat-input:focus { border-color: var(--accent); }

/* Nút Gửi */
.chat-send {
    width: 38px; height: 38px; /* Giảm size nút gửi */
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}
.chat-send:hover { transform: scale(1.05); }
.chat-send svg { width: 18px; height: 18px; color: #000; }

/* Scroll to Bottom */
.scroll-to-bottom {
    position: absolute; bottom: 75px; right: 15px;
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    opacity: 0; visibility: hidden;
    transition: all var(--transition-fast);
    display: flex; align-items: center; justify-content: center;
    z-index: 10;
}
.scroll-to-bottom.show { opacity: 1; visibility: visible; }
.scroll-to-bottom svg { width: 14px; height: 14px; }

/* Thinking Indicator */
.thinking-indicator { display: flex; gap: 4px; padding: 5px 0; }
.thinking-indicator .dot { width: 6px; height: 6px; background: var(--accent); border-radius: 50%; animation: thinking 1.4s infinite ease-in-out both; }
.thinking-indicator .dot:nth-child(1) { animation-delay: -0.32s; }
.thinking-indicator .dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes thinking { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }

/* --- RESPONSIVE CHO ĐIỆN THOẠI --- */
@media (max-width: 480px) {
    .chat-window {
        width: calc(100vw - 20px); /* Chiếm gần hết màn hình */
        height: 65vh; /* Chiều cao 65% màn hình cho thoáng */
        right: -5px; /* Canh lề */
        bottom: 65px;
        border-radius: var(--radius-lg); /* Bo tròn hơn trên mobile */
    }
    
    /* Giảm font-size thêm cho mobile nếu cần */
    .message-content p { font-size: 13px; }
    .chat-input { font-size: 14px; } /* Font input trên mobile nên 14px trở lên để iOS không auto zoom */
    
    .chat-header { padding: 10px; }
    .chat-info h4 { font-size: 14px; }
    
   
    .scroll-to-bottom { display: none; }
}