/* ============================================
   JARVIS AI Command Center — Style
   ============================================ */

:root {
    --bg-primary: #0a0a12;
    --bg-secondary: #12121e;
    --bg-card: #1a1a2e;
    --cyan: #00d4ff;
    --blue: #0088ff;
    --gold: #ffd700;
    --gold-dim: #b8960f;
    --text-primary: #e0e0ff;
    --text-secondary: #8888aa;
    --border-color: #2a2a4a;
    --glow-cyan: 0 0 20px rgba(0, 212, 255, 0.3);
    --glow-gold: 0 0 20px rgba(255, 215, 0, 0.2);
}

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

html { scroll-behavior: smooth; }

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

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--cyan); }

/* Particles Background */
#particles {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(0, 212, 255, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(255, 215, 0, 0.02) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 100%, rgba(0, 136, 255, 0.04) 0%, transparent 40%);
}

/* ============ NAV ============ */
nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 40px;
    background: rgba(10, 10, 18, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

.logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 3px;
}

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

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 1px;
    transition: color 0.3s;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px; left: 0;
    width: 0; height: 2px;
    background: var(--cyan);
    transition: width 0.3s;
}

.nav-links a:hover, .nav-links a.active { color: var(--cyan); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Memory Indicator (nav) */
.memory-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--gold);
    cursor: pointer;
    transition: all 0.3s;
    padding: 4px 10px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 4px;
    background: rgba(255, 215, 0, 0.05);
}

.memory-indicator:hover {
    border-color: var(--gold);
    background: rgba(255, 215, 0, 0.1);
}

.mem-icon { font-size: 0.9rem; }
.mem-count { font-weight: 700; font-family: 'Orbitron', sans-serif; font-size: 0.8rem; }

/* Memory Bar (below nav) */
.memory-bar {
    position: fixed;
    top: 52px; left: 0; right: 0;
    z-index: 99;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 40px;
    background: rgba(255, 215, 0, 0.05);
    border-bottom: 1px solid rgba(255, 215, 0, 0.15);
    font-size: 0.8rem;
    color: var(--text-secondary);
    backdrop-filter: blur(10px);
}

.mem-bar-icon { font-size: 0.85rem; }
.mem-bar-hint { margin-left: auto; font-style: italic; color: rgba(255, 215, 0, 0.4); }

.dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

.dot.online { background: #00ff88; box-shadow: 0 0 8px rgba(0,255,136,0.6); }

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ============ SECTIONS ============ */
.section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 24px 60px;
    position: relative;
    z-index: 1;
}

/* ============ LANDING ============ */
.landing-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    text-align: center;
    animation: fadeIn 1.2s ease;
}

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

/* Hologram Ring */
.hologram-ring {
    position: relative;
    width: 160px; height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.ring-outer, .ring-inner {
    position: absolute;
    border-radius: 50%;
    border: 2px solid transparent;
}

.ring-outer {
    width: 160px; height: 160px;
    border-top-color: var(--cyan);
    border-right-color: var(--gold);
    animation: spin 4s linear infinite;
}

.ring-inner {
    width: 120px; height: 120px;
    border-bottom-color: var(--cyan);
    border-left-color: var(--gold);
    animation: spin-reverse 3s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes spin-reverse {
    to { transform: rotate(-360deg); }
}

.core {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,212,255,0.3), rgba(0,136,255,0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.core-pulse {
    position: absolute;
    width: 60px; height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,212,255,0.2), transparent);
    animation: pulse-ring 2s ease-in-out infinite;
}

@keyframes pulse-ring {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.5); opacity: 0; }
}

.core-letter {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--cyan);
    text-shadow: 0 0 20px rgba(0,212,255,0.8);
    z-index: 1;
}

.title {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--cyan), var(--blue), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 6px;
}

.subtitle {
    font-size: 1.3rem;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 2px;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    gap: 40px;
    margin-top: 10px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--cyan);
    text-shadow: 0 0 10px rgba(0,212,255,0.4);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cta-btn {
    margin-top: 10px;
    padding: 14px 40px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--bg-primary);
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 212, 255, 0.3);
}

/* ============ CHAT SECTION ============ */
.chat-section {
    padding-top: 80px;
}

