/* ===================================
   VARIABLES & ROOT STYLES
   =================================== */
:root {
    /* Primary Colors - Cyan/Teal Tech Theme */
    --primary: #00c8d4;
    --primary-rgb: 0, 200, 212;
    --primary-dark: #0099a8;
    --primary-glow: rgba(0, 200, 212, 0.4);

    /* Accent Colors */
    --accent: #e91e8c;
    --accent-rgb: 233, 30, 140;
    --accent-secondary: #6c2bd9;
    --accent-secondary-rgb: 108, 43, 217;

    /* Light Theme Colors */
    --bg-dark: #ffffff;
    --bg-darker: #f5f7fa;
    --bg-card: rgba(255, 255, 255, 0.9);
    --text-primary: #1a1a2e;
    --text-secondary: rgba(26, 26, 46, 0.7);
    --text-muted: rgba(26, 26, 46, 0.5);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--accent-secondary) 100%);
    --gradient-dark: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-darker) 100%);

    /* Typography */
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 8rem;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ===================================
   RESET & BASE
   =================================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ===================================
   BACKGROUND EFFECTS
   =================================== */
#particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.grid-background {
    display: none;
}

.scanlines {
    display: none;
}

/* ===================================
   LOADING SCREEN
   =================================== */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-darker);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

#loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-container {
    text-align: center;
    position: relative;
}

.loader-ring {
    position: absolute;
    border: 2px solid transparent;
    border-radius: 50%;
    animation: loaderSpin 2s linear infinite;
}

.loader-ring:nth-child(1) {
    width: 100px;
    height: 100px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-top-color: var(--primary);
    animation-duration: 1.5s;
}

.loader-ring:nth-child(2) {
    width: 130px;
    height: 130px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-right-color: var(--accent);
    animation-duration: 2s;
    animation-direction: reverse;
}

.loader-ring:nth-child(3) {
    width: 160px;
    height: 160px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-bottom-color: var(--accent-secondary);
    animation-duration: 2.5s;
}

@keyframes loaderSpin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.loader-text {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--primary);
    letter-spacing: 4px;
    margin-top: 120px;
    animation: textFlicker 1.5s ease-in-out infinite;
}

@keyframes textFlicker {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.loader-progress {
    width: 200px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin: 20px auto 0;
    overflow: hidden;
}

.loader-progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    width: 0%;
    animation: progressFill 2s ease-out forwards;
}

@keyframes progressFill {
    0% {
        width: 0%;
    }

    100% {
        width: 100%;
    }
}

/* ===================================
   HEADER
   =================================== */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: var(--space-sm) var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, transparent 100%);
    backdrop-filter: blur(10px);
}

.logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 2px;
}

.logo-bracket {
    color: var(--primary);
    animation: bracketPulse 2s ease-in-out infinite;
}

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

@keyframes bracketPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

nav {
    display: flex;
    gap: var(--space-md);
}

.nav-link {
    font-family: var(--font-display);
    font-size: 0.85rem;
    letter-spacing: 2px;
    padding: var(--space-xs) var(--space-sm);
    position: relative;
    transition: color var(--transition-normal);
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: all var(--transition-normal);
    transform: translateX(-50%);
}

.nav-link:hover::before,
.nav-link.active::before {
    width: 100%;
}

.nav-link:hover {
    color: var(--primary);
    text-shadow: 0 0 20px var(--primary-glow);
}

/* ===================================
   HERO SECTION
   =================================== */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

#robot-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    z-index: 10;
}

/* ===================================
   SKILL CARDS
   =================================== */
.skill-cards-container {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.skill-card {
    position: absolute;
    width: 220px;
    height: 280px;
    pointer-events: auto;
    perspective: 1000px;
    cursor: pointer;
    text-decoration: none;
}

.skill-card[data-position="top-left"] {
    top: 15%;
    left: 8%;
}

.skill-card[data-position="top-right"] {
    top: 15%;
    right: 8%;
}

.skill-card[data-position="bottom-left"] {
    bottom: 15%;
    left: 8%;
}

.skill-card[data-position="bottom-right"] {
    bottom: 15%;
    right: 8%;
}

.skill-card-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150%;
    height: 150%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-slow);
    filter: blur(30px);
}

.skill-card:hover .skill-card-glow {
    opacity: 0.6;
}

.skill-card-inner {
    width: 100%;
    height: 100%;
    background: var(--bg-card);
    border: 1px solid rgba(0, 200, 212, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
    backdrop-filter: blur(20px);
}

.skill-card-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.skill-card:hover .skill-card-inner::before {
    left: 100%;
}

.skill-card-inner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-normal);
}

