/* index.css - REACTIVE ULTRA Black & White Design */
/* Fonts loaded via index.html <link> — no @import needed */

/* Global box-sizing reset */
*, *::before, *::after {
    box-sizing: border-box;
}

/* === Custom Scrollbar — Black track, white thumb === */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #000;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    border: 2px solid #000;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.7);
}

::-webkit-scrollbar-corner {
    background: #000;
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.4) #000;
}

:root {
    --app-bg: #000000; 
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent: #ffffff;
    --border-color: #fff;
    --card-bg: rgba(0, 0, 0, 0.8);
    
    --font-sans: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

html, body {
    height: 100%; margin: 0; padding: 0;
    font-family: var(--font-sans);
    background-color: var(--app-bg);
    color: var(--text-primary);
    overflow-x: hidden;
    overflow-y: hidden;
}

#root {
    height: 100vh;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

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

.spin-icon {
    animation: spin 0.8s linear infinite;
}

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

/* === Immersive App Container === */
.immersive-app {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: flex-start;
    overflow: hidden;
    background-color: var(--app-bg);
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: #000;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 10;
    backdrop-filter: blur(20px);
    transition: transform 0.3s ease;
}

.sidebar-logo {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #fff;
}

.sidebar-section {
    padding: 24px 16px 8px 16px;
    display: flex;
    flex-direction: column;
}

.new-chat-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: 0;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
}

.new-chat-btn:hover {
    background: var(--text-primary);
    color: var(--app-bg);
}

/* GSC Dashboard sidebar button */
.gsc-sidebar-btn {
    width: calc(100% - 32px);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 16px 4px;
    padding: 12px 14px;
    background: linear-gradient(135deg, rgba(255,170,0,0.08) 0%, rgba(255,170,0,0.03) 100%);
    border: 1px solid rgba(255,170,0,0.25);
    border-radius: 8px;
    color: #ffaa00;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    animation: gsc-btn-glow 3s ease-in-out infinite;
}

.gsc-sidebar-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 40%, rgba(255,170,0,0.06) 50%, transparent 60%);
    animation: gsc-shimmer 4s ease-in-out infinite;
}

.gsc-sidebar-btn:hover {
    background: linear-gradient(135deg, rgba(255,170,0,0.18) 0%, rgba(255,170,0,0.08) 100%);
    border-color: rgba(255,170,0,0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(255,170,0,0.15);
}

.gsc-badge {
    margin-left: auto;
    padding: 2px 7px;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    background: rgba(255,170,0,0.2);
    border: 1px solid rgba(255,170,0,0.4);
    border-radius: 3px;
    color: #ffaa00;
    animation: gsc-badge-pulse 2s ease-in-out infinite;
}

@keyframes gsc-btn-glow {
    0%, 100% { box-shadow: 0 0 8px rgba(255,170,0,0.05); }
    50% { box-shadow: 0 0 16px rgba(255,170,0,0.12); }
}

@keyframes gsc-shimmer {
    0% { transform: translateX(-100%) rotate(45deg); }
    30%, 100% { transform: translateX(100%) rotate(45deg); }
}

@keyframes gsc-badge-pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.sidebar-title {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin: 0 0 12px 8px;
}

.mode-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mode-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 0;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.mode-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.mode-item.active {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
    color: var(--text-primary);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.05);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid #fff;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-footer-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 0;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
}

.sidebar-footer-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 8px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 0;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
    font-size: 0.9rem;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.history-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.history-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-delete-btn {
    opacity: 0;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    padding: 2px;
    margin-left: auto;
    flex-shrink: 0;
    transition: all 0.2s;
}

.history-item:hover .history-delete-btn {
    opacity: 1;
}

.history-delete-btn:hover {
    color: #ff4444;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.main-content {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Reactive Background - Ultra High Contrast */
.reactive-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(
        400px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(255, 255, 255, 0.08),
        transparent 80%
    );
    transition: background 0.05s ease-out;
}

/* Grid pattern for technical feel */
.immersive-app::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

