/* Round Loading Symbol */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0, 255, 255, 0.1);
    border-top: 2px solid #00ffff;
    border-radius: 50%;
    animation: nexora-spin 0.8s linear infinite;
    display: inline-block;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes nexora-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
:root {
    --bg-dark: #020617;
    --card-bg: rgba(15, 23, 42, 0.75);
    --accent-cyan: #22d3ee;
    --accent-blue: #3b82f6;
    --border: rgba(255, 255, 255, 0.1);
    --danger: #ef4444;
    --success: #10b981;
    --glass: rgba(255, 255, 255, 0.03);
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Inter', sans-serif; 
}

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 0% 0%, rgba(34, 211, 238, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(59, 130, 246, 0.08) 0%, transparent 50%);
    color: #f0f0f0;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* --- Core Layout --- */
.main-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: margin-right 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

/* --- Fixed Scroll Reveal --- */
.reveal {
    opacity: 1; /* Changed from 0 to 1 */
    transform: translateY(0); /* Changed from 40px to 0 */
    transition: all 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform, opacity;
}

/* We can keep this, but since we set default to 1, the site is now safe */
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* --- Header Styling --- */
header {
    text-align: center;
    margin-bottom: 4rem;
    margin-top: 2rem;
}

header h1 {
    font-size: clamp(2.5rem, 10vw, 4.5rem);
    font-weight: 800;
    letter-spacing: -3px;
    background: linear-gradient(135deg, #fff 30%, var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tagline {
    color: #64748b;
    font-size: 0.8rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: 10px;
}

/* --- Feature Cards --- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    width: 100%;
    margin-bottom: 4rem;
}

.feature-card {
    background: var(--glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    padding: 2rem;
    border-radius: 24px;
    text-align: center;
    transition: 0.4s;
}

.feature-card:hover {
    border-color: var(--accent-cyan);
    background: rgba(34, 211, 238, 0.05);
    transform: translateY(-10px);
}

/* --- Scanner Terminal --- */
.scanner-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 3rem;
    width: 100%;
    max-width: 850px;
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.7);
    margin-bottom: 5rem;
}

.input-group {
    display: flex;
    background: rgba(0,0,0,0.5);
    padding: 10px;
    border-radius: 20px;
    border: 1px solid var(--border);
    transition: border-color 0.3s;
}

.input-group:focus-within { border-color: var(--accent-cyan); }

input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    padding: 15px;
    font-size: 1rem;
    outline: none;
}

.scan-btn {
    background: var(--accent-cyan);
    color: #000;
    border: none;
    padding: 0 30px;
    border-radius: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.3s;
}

.scan-btn:hover {
    background: #fff;
    box-shadow: 0 0 30px var(--accent-cyan);
}

/* --- Chat Assistant Panel --- */
.side-panel {
    position: fixed;
    right: -450px;
    top: 0;
    width: 400px;
    height: 100%;
    background: #0b0f1a;
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 3000;
    transition: 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: -20px 0 60px rgba(0,0,0,0.8);
}

.side-panel.open { right: 0; }

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #020617; /* Dark background so messages POP */
}

/* Message Bubbles */
.ai-msg, .bot-msg {
    background: rgba(255,255,255,0.05);
    color: var(--accent-cyan);
    padding: 15px;
    border-radius: 18px 18px 18px 4px;
    margin-bottom: 15px;
    border-left: 3px solid var(--accent-cyan);
    align-self: flex-start;
}

.user-msg {
    background: var(--accent-blue);
    color: #fff;
    padding: 15px;
    border-radius: 18px 18px 4px 18px;
    margin-bottom: 15px;
    align-self: flex-end;
}

/* --- Chat Toggle Button (VISIBLE FIX) --- */
.chat-toggle {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 65px;
    height: 65px;
    background: var(--accent-cyan);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 4000;
    box-shadow: 0 10px 30px rgba(34, 211, 238, 0.4);
    transition: 0.3s;
}

.chat-toggle:hover {
    transform: scale(1.1) rotate(5deg);
    background: #fff;
}

.chat-toggle svg { stroke: #000; }

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    header h1 { font-size: 3rem; }
    .features-grid { grid-template-columns: 1fr; }
    .scanner-card { padding: 1.5rem; }
    .side-panel { width: 100%; right: -100%; }
    .chat-toggle { bottom: 20px; right: 20px; width: 55px; height: 55px; }
    .main-content.shrunk { margin-right: 0; opacity: 0.3; }
}

/* Status Glows */
.danger-glow { border-color: var(--danger) !important; box-shadow: 0 0 40px rgba(239, 68, 68, 0.3) !important; }
.success-glow { border-color: var(--success) !important; box-shadow: 0 0 40px rgba(16, 185, 129, 0.3) !important; }
.close-chat {
    background: transparent;
    border: 1px solid var(--border);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
/* Circular Loader */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 255, 255, 0.1);
    border-top: 2px solid #00ffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Status Text Glow */
#result-display {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}