.skill-card:hover .skill-card-inner::after {
    transform: scaleX(1);
}

.skill-card:hover .skill-card-inner {
    border-color: var(--primary);
    transform: translateY(-10px) scale(1.02);
    box-shadow:
        0 20px 60px rgba(0, 240, 255, 0.2),
        0 0 40px rgba(0, 240, 255, 0.1),
        inset 0 0 60px rgba(0, 240, 255, 0.05);
}

.skill-icon {
    width: 80px;
    height: 80px;
    color: var(--primary);
    transition: all var(--transition-normal);
    filter: drop-shadow(0 0 10px var(--primary-glow));
}

.skill-card:hover .skill-icon {
    transform: scale(1.1);
    filter: drop-shadow(0 0 20px var(--primary-glow));
}

.skill-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 3px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.skill-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
}

.skill-arrow {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border: 1px solid var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.2rem;
    opacity: 0;
    transform: translateX(-10px);
    transition: all var(--transition-normal);
}

.skill-card:hover .skill-arrow {
    opacity: 1;
    transform: translateX(0);
}

.skill-card-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

/* Card specific colors */
#skill-cloud .skill-card-glow {
    background: radial-gradient(circle, rgba(0, 200, 255, 0.5) 0%, transparent 70%);
}

#skill-mobile .skill-card-glow {
    background: radial-gradient(circle, rgba(123, 45, 255, 0.5) 0%, transparent 70%);
}

#skill-ai .skill-card-glow {
    background: radial-gradient(circle, rgba(255, 0, 170, 0.5) 0%, transparent 70%);
}

#skill-webdesign .skill-card-glow {
    background: radial-gradient(circle, rgba(0, 255, 136, 0.5) 0%, transparent 70%);
}

#skill-mobile .skill-icon {
    color: var(--accent-secondary);
    filter: drop-shadow(0 0 10px rgba(123, 45, 255, 0.5));
}

#skill-ai .skill-icon {
    color: var(--accent);
    filter: drop-shadow(0 0 10px rgba(255, 0, 170, 0.5));
}

#skill-webdesign .skill-icon {
    color: #00ff88;
    filter: drop-shadow(0 0 10px rgba(0, 255, 136, 0.5));
}

#skill-mobile .skill-title {
    background: linear-gradient(135deg, var(--accent-secondary) 0%, #a855f7 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

#skill-ai .skill-title {
    background: linear-gradient(135deg, var(--accent) 0%, #ff6b6b 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

#skill-webdesign .skill-title {
    background: linear-gradient(135deg, #00ff88 0%, #00d4aa 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

#skill-mobile .skill-arrow,
#skill-mobile .skill-card-inner::after {
    border-color: var(--accent-secondary);
}

#skill-mobile .skill-arrow {
    color: var(--accent-secondary);
}

#skill-mobile .skill-card-inner::after {
    background: linear-gradient(135deg, var(--accent-secondary) 0%, #a855f7 100%);
}

#skill-ai .skill-arrow,
#skill-ai .skill-card-inner::after {
    border-color: var(--accent);
}

#skill-ai .skill-arrow {
    color: var(--accent);
}

#skill-ai .skill-card-inner::after {
    background: linear-gradient(135deg, var(--accent) 0%, #ff6b6b 100%);
}

#skill-webdesign .skill-arrow,
#skill-webdesign .skill-card-inner::after {
    border-color: #00ff88;
}

#skill-webdesign .skill-arrow {
    color: #00ff88;
}

#skill-webdesign .skill-card-inner::after {
    background: linear-gradient(135deg, #00ff88 0%, #00d4aa 100%);
}

#skill-mobile:hover .skill-card-inner {
    border-color: var(--accent-secondary);
    box-shadow: 0 20px 60px rgba(123, 45, 255, 0.2), 0 0 40px rgba(123, 45, 255, 0.1);
}

#skill-ai:hover .skill-card-inner {
    border-color: var(--accent);
    box-shadow: 0 20px 60px rgba(255, 0, 170, 0.2), 0 0 40px rgba(255, 0, 170, 0.1);
}

#skill-webdesign:hover .skill-card-inner {
    border-color: #00ff88;
    box-shadow: 0 20px 60px rgba(0, 255, 136, 0.2), 0 0 40px rgba(0, 255, 136, 0.1);
}

/* ===================================
   HERO TEXT
   =================================== */
.hero-text {
    position: absolute;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 5;
}

