/* ═══════════════════════════════════════════════════════
   KLYRA AI — Vanilla CSS (Converted from React/Tailwind)
   ═══════════════════════════════════════════════════════ */

:root {
    --void: #05060d;
    --surface: #0a0c18;
    --panel: rgba(10, 12, 28, 0.7);
    --cyan: #00d4ff;
    --cyan-dim: rgba(0, 212, 255, 0.15);
    --red: #ff3b5c;
    --red-dim: rgba(255, 59, 92, 0.15);
    --white: #f0f4ff;
    --white-dim: rgba(240, 244, 255, 0.1);
    --gold: #ffd166;
    --text-primary: #c8d8f0;
    --text-muted: rgba(200, 216, 240, 0.4);
    --border: rgba(0, 212, 255, 0.12);
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--void);
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ─── UTILITY ───────────────────────────────────── */
.hidden { display: none !important; }

/* ─── GRID OVERLAY ──────────────────────────────── */
.grid-overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.2;
}

/* ─── AURORA BLOBS ──────────────────────────────── */
.aurora {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.aurora-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.12;
    animation: drift 20s ease-in-out infinite;
}

.aurora-blob:nth-child(1) {
    width: 600px; height: 600px;
    background: #0048ff;
    top: -200px; left: -100px;
    animation-duration: 25s;
}

.aurora-blob:nth-child(2) {
    width: 500px; height: 500px;
    background: #00d4ff;
    top: 20%; right: -150px;
    animation-duration: 18s;
    animation-delay: -8s;
}

.aurora-blob:nth-child(3) {
    width: 400px; height: 400px;
    background: #7b2fff;
    bottom: -100px; left: 30%;
    animation-duration: 22s;
    animation-delay: -4s;
}

@keyframes drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(40px, -30px) scale(1.05); }
    66% { transform: translate(-30px, 20px) scale(0.95); }
}

/* ─── DECORATIVE CORNERS ────────────────────────── */
.corner-decor {
    position: fixed;
    width: 80px; height: 80px;
    pointer-events: none;
    z-index: 50;
}

.corner-decor.top-left {
    top: 32px; left: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.corner-decor.bottom-right {
    bottom: 32px; right: 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

/* ─── NAV ───────────────────────────────────────── */
#main-nav {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 50;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: white;
}

.nav-version {
    color: var(--cyan);
    font-weight: 300;
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    color: var(--cyan);
    text-transform: uppercase;
    text-decoration: none;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: white;
}

/* ─── HERO SECTION ──────────────────────────────── */
#hero {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100vh;
    width: 100vw;
    align-items: center;
    padding: 3rem 6rem;
    overflow: hidden;
}

.hero-text-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    animation: fadeInRight 0.8s ease-out;
    z-index: 5;
}

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