/* === Stage === */
.stage-container {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

/* === Start Screen === */
.empty-state {
    position: absolute;
    inset: 0;
    display: flex; align-items: center; justify-content: center;
    text-align: center;
}

.empty-content {
    display: flex; flex-direction: column; align-items: center; gap: 32px;
    width: 100%;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.logo-icon {
    width: 80px;
    height: 80px;
    background: transparent;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 2.5rem;
    color: white;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
}

.logo-icon::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: rotate(45deg);
    animation: shine 4s infinite linear;
}

@keyframes shine {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.empty-content h1 { 
    font-family: var(--font-mono);
    color: var(--text-primary); 
    font-weight: 700; 
    letter-spacing: 0.2em; 
    font-size: 4rem;
    margin: 0;
    text-transform: uppercase;
}

.empty-content .description {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    max-width: 500px;
    line-height: 1.8;
    margin: 0;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* === Session Group === */
.session-group {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.artifact-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 900px;
    height: calc(100vh - 56px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 160px 32px 180px 32px;
    margin: 0 auto;
    box-sizing: border-box;
}


/* === Artifact Card — Transparent, full-width flow === */
.artifact-card {
    background: transparent;
    backdrop-filter: none;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 32px 0;
    position: relative;
    box-shadow: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-x: hidden;
    overflow-wrap: break-word;
    word-break: break-word;
    min-width: 0;
    box-sizing: border-box;
    width: 100%;
}

.artifact-card:hover {
    border-bottom-color: rgba(255, 255, 255, 0.25);
}

.artifact-header {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 12px;
}

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

.artifact-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.artifact-icon {
    color: white;
}

.copy-button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #fff;
    color: var(--text-secondary);
    height: 32px;
    padding: 0 12px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-button:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #fff;
    color: white;
}

.artifact-style-tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-secondary);
}

.artifact-content {
    font-family: var(--font-sans);
    line-height: 1.8;
    color: var(--text-primary);
    overflow-wrap: break-word;
    word-break: break-word;
    min-width: 0;
}

.artifact-sections {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
    overflow-wrap: break-word;
    word-break: break-word;
    min-width: 0;
}

.copyable-section {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0;
    overflow: hidden;
    transition: border-color 0.2s;
}

.copyable-section:hover {
    border-color: rgba(255, 255, 255, 0.35);
}

.copyable-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.copyable-header h3 {
    margin: 0;
    font-size: 0.85rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 500px));
    justify-content: center;
    gap: 32px;
    align-items: stretch;
}

.copy-button-small {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.copy-button-small:hover {
    color: white;
}

.variant-copy-buttons {
    display: flex;
    gap: 6px;
    padding: 8px 16px 12px;
    flex-wrap: wrap;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.variant-copy-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.7rem;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all 0.2s;
}

.variant-copy-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.85);
}

.copyable-content {
    padding: 16px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-primary);
    overflow-wrap: break-word;
    word-break: break-word;
}

.artifact-content h1, .artifact-content h2, .artifact-content h3 {
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: white;
    border-left: 4px solid white;
    padding-left: 16px;
    margin-top: 32px;
}

/* === Floating Input === */
.floating-input-container {
    position: absolute;
    bottom: 60px;
    width: 100%;
    display: flex; justify-content: center;
    z-index: 100;
}

.input-wrapper {
    width: 100%; max-width: 700px;
    background: #000;
    backdrop-filter: blur(20px);
    border: 1px solid #fff;
    padding: 12px 12px 12px 24px;
    display: flex; align-items: center;
    gap: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: white;
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.1);
}

.input-wrapper input {
    flex: 1; background: transparent; border: none; outline: none;
    color: white; font-size: 1rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.send-button {
    width: 48px; height: 48px;
    background: white; color: black;
    border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s ease;
}
.send-button:hover { background: #cccccc; transform: scale(1.1); }
.send-button:disabled { opacity: 0.1; cursor: not-allowed; }

/* Markdown Styling */
.markdown-body h1, .markdown-body h2, .markdown-body h3 {
    font-family: var(--font-mono);
    color: white;
    margin-top: 2em;
    margin-bottom: 1em;
}
.markdown-body p { margin-bottom: 1.5em; font-size: 0.95rem; }
.markdown-body strong { font-weight: 700; color: white; }
.markdown-body ul { list-style: square; padding-left: 20px; }
.markdown-body li { margin-bottom: 0.5em; }

/* Loading State */
.input-generating-label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

@keyframes spin { to { transform: rotate(360deg); } }
.spin-icon { animation: spin 1s linear infinite; }

/* === Navigation === */
.landing-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    padding: 20px 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    background: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent);
    backdrop-filter: blur(4px);
}