.hero-subtitle {
    font-family: var(--font-display);
    font-size: 0.9rem;
    letter-spacing: 6px;
    color: var(--primary);
    margin-bottom: var(--space-sm);
    position: relative;
    display: inline-block;
}

.hero-subtitle::before,
.hero-subtitle::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40px;
    height: 1px;
    background: var(--gradient-primary);
}

.hero-subtitle::before {
    right: 100%;
    margin-right: 15px;
}

.hero-subtitle::after {
    left: 100%;
    margin-left: 15px;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: var(--space-sm);
}

.title-line {
    display: block;
    font-size: 3.5rem;
    letter-spacing: 8px;
}

.title-line.accent {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {

    0%,
    100% {
        filter: drop-shadow(0 0 20px var(--primary-glow));
    }

    50% {
        filter: drop-shadow(0 0 40px var(--primary-glow));
    }
}

.hero-description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
}

/* ===================================
   SCROLL INDICATOR
   =================================== */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0.6;
    animation: scrollBounce 2s infinite;
}

@keyframes scrollBounce {

    0%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    50% {
        transform: translateX(-50%) translateY(10px);
    }
}

.mouse {
    width: 26px;
    height: 42px;
    border: 2px solid var(--primary);
    border-radius: 20px;
    position: relative;
}

.wheel {
    width: 4px;
    height: 8px;
    background: var(--primary);
    border-radius: 2px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 8px;
    animation: wheelScroll 1.5s infinite;
}

@keyframes wheelScroll {
    0% {
        opacity: 1;
        top: 8px;
    }

    100% {
        opacity: 0;
        top: 22px;
    }
}

.scroll-indicator span {
    font-family: var(--font-display);
    font-size: 0.7rem;
    letter-spacing: 3px;
    color: var(--primary);
}

/* ===================================
   FOOTER
   =================================== */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: var(--space-sm) var(--space-lg);
    background: linear-gradient(0deg, rgba(255, 255, 255, 0.95) 0%, transparent 100%);
    z-index: 100;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.social-links {
    display: flex;
    gap: var(--space-md);
}

.social-link {
    font-family: var(--font-display);
    font-size: 0.75rem;
    letter-spacing: 2px;
    transition: all var(--transition-normal);
    position: relative;
}

.social-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--primary);
    transition: width var(--transition-normal);
}

.social-link:hover {
    color: var(--primary);
}

.social-link:hover::after {
    width: 100%;
}

/* ===================================
   GLITCH EFFECT
   =================================== */
[data-glitch] {
    position: relative;
}

[data-glitch]:hover::before,
[data-glitch]:hover::after {
    content: attr(data-glitch);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

[data-glitch]:hover::before {
    color: var(--primary);
    animation: glitch-1 0.3s infinite;
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
}

[data-glitch]:hover::after {
    color: var(--accent);
    animation: glitch-2 0.3s infinite;
    clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
}

@keyframes glitch-1 {

    0%,
    100% {
        transform: translate(0);
    }

    20% {
        transform: translate(-2px, 2px);
    }

    40% {
        transform: translate(-2px, -2px);
    }

    60% {
        transform: translate(2px, 2px);
    }

    80% {
        transform: translate(2px, -2px);
    }
}

@keyframes glitch-2 {

    0%,
    100% {
        transform: translate(0);
    }

    20% {
        transform: translate(2px, -2px);
    }

    40% {
        transform: translate(2px, 2px);
    }

    60% {
        transform: translate(-2px, -2px);
    }

    80% {
        transform: translate(-2px, 2px);
    }
}

/* ===================================
   PARTICLES
   =================================== */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
    pointer-events: none;
    animation: particleFloat 6s infinite ease-in-out;
}

@keyframes particleFloat {

    0%,
    100% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-100vh) translateX(50px) scale(0.5);
        opacity: 0;
    }
}

/* ===================================
   RESPONSIVE
   =================================== */
@media (max-width: 1200px) {
    .skill-card {
        width: 180px;
        height: 240px;
    }

    .skill-icon {
        width: 60px;
        height: 60px;
    }

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

@media (max-width: 992px) {
    #hero {
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 100px;
        height: auto;
        overflow-y: visible;
        /* Allow scrolling */
    }

    /* Robot diventa relativo e sta in alto */
    #robot-container {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        width: 250px;
        height: 250px;
        margin: 0 auto 20px auto;
        z-index: 5;
    }

    /* Testo diventa relativo sotto il robot */
    .hero-text {
        position: relative;
        bottom: auto;
        left: auto;
        transform: none;
        margin-bottom: 40px;
        z-index: 6;
    }

    .title-line {
        font-size: 2.5rem;
    }

    /* Le card diventano relative sotto il testo */
    .skill-cards-container {
        position: relative;
        height: auto;
        margin-top: 0;
        padding: 0 20px 100px 20px;
        /* Space for footer/chat */
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        /* 2 colonne su tablet */
        gap: 20px;
        pointer-events: auto;
    }

    .skill-card[data-position="top-left"],
    .skill-card[data-position="top-right"],
    .skill-card[data-position="bottom-left"],
    .skill-card[data-position="bottom-right"] {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        bottom: auto;
        width: 100%;
        height: 220px;
    }
}