.hero-text {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hero-text h1 {
    font-size: clamp(3rem, 6vw, 5rem);
    font-weight: 900;
    text-transform: uppercase;
    color: white;
    line-height: 1.1;
}

.cyan-text {
    color: var(--cyan);
}

.hero-description {
    font-size: 1.15rem;
    color: rgba(200, 216, 240, 0.6);
    max-width: 500px;
    letter-spacing: 0.04em;
    line-height: 1.7;
}

/* ─── BUTTONS ───────────────────────────────────── */
.hero-buttons {
    display: flex;
    gap: 1rem;
}

.btn-primary {
    position: relative;
    padding: 1rem 2rem;
    background: var(--cyan);
    color: var(--void);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    border: none;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.btn-primary:hover {
    transform: scale(1.05);
}

.btn-shine {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-100%);
    transition: transform 0.5s;
}

.btn-primary:hover .btn-shine {
    transform: translateX(0);
}

.btn-content {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-hold {
    padding: 1rem 2rem;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-hold:hover {
    border-color: var(--cyan);
}

.btn-hold.listening {
    border-color: var(--cyan);
    background: rgba(0, 212, 255, 0.1);
    color: var(--cyan);
}

.btn-secondary {
    padding: 1rem 2rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* ─── STATUS BAR ────────────────────────────────── */
.status-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(0, 212, 255, 0.4);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot-small {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #4ade80;
    transition: background 0.3s;
}

.status-dot-small.listening { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.status-dot-small.speaking { background: var(--red); box-shadow: 0 0 8px var(--red); }
.status-dot-small.thinking { background: #c8d8f0; animation: blink 1s ease-in-out infinite; }

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

.status-divider {
    width: 1px; height: 16px;
    background: rgba(255, 255, 255, 0.1);
}

/* ─── AI CHARACTER (Left Panel) ────────────────── */
.hero-character {
    display: flex;
    height: 100%;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    animation: fadeInLeft 0.8s ease-out;
}

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

.character-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.character-glow {
    position: absolute;
    width: 400px; height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.33) 0%, transparent 70%);
    filter: blur(40px);
    z-index: 0;
    animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { transform: scale(1); opacity: 0.15; }
    50% { transform: scale(1.1); opacity: 0.3; }
}

.character-img {
    max-width: 450px;
    max-height: 80vh;
    width: auto;
    height: auto;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 0 30px rgba(0, 212, 255, 0.35));
    animation: charFloat 4s ease-in-out infinite;
    object-fit: contain;
}

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

/* ─── FLOATING CHAT BUTTON ──────────────────────── */
.chat-fab {
    position: fixed;
    bottom: 2.5rem; right: 2.5rem;
    width: 80px; height: 80px;
    border-radius: 50%;
    border: none;
    background: var(--cyan);
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.4);
    cursor: pointer;
    overflow: hidden;
    z-index: 100;
    transition: transform 0.3s ease;
    animation: fabIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fabIn {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

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

.fab-avatar {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

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

.fab-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: opacity 0.3s;
}

.chat-fab:hover .fab-overlay {
    opacity: 1;
}

/* ─── CHAT PANEL ────────────────────────────────── */
.chat-panel {
    position: fixed;
    bottom: 2.5rem; right: 2.5rem;
    width: 420px; height: 600px;
    background: var(--surface);
    border: 1px solid rgba(0, 212, 255, 0.2);
    box-shadow: 0 0 100px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    z-index: 100;
    border-radius: 12px;
    overflow: hidden;
    backdrop-filter: blur(60px);
    animation: chatOpen 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: bottom right;
}

@keyframes chatOpen {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.chat-panel.closing {
    animation: chatClose 0.3s ease-in forwards;
}

@keyframes chatClose {
    to {
        transform: scale(0);
        opacity: 0;
    }
}

/* ─── CHAT HEADER ───────────────────────────────── */
.chat-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 212, 255, 0.05);
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(0, 212, 255, 0.5);
}

.chat-header-title {
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    color: var(--cyan);
    text-transform: uppercase;
    font-weight: 700;
}

.chat-close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: color 0.3s;
    padding: 4px;
}

.chat-close-btn:hover {
    color: white;
}

/* ─── CHAT MESSAGES ─────────────────────────────── */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.2);
    border-radius: 4px;
}

.msg-wrapper {
    display: flex;
    flex-direction: column;
    animation: msgIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.msg-wrapper.msg-user {
    align-items: flex-end;
}

.msg-wrapper.msg-bot {
    align-items: flex-start;
}

.msg-sender {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 0.25rem;
}

.msg {
    max-width: 85%;
    padding: 1rem;
    border-radius: 12px;
    font-size: 0.875rem;
    line-height: 1.6;
}

.msg.bot {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-top-left-radius: 0;
}

.msg.user {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.2);
    color: white;
    border-top-right-radius: 0;
}

/* ─── CHAT INPUT ────────────────────────────────── */
.chat-input-zone {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-input-row {
    display: flex;
    gap: 0.5rem;
}

#user-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: white;
    font-family: 'Rajdhani', sans-serif;
    outline: none;
    transition: border-color 0.3s;
}

#user-input::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

#user-input:focus {
    border-color: rgba(0, 212, 255, 0.4);
}

.btn-send {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-send:hover {
    color: var(--cyan);
    border-color: rgba(0, 212, 255, 0.5);
}

/* ─── CHAT CONTROLS ─────────────────────────────── */
.chat-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.control-left, .control-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.4);
}

.control-left input[type="checkbox"] {
    accent-color: var(--cyan);
}

.control-left label {
    cursor: pointer;
}

#gender-select {
    background: transparent;
    color: var(--cyan);
    border: none;
    outline: none;
    cursor: pointer;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
}

#gender-select option {
    background: var(--void);
    color: var(--cyan);
}

/* ─── RESPONSIVE ────────────────────────────────── */
@media (max-width: 1024px) {
    #hero {
        grid-template-columns: 1fr;
        padding: 3rem 2rem;
    }

    .hero-character {
        display: none;
    }

    .hero-text h1 {
        font-size: 3rem;
    }

    .chat-panel {
        width: calc(100vw - 2rem);
        height: calc(100vh - 2rem);
        bottom: 1rem; right: 1rem;
        border-radius: 16px;
    }
}