.logo-container-small {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon-small {
    width: 32px;
    height: 32px;
    border: 1px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.2rem;
    color: white;
}

.logo-text {
    font-family: var(--font-mono);
    font-weight: 700;
    letter-spacing: 0.1em;
    font-size: 1.2rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: color 0.2s;
}

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

/* Legacy select-based selector (kept for compatibility) */
.language-selector {
    background: transparent;
    border: none;
    color: white;
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
    font-weight: 500;
    margin-right: 1rem;
}

.language-selector option {
    background-color: #111;
    color: white;
}

/* === Custom Language Dropdown with Flags === */
.lang-dropdown {
    position: relative;
    margin-right: 1rem;
}

.lang-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.25);
    color: white;
    padding: 5px 10px 5px 8px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s;
    height: 32px;
}

.lang-dropdown-toggle:hover {
    border-color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.06);
}

.lang-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #0a0a0a;
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
    min-width: 220px;
    max-height: 420px;
    overflow-y: auto;
    z-index: 200;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.15s ease-out;
}

.lang-dropdown-item {
    display: grid;
    grid-template-columns: 24px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.65);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    text-align: left;
    width: 100%;
}

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

.lang-dropdown-item:hover {
    background: rgba(255,255,255,0.07);
    color: white;
}

.lang-dropdown-item.active {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left: 2px solid white;
    padding-left: 12px;
}

.lang-dropdown-item .lang-label {
    text-align: left;
}

.lang-dropdown-item .lang-code {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    opacity: 0.35;
    letter-spacing: 0.08em;
    min-width: 22px;
    text-align: right;
}