@media (max-width: 768px) {
    header {
        padding: 15px 20px;
    }

    .logo {
        font-size: 1.2rem;
    }

    .title-line {
        font-size: 2rem;
        letter-spacing: 4px;
    }

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

    /* Su mobile stretto, una sola colonna per le card */
    .skill-cards-container {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .skill-card {
        max-width: 320px;
        margin: 0 auto;
    }

    .footer-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        padding-bottom: 80px;
        /* Space for chat button */
    }

    /* Nascondi solo se necessario per pulizia */
    .hero-description {
        padding: 0 20px;
        font-size: 1rem;
    }
}

/* ===================================
   MAIN CONTENT VISIBILITY
   =================================== */
#main-content {
    opacity: 0;
    transition: opacity 0.5s ease;
}

#main-content.visible {
    opacity: 1;
}

/* ===================================
   CHAT WIDGET
   =================================== */
#chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: var(--font-body);
}

/* Chat Toggle Button */
.chat-toggle-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: linear-gradient(135deg, #4F6AF6 0%, #6366f1 100%);
    border: none;
    border-radius: 50px;
    color: white;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(79, 106, 246, 0.4);
    transition: all 0.3s ease;
}

.chat-toggle-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(79, 106, 246, 0.5);
}

.chat-toggle-icon {
    font-size: 1.2rem;
}

.chat-toggle-arrow {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

#chat-widget.open .chat-toggle-btn {
    display: none;
}

/* Chat Window */
.chat-window {
    display: none;
    flex-direction: column;
    width: 380px;
    height: 550px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    animation: chatSlideIn 0.3s ease;
}

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

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#chat-widget.open .chat-window {
    display: flex;
}

/* Chat Header */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #ffffff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #4F6AF6 0%, #6366f1 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
}

.chat-header-info {
    display: flex;
    flex-direction: column;
}

.chat-title {
    font-weight: 700;
    font-size: 1rem;
    color: #1a1a2e;
}

.chat-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #22c55e;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.chat-close-btn {
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fc;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-message {
    max-width: 85%;
    animation: messageSlide 0.3s ease;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.bot {
    align-self: flex-start;
}

.chat-message.user {
    align-self: flex-end;
}

.message-content {
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.chat-message.bot .message-content {
    background: #ffffff;
    color: #1a1a2e;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-bottom-left-radius: 6px;
}

.chat-message.user .message-content {
    background: linear-gradient(135deg, #4F6AF6 0%, #6366f1 100%);
    color: white;
    border-bottom-right-radius: 6px;
}

/* Chat Input */
.chat-input-container {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.chat-input {
    flex: 1;
    padding: 14px 18px;
    background: #f8f9fc;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 50px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: #1a1a2e;
    outline: none;
    transition: all 0.2s ease;
}

.chat-input::placeholder {
    color: #999;
}

.chat-input:focus {
    border-color: #4F6AF6;
    box-shadow: 0 0 0 3px rgba(79, 106, 246, 0.15);
}

.chat-send-btn {
    width: 46px;
    height: 46px;
    background: linear-gradient(135deg, #4F6AF6 0%, #6366f1 100%);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(79, 106, 246, 0.4);
}

.chat-send-btn:active {
    transform: scale(0.95);
}

/* Chat Disclaimer */
.chat-disclaimer {
    padding: 10px 20px;
    background: #ffffff;
    text-align: center;
    font-size: 0.75rem;
    color: #999;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 14px 18px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 18px;
    border-bottom-left-radius: 6px;
    width: fit-content;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #4F6AF6;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
    animation-delay: 0s;
}

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

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

@keyframes typingBounce {

    0%,
    80%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    40% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 480px) {
    #chat-widget {
        bottom: 20px;
        right: 20px;
        left: 20px;
    }

    .chat-window {
        width: 100%;
        height: 70vh;
        max-height: 500px;
    }

    .chat-toggle-btn {
        width: 100%;
        justify-content: center;
    }
}