.chat-layout {
    display: flex;
    gap: 16px;
    width: 100%;
    max-width: 900px;
    align-items: flex-start;
}

.chat-container {
    width: 100%;
    max-width: 780px;
    height: 500px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

.chat-header {
    width: 100%;
    max-width: 900px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 0 12px;
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-title h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    letter-spacing: 3px;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.chat-icon { font-size: 1.4rem; }

.model-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.model-selector label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.model-selector select {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 4px 10px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
}

.model-selector select:focus {
    border-color: var(--cyan);
    box-shadow: var(--glow-cyan);
}

/* Chat Controls */
.chat-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mem-toggle {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 4px;
    color: var(--gold);
    font-size: 1.1rem;
    padding: 4px 10px;
    cursor: pointer;
    transition: all 0.3s;
    line-height: 1;
}

.mem-toggle:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: var(--gold);
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.2);
}

/* Memory Panel (sidebar) */
.memory-panel {
    width: 200px;
    flex-shrink: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    max-height: 500px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

.mem-panel-header {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 215, 0, 0.03);
}

.mem-panel-header h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 1px;
    color: var(--gold);
}

.mem-panel-header span {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.mem-panel-body {
    padding: 10px 14px;
    overflow-y: auto;
    max-height: 420px;
}

.memory-item {
    padding: 8px 0;
    border-bottom: 1px solid rgba(42, 42, 74, 0.5);
}

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

.mem-label {
    display: block;
    font-size: 0.65rem;
    color: var(--cyan);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 2px;
}

.mem-value {
    display: block;
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
}

.memory-empty {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
    padding: 20px 0;
    line-height: 1.5;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    display: flex;
    gap: 12px;
    animation: msg-in 0.3s ease;
}

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

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

.avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.bot-avatar {
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    color: var(--bg-primary);
}

.user-avatar {
    background: linear-gradient(135deg, var(--gold), #ff8c00);
    color: var(--bg-primary);
}

.message-content {
    max-width: 75%;
    background: var(--bg-card);
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.message.user .message-content {
    background: rgba(0, 212, 255, 0.08);
    border-color: rgba(0, 212, 255, 0.2);
}

.message-sender {
    font-size: 0.7rem;
    color: var(--cyan);
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.message.user .message-sender {
    color: var(--gold);
    text-align: right;
}

.message-text {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.message-text p { margin-bottom: 6px; }
.message-text p:last-child { margin-bottom: 0; }

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

.typing-indicator span {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--cyan);
    animation: typing 1.4s ease-in-out infinite;
}

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

@keyframes typing {
    0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
    30% { opacity: 1; transform: scale(1); }
}

/* Input Area */
.input-row {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

#chatInput {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

#chatInput:focus {
    border-color: var(--cyan);
    box-shadow: var(--glow-cyan);
}

#chatInput::placeholder { color: var(--text-secondary); }

#sendBtn {
    width: 44px; height: 44px;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    border: none;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--bg-primary);
    flex-shrink: 0;
}

#sendBtn:hover {
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
    transform: scale(1.05);
}

/* ============ SYSTEMS STATUS ============ */
.status-section {
    min-height: 60vh;
    padding-top: 60px;
}

.section-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    letter-spacing: 4px;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 40px;
}

.systems-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 780px;
    width: 100%;
}

.system-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s;
}

.system-card:hover {
    border-color: var(--cyan);
    box-shadow: var(--glow-cyan);
    transform: translateY(-3px);
}

.sys-icon { font-size: 2rem; margin-bottom: 8px; }

.sys-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 6px;
    letter-spacing: 1px;
}

.sys-status {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.sys-status.online { color: #00ff88; }

/* ============ FOOTER ============ */
footer {
    text-align: center;
    padding: 30px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    nav { padding: 10px 16px; }
    .nav-links { gap: 16px; }
    .nav-links a { font-size: 0.85rem; }

    .title { font-size: 1.8rem; letter-spacing: 3px; }
    .stats-bar { flex-wrap: wrap; gap: 20px; justify-content: center; }
    .chat-container { height: 450px; }
    .chat-header { flex-direction: column; gap: 10px; align-items: flex-start; }
    .systems-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .title { font-size: 1.3rem; }
    .systems-grid { grid-template-columns: 1fr; }
    .message-content { max-width: 85%; }
}