.nav-button {
    background: transparent;
    color: white;
    border: 1px solid white;
    padding: 8px 24px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-button:hover {
    background: white;
    color: black;
}

.demo-glitch-btn {
    animation: demo-glitch 4s ease-in-out infinite;
}

@keyframes demo-glitch {
    0%, 100% { border-color: rgba(255,255,255,0.4); text-shadow: none; }
    45% { border-color: rgba(255,255,255,0.4); text-shadow: none; }
    50% { border-color: #fff; text-shadow: 0 0 8px rgba(255,255,255,0.6); }
    55% { border-color: rgba(255,255,255,0.2); text-shadow: -1px 0 rgba(255,255,255,0.3); }
    60% { border-color: #fff; text-shadow: 1px 0 rgba(255,255,255,0.5); }
    65% { border-color: rgba(255,255,255,0.4); text-shadow: none; }
}

/* === Product Hunt Badge Glitch Effect === */
.ph-badge-link {
    position: relative;
    display: inline-block;
    padding: 3px;
    transition: transform 0.2s ease;
}

.ph-badge-link:hover {
    transform: scale(1.05);
}

.ph-glitch-border {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(255,255,255,0.6);
    pointer-events: none;
    z-index: 2;
    animation: ph-glitch 5s ease-in-out infinite;
}

.ph-glitch-border::before,
.ph-glitch-border::after {
    content: '';
    position: absolute;
    inset: -2px;
    border: 1px solid rgba(255,255,255,0.15);
    pointer-events: none;
}

.ph-glitch-border::before {
    animation: ph-glitch-offset 5s ease-in-out infinite;
}

.ph-glitch-border::after {
    animation: ph-glitch-offset 5s ease-in-out infinite reverse;
}

@keyframes ph-glitch {
    0%, 100% { border-color: rgba(255,255,255,0.4); box-shadow: none; }
    40% { border-color: rgba(255,255,255,0.4); box-shadow: none; }
    45% { border-color: #fff; box-shadow: 0 0 12px rgba(255,255,255,0.4), inset 0 0 12px rgba(255,255,255,0.05); }
    47% { border-color: rgba(255,255,255,0.1); box-shadow: none; transform: translate(1px, 0); }
    49% { border-color: #fff; box-shadow: 0 0 8px rgba(255,255,255,0.3); transform: translate(-1px, 0); }
    51% { border-color: rgba(255,255,255,0.6); box-shadow: 0 0 4px rgba(255,255,255,0.2); transform: translate(0, 0); }
    55% { border-color: rgba(255,255,255,0.4); box-shadow: none; }
}

@keyframes ph-glitch-offset {
    0%, 100% { opacity: 0; transform: translate(0, 0); }
    44% { opacity: 0; }
    45% { opacity: 1; transform: translate(2px, -1px); }
    47% { opacity: 0.5; transform: translate(-1px, 1px); }
    49% { opacity: 1; transform: translate(1px, 0); }
    51% { opacity: 0; transform: translate(0, 0); }
}


/* === Trial CTA Glow Pulse === */
.cta-trial-glow {
    animation: cta-glow-pulse 2.5s ease-in-out infinite;
    font-weight: 700 !important;
}

@keyframes cta-glow-pulse {
    0%, 100% { box-shadow: 0 0 15px rgba(255,255,255,0.15); }
    50% { box-shadow: 0 0 30px rgba(255,255,255,0.4), 0 0 60px rgba(255,255,255,0.1); }
}

/* === Hero Section === */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    /* Top padding ensures content never hides behind fixed nav (~80px) */
    padding: 100px 20px 40px;
    position: relative;
    z-index: 10;
    box-sizing: border-box;
}

.hero-content {
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.hero-logo {
    margin-bottom: 12px;
}

.hero-title {
    font-family: var(--font-mono);
    font-size: 5rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    line-height: 1.1;
    margin: 0;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 600px;
    margin: 0;
}

/* === Responsive: smaller desktop widths === */
@media (max-width: 1024px) {
    .landing-nav {
        padding: 16px 32px;
    }
    .hero-title {
        font-size: 3.8rem;
    }
}

@media (max-width: 768px) {
    .landing-nav {
        padding: 14px 20px;
    }
    .hero-section {
        padding: 80px 20px 32px;
    }
    .hero-title {
        font-size: 2.8rem;
    }
    .hero-subtitle {
        font-size: 1rem;
    }
}

/* === Responsive: short viewport height (small monitors, zoom-in) === */
@media (max-height: 700px) {
    .hero-section {
        padding-top: 90px;
        min-height: auto;
        padding-bottom: 40px;
    }
    .hero-title {
        font-size: 3.2rem;
    }
    .logo-icon.hero-logo {
        width: 60px;
        height: 60px;
        font-size: 1.8rem;
        margin-bottom: 0;
    }
    .hero-content {
        gap: 16px;
    }
}

@media (max-height: 550px) {
    .hero-section {
        padding-top: 80px;
    }
    .hero-title {
        font-size: 2.4rem;
    }
    .logo-icon.hero-logo {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
    }
}

.cta-button {
    background: white;
    color: black;
    border: none;
    padding: 16px 40px;
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
    margin-top: 16px;
}

.cta-button:hover {
    transform: scale(1.05);
    background: #e0e0e0;
}

/* === Features Section === */
.features-section {
    padding: 120px 20px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

.section-title {
    font-family: var(--font-mono);
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 80px;
    letter-spacing: 0.1em;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.feature-card {
    background: #000;
    border: 1px solid white;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: all 0.3s;
}

.feature-card:hover {
    background: #111;
    border-color: white;
    transform: translateY(-5px);
}

.feature-icon {
    color: white;
}

.feature-card h3 {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    margin: 0;
    letter-spacing: 0.05em;
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* === Pricing Section === */
.pricing-section {
    padding: 120px 20px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 400px));
    justify-content: center;
    gap: 32px;
    align-items: center;
}

.pricing-card {
    background: #000;
    border: 1px solid white;
    padding: 48px 40px;
    position: relative;
    transition: all 0.3s;
}

.pricing-card:hover {
    border-color: white;
}

.pricing-card.popular {
    border-color: white;
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.1);
}

.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    color: black;
    padding: 4px 16px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.pricing-header {
    margin-bottom: 32px;
    text-align: center;
}

.pricing-header h3 {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    margin: 0 0 16px 0;
    letter-spacing: 0.1em;
}

.price {
    font-size: 3rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

.price span {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin: 0 0 40px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pricing-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
}

.pricing-features li svg {
    color: white;
}

.pricing-button {
    width: 100%;
    padding: 16px;
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    font-family: var(--font-mono);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.pricing-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
}

.pricing-button:hover::before {
    width: 300%;
    height: 300%;
}

.pricing-button:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.7);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1), inset 0 0 20px rgba(255, 255, 255, 0.03);
    transform: translateY(-2px);
}

.pricing-button.primary {
    background: white;
    color: black;
    border-color: white;
    animation: cta-glow-pulse 2.5s ease-in-out infinite;
}

.pricing-button.primary::before {
    background: rgba(0, 0, 0, 0.06);
}

.pricing-button.primary:hover {
    background: #f0f0f0;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.3), 0 0 60px rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.pricing-button.ultra-btn {
    border-color: rgba(255, 170, 0, 0.5);
    color: #ffaa00;
    animation: ultra-glow-pulse 3s ease-in-out infinite;
}

.pricing-button.ultra-btn::before {
    background: rgba(255, 170, 0, 0.06);
}

.pricing-button.ultra-btn:hover {
    border-color: #ffaa00;
    box-shadow: 0 0 25px rgba(255, 170, 0, 0.25), 0 0 50px rgba(255, 170, 0, 0.08);
    transform: translateY(-2px);
}

@keyframes ultra-glow-pulse {
    0%, 100% { box-shadow: 0 0 12px rgba(255, 170, 0, 0.1); }
    50% { box-shadow: 0 0 25px rgba(255, 170, 0, 0.2), 0 0 50px rgba(255, 170, 0, 0.05); }
}

.pricing-card {
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s ease;
}

.pricing-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* === Footer === */
.landing-footer {
    padding: 60px 20px;
    text-align: center;
    border-top: 1px solid #fff;
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.landing-footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

/* === Login Page === */
.login-container {
    background: #000;
    backdrop-filter: blur(20px);
    border: 1px solid #fff;
    padding: 60px;
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    z-index: 10;
}

.login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
}

.input-group input,
.input-group textarea {
    background: #000;
    border: 1px solid #fff;
    padding: 16px;
    color: white;
    font-family: var(--font-sans);
    font-size: 1rem;
    transition: all 0.2s;
    border-radius: 0;
}

.input-group input:focus,
.input-group textarea:focus {
    outline: none;
    border-color: white;
    background: #111;
}

.login-button {
    background: white;
    color: black;
    border: none;
    padding: 16px;
    font-family: var(--font-mono);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
    transition: all 0.2s;
}

.login-button:hover:not(:disabled) {
    background: #e0e0e0;
}

.login-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.login-footer {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.login-footer a {
    color: white;
    text-decoration: none;
    font-weight: 500;
}

.login-footer a:hover {
    text-decoration: underline;
}
.animated-placeholder {
    position: absolute;
    left: 24px;
    pointer-events: none;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.5;
}

.placeholder-text {
    display: inline-block;
}

.hidden {
    display: none !important;
}

.active-session {
    display: flex !important;
    animation: fadeIn 0.5s ease-out;
}

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

/* === Mobile Responsiveness === */
.mobile-header {
    display: none;
}

.mobile-menu-btn {
    display: none;
}

/* === Landing page scrolling override === */
.immersive-app.overflow-auto {
    overflow: auto !important;
    display: block !important;
}

.immersive-app.overflow-auto html,
.immersive-app.overflow-auto body {
    overflow: auto;
}

/* === Tablet: 1024px === */
@media (max-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
    
    .hero-title {
        font-size: 3.5rem;
    }
    
    .section-title {
        font-size: 2rem;
        margin-bottom: 48px;
    }
    
    .landing-nav {
        padding: 16px 24px;
    }
}

/* === Mobile: 768px === */
@media (max-width: 768px) {
    /* Allow scrolling on landing page */
    html, body {
        overflow: auto !important;
        height: auto !important;
    }
    
    /* Mobile Header for App view */
    .mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 16px;
        background: #000;
        border-bottom: 1px solid var(--border-color);
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 200;
        height: 56px;
        box-sizing: border-box;
    }
    
    .mobile-menu-btn {
        background: transparent;
        border: 1px solid rgba(255,255,255,0.3);
        color: white;
        padding: 8px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s;
    }
    
    .mobile-menu-btn:hover {
        border-color: white;
        background: rgba(255,255,255,0.1);
    }
    
    .mobile-logo {
        display: flex;
        align-items: center;
        gap: 8px;
        cursor: pointer;
    }
    
    .desktop-only {
        display: none !important;
    }

    /* === Landing Page Navigation === */
    .landing-nav {
        padding: 12px 16px;
        flex-direction: column;
        gap: 0;
        background: rgba(0,0,0,0.97);
        backdrop-filter: blur(20px);
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
    }
    
    .landing-nav-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }
    
    .mobile-menu-btn {
        display: flex !important;
    }
    
    .nav-links {
        flex-direction: column;
        width: 100%;
        gap: 0;
        padding-top: 0;
        display: none;
        align-items: stretch;
        border-top: 1px solid rgba(255,255,255,0.2);
        margin-top: 12px;
    }
    
    .nav-links a, .nav-links select {
        width: 100%;
        text-align: left;
        padding: 14px 0;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }

    .lang-dropdown {
        width: 100%;
        margin-right: 0;
        padding: 10px 0;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }

    .lang-dropdown-toggle {
        width: 100%;
        justify-content: flex-start;
        border: none;
        padding: 4px 0;
    }

    .lang-dropdown-menu {
        position: static;
        background: rgba(20,20,20,0.98);
        border: none;
        border-top: 1px solid rgba(255,255,255,0.1);
        margin-top: 8px;
        max-height: 240px;
    }
    
    .nav-links button {
        width: 100%;
        text-align: center;
        margin-top: 12px;
        padding: 14px 24px;
    }
    
    .nav-links.open {
        display: flex;
        animation: slideDown 0.3s ease;
    }
    
    @keyframes slideDown {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
    }
    
    /* === Hero Section === */
    .hero-section {
        min-height: 100svh;
        padding: 0 16px;
    }
    
    .hero-content {
        padding: 100px 8px 40px;
        gap: 24px;
    }
    
    .hero-title {
        font-size: 2.8rem;
        line-height: 1.05;
        letter-spacing: 0.05em;
        word-break: break-word;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
        padding: 0;
        line-height: 1.6;
    }
    
    .hero-logo .logo-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    
    .cta-button {
        width: 100%;
        justify-content: center;
        padding: 16px 32px;
        font-size: 0.9rem;
    }
    
    /* === Features Section === */
    .features-section {
        padding: 80px 16px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .feature-card {
        padding: 24px 20px;
    }
    
    .feature-card h3 {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.8rem;
        margin-bottom: 40px;
    }
    
    /* === Pricing Section === */
    .pricing-section {
        padding: 80px 16px;
    }
    
    .pricing-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .pricing-card {
        padding: 32px 24px;
    }
    
    .pricing-card.popular {
        transform: none;
        order: -1;
    }
    
    .price {
        font-size: 2.5rem;
    }
    
    /* === Contact Grid === */
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    /* === Footer === */
    .landing-footer {
        padding: 40px 16px;
    }
    
    .landing-footer div {
        gap: 0.5rem !important;
    }
    
    /* === Main App View === */
    .immersive-app:not(.overflow-auto) {
        flex-direction: column;
        padding-top: 56px;
    }
    
    .sidebar {
        position: fixed;
        top: 56px;
        left: 0;
        width: 85%;
        max-width: 320px;
        height: calc(100vh - 56px);
        height: calc(100svh - 56px);
        background: #000;
        border-right: 1px solid var(--border-color);
        z-index: 150;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 20px 0 60px rgba(0, 0, 0, 0.8);
    }
    
    /* Sidebar overlay */
    .sidebar.open::after {
        content: '';
        position: fixed;
        top: 0;
        left: 100%;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        pointer-events: auto;
    }
    
    .history-list {
        max-height: calc(100vh - 200px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .main-content {
        padding: 16px;
        padding-top: 100px;
        height: calc(100vh - 56px);
        height: calc(100svh - 56px);
        width: 100%;
    }
    
    /* Mode toggle buttons - horizontal scroll strip */
    .mode-toggle-container {
        top: 4px !important;
        width: calc(100% - 16px) !important;
        max-width: none !important;
        padding: 3px !important;
        gap: 3px !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .mode-toggle-container::-webkit-scrollbar {
        display: none;
    }
    
    .mode-toggle-btn {
        padding: 6px 10px !important;
        font-size: 0.65rem !important;
        flex: 0 0 auto;
        min-width: 0;
        text-align: center;
        white-space: nowrap;
        display: flex !important;
        align-items: center;
        gap: 4px;
    }
    
    .mode-btn-label {
        display: none;
    }
    
    .mode-btn-short {
        display: inline;
    }
    
    /* Floating input - compact mobile layout */
    .floating-input-container {
        width: 100%;
        bottom: 8px;
        padding: 0 8px;
        box-sizing: border-box;
        flex-direction: column;
        gap: 4px;
    }
    
    .output-lang-row {
        justify-content: flex-end;
        margin-bottom: 4px;
        padding-right: 0;
    }
    
    .output-lang-label {
        display: none !important;
    }
    
    .input-wrapper {
        flex-direction: row;
        border-radius: 0;
        padding: 8px 8px 8px 12px;
        width: 100%;
        box-sizing: border-box;
        gap: 6px;
    }
    
    .input-wrapper input {
        font-size: 0.85rem;
        min-width: 0;
        flex: 1;
    }
    
    .send-button {
        width: 36px;
        height: 36px;
        min-width: 36px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .animated-placeholder {
        font-size: 0.7rem;
        left: 12px;
    }
    
    /* Hide duplicate user menu on mobile (already in mobile header) */
    .user-menu-container {
        display: none !important;
    }
    
    .user-avatar {
        width: 32px;
        height: 32px;
    }
    
    /* Artifact cards */
    .artifact-card {
        padding: 16px;
    }
    
    .artifact-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .artifact-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .artifact-grid {
        padding: 40px 8px;
        gap: 24px;
    }
    
    .artifact-sections {
        padding: 12px;
    }
    
    .copyable-content {
        padding: 12px;
        font-size: 0.85rem;
        overflow-x: auto;
    }
    
    /* Empty state / start screen */
    .empty-content h1 {
        font-size: 2rem;
        letter-spacing: 0.1em;
    }
    
    .empty-content .description {
        font-size: 0.8rem;
        max-width: 100%;
        padding: 0 16px;
    }
    
    .logo-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    
    /* Login page */
    .login-container {
        padding: 32px 20px;
        margin: 16px;
        width: calc(100% - 32px);
        max-width: none;
    }
    
    /* Settings page */
    .settings-container {
        padding: 16px !important;
        max-width: 100% !important;
    }
}

/* === Small phones: 480px === */
@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 0.85rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .feature-card {
        padding: 20px 16px;
    }
    
    .pricing-card {
        padding: 24px 16px;
    }
    
    .price {
        font-size: 2rem;
    }
    
    .pricing-features li {
        font-size: 0.85rem;
    }
    
    .mode-toggle-btn {
        padding: 6px 8px !important;
        font-size: 0.65rem !important;
    }
    
    .empty-content h1 {
        font-size: 1.6rem;
    }
    
    .landing-footer p {
        font-size: 0.8rem;
    }
    
    .landing-footer a {
        font-size: 0.8rem !important;
    }
    
    .nav-links a {
        font-size: 0.8rem;
    }
    
    .logo-text {
        font-size: 1rem;
    }
}

/* ═══════════════════════════════════════════════════════
   CHAT WIDGET — SEOkrates Support Bot
   ═══════════════════════════════════════════════════════ */

/* Floating bubble */
.chat-bubble {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #fff;
    color: #000;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 24px rgba(255, 255, 255, 0.15);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    animation: chatBubbleIn 0.5s ease-out;
}

.chat-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 32px rgba(255, 255, 255, 0.25);
}

@keyframes chatBubbleIn {
    from { transform: scale(0) rotate(-180deg); opacity: 0; }
    to { transform: scale(1) rotate(0); opacity: 1; }
}

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

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

/* Proactive message */
.chat-proactive {
    position: fixed;
    bottom: 92px;
    right: 24px;
    z-index: 9998;
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 12px 36px 12px 16px;
    font-size: 0.85rem;
    font-family: var(--font-sans);
    cursor: pointer;
    animation: slideUp 0.4s ease-out;
    max-width: 280px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.chat-proactive:hover {
    border-color: rgba(255, 255, 255, 0.4);
}

.chat-proactive-close {
    position: absolute;
    top: 6px;
    right: 6px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 2px;
    display: flex;
}

/* Chat window */
.chat-window {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    width: 380px;
    height: 560px;
    background: #0a0a0a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: chatWindowIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.8);
}

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

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

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

.chat-header-avatar {
    width: 36px;
    height: 36px;
    border: 1px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
    flex-shrink: 0;
}

.chat-header-title {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #fff;
}

.chat-header-status {
    font-size: 0.72rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.chat-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}

.chat-status-ai { background: #22c55e; }
.chat-status-live { background: #3b82f6; animation: statusPulse 1.5s infinite; }
.chat-status-waiting { background: #eab308; animation: statusPulse 1.5s infinite; }

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

.chat-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    transition: color 0.2s;
}

.chat-close:hover { color: #fff; }

/* Messages area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.chat-msg {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 85%;
}

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

.chat-msg-assistant, .chat-msg-agent {
    align-self: flex-start;
    align-items: flex-start;
}

.chat-msg-system {
    align-self: center;
    align-items: center;
    max-width: 100%;
}

.chat-msg-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.chat-msg-label {
    font-weight: 500;
}

.chat-msg-bubble {
    padding: 10px 14px;
    font-size: 0.85rem;
    line-height: 1.55;
    font-family: var(--font-sans);
    word-break: break-word;
    white-space: pre-wrap;
}

.chat-msg-user .chat-msg-bubble {
    background: #fff;
    color: #000;
    border: 1px solid #fff;
}

.chat-msg-assistant .chat-msg-bubble {
    background: #111;
    color: #e5e5e5;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-msg-agent .chat-msg-bubble {
    background: rgba(59, 130, 246, 0.1);
    color: #e5e5e5;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.chat-msg-system .chat-msg-bubble {
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-align: center;
    border: none;
    font-style: italic;
    padding: 6px 12px;
}

/* Typing indicator */
.chat-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 18px;
}

.chat-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-secondary);
    animation: typingBounce 1.4s infinite ease-in-out;
}

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

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Handoff button */
.chat-handoff-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    margin: 0 16px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.75rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-handoff-btn:hover {
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

/* Input bar */
.chat-input-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #000;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

.chat-input {
    flex: 1;
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 10px 14px;
    font-size: 0.85rem;
    font-family: var(--font-sans);
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: rgba(255, 255, 255, 0.3);
}

/* === Mobile Performance Optimizations === */

/* Reduce expensive backdrop-filter on mobile */
@media (max-width: 768px) {
    .sidebar {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    .landing-nav {
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
    /* Disable grid pattern pseudo-element on mobile (compositing layer) */
    .immersive-app::before {
        display: none;
    }
    /* Disable mouse-tracking reactive background on mobile */
    .reactive-bg {
        display: none;
    }
    /* Reduce expensive infinite animations on mobile */
    .gsc-sidebar-btn {
        animation: none;
    }
    .gsc-sidebar-btn::before {
        animation: none;
    }
    .gsc-badge {
        animation: none;
        opacity: 1;
    }
    .logo-icon::after {
        animation: none;
    }
    /* Contain layout for performance */
    .features-grid,
    .features-section,
    .pricing-section {
        contain: layout style;
    }
}

/* Respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .reactive-bg {
        display: none;
    }
}

/* Optimize paint for fixed nav */
.landing-nav {
    will-change: transform;
    contain: layout style;
}

/* Add passive touch hint for hero section scrolling */
.hero-section {
    contain: layout style;
}

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

.chat-input:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.chat-send {
    width: 38px;
    height: 38px;
    background: #fff;
    color: #000;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chat-send:hover { background: #ccc; }
.chat-send:disabled { opacity: 0.2; cursor: not-allowed; }

/* Mobile responsive */
@media (max-width: 480px) {
    .chat-window {
        bottom: 0;
        right: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        border: none;
    }

    .chat-bubble {
        bottom: 16px;
        right: 16px;
        width: 48px;
        height: 48px;
    }

    .chat-proactive {
        bottom: 76px;
        right: 16px;
        max-width: 240px;
    }
}

