/*
    Chat Bot / Anomaly UI styles for anomaly.html
    Integrated full stylesheet block (chat-bot, DnD, live monitor, etc.)
*/
.chat-bot {
    display: flex;
    flex-direction: column;
    max-width: 540px;
    min-height: 600px;
    margin: 0 auto;
    padding: 0;
    box-shadow: 0 8px 32px rgba(169, 47, 0, 0.3), 0 1px 32px rgba(255, 72, 0, 0.05);
}

.chat-header {
    padding: 32px 32px 12px 32px;
    border-bottom: 1px solid rgba(255, 72, 0, 0.08);
}

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0 32px 32px 32px;
    gap: 18px;
    position: relative;
    justify-content: flex-end;
}

.chat-window {
    flex: 1;
    overflow-y: auto;
    padding: 18px 0 8px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 220px;
    max-height: 340px;
    align-items: center;
}

.msg {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    max-width: 84%;
    font-size: 15px;
    line-height: 1.4;
    box-shadow: 0 1px 0 rgba(0,0,0,0.06);
}
.msg .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex: 0 0 36px;
}
.msg .bubble {
    padding: 6px 10px;
    border-radius: 6px;
}
.msg.user {
    margin-left: auto;
    flex-direction: row-reverse;
}
.msg.user .bubble{background: linear-gradient(90deg,#7efcf6,#4ad5ff);color:#041225}
.msg.bot{margin-right: auto}
.msg.bot .bubble{background:#0f1724;color:#e6f0ff}
.msg.bot.loading {
    opacity: 0.7;
    font-style: italic;
}

.prompt-bar {
    display: flex;
    flex-wrap: nowrap; /* keep prompts on a single row */
    gap: 12px;
    position: absolute;
    left: 50%;
    bottom: 18px; /* anchor closer to the card bottom */
    transform: translateX(-50%);
    justify-content: center;
    max-width: 92%;
    z-index: 6;
    transition: opacity 180ms ease, transform 180ms ease;
    overflow-x: auto; /* allow horizontal scrolling when there are many/long prompts */
    -webkit-overflow-scrolling: touch;
    padding: 6px 10px; /* breathing room so scroll works comfortably */
}
.prompt-bar.hidden{opacity:0;pointer-events:none;transform: translateX(-50%) translateY(10px)}
.prompt-bar .prompt-btn{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:320px}
.prompt-btn {
    background: transparent;
    color: #cbd5ff;
    border: 1px solid rgba(124,58,36,0.16);
    border-radius: 20px;
    padding: 10px 16px; /* larger tappable area */
    font-size: 15px; /* slightly larger text so prompts are readable */
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s, transform 0.08s;
}
.prompt-btn:hover {
    background: rgba(255,255,255,0.04);
    transform: translateY(-2px);
}

/* Input area */
.input-area{
    display:flex;
    gap:8px;
    align-items:center;
    padding-top:8px;
}
.input-area textarea{
    flex:1;
    resize:none;
    border-radius:12px;
    padding:10px 12px;
    background: rgba(255,255,255,0.02);
    border:1px solid rgba(255,255,255,0.04);
    color: #e6f0ff;
    font-size:14px;
}
.input-area #send-btn{
    padding:10px 16px;
    border-radius:10px;
}
/* Reset */
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%;font-family:Inter,Segoe UI,Arial,sans-serif}

/* Space background with enhanced star field */
body{
    background: #000000;
    color:#e6f0ff;
    -webkit-font-smoothing:antialiased;
    display:flex;
    align-items:flex-start;
    justify-content:center;
    padding:36px;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    min-height: 100vh; /* ensure full viewport height */
}

/* Stars removed in favor of pure black background */

/* Card */
.card{
    position:relative;z-index:1;width:100%;max-width:900px;
    background:linear-gradient(180deg, rgba(169, 47, 0, 0.15), rgba(122, 25, 0, 0.05));
    border:1px solid rgba(255, 72, 0, 0.12);border-radius:16px;padding:28px;
    box-shadow:0 8px 32px rgba(169, 47, 0, 0.3), inset 0 1px 32px rgba(255, 72, 0, 0.05);
    display:block;
    margin: 36px auto;
    position: relative;
    overflow: visible;
    background-color: rgba(0, 0, 0, 0.4); /* darkened solid background */
}

/* two-column layout only when .with-panel is present on the card */
.card.with-panel{
    display:grid;grid-template-columns:1fr 420px;gap:24px;align-items:stretch;
}

/* Hero */
.hero h1{font-size:40px;letter-spacing:1px;margin-bottom:6px}
.hero p.lead{color:#bcd7ff;opacity:.95;margin-bottom:18px}
.tagline{display:flex;gap:12px;align-items:center;margin-bottom:20px}

/* Anomaly DnD UI */
.anomaly-dnd{margin-top:16px;display:flex;flex-direction:column;gap:18px}
.dnd-sources{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}
.source{display:flex;flex-direction:column;align-items:center;gap:6px;padding:12px;border:1px solid rgba(255,72,0,0.12);border-radius:12px;background:rgba(169,47,0,0.06);cursor:grab;user-select:none;color:#e6f0ff}
.source:active{cursor:grabbing}
.source.dragging{opacity:.45;transform:scale(.96)}
.source .icon{font-size:28px}
.source .label{font-size:14px;opacity:.9}

.dropzone{position:relative;border:2px dashed rgba(255,72,0,0.18);border-radius:14px;min-height:160px;background:linear-gradient(180deg, rgba(169,47,0,0.05), rgba(122,25,0,0.03));display:flex;align-items:center;justify-content:center;overflow:hidden}
.dropzone .dz-inner{pointer-events:none;text-align:center;color:#bcd7ff}
.dropzone .dz-cta{font-weight:700}
.dropzone.hover{border-color:#7efcf6;background:rgba(126,252,246,0.06)}

/* Chip preview centered inside dropzone */
.dz-chip{display:inline-flex;align-items:center;gap:10px;padding:10px 14px;border-radius:999px;background:rgba(0,0,0,0.35);border:1px solid rgba(255,72,0,0.18);color:#e6f0ff;box-shadow:0 6px 28px rgba(0,0,0,0.25);animation: dzIn .18s ease}
.dz-icon{font-size:18px}
.dz-name{font-weight:700;font-size:14px}
@keyframes dzIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}

.scan-status{display:flex;flex-direction:column;gap:10px}
.progress{height:10px;background:rgba(255,255,255,0.06);border-radius:999px;overflow:hidden}
.progress .bar{height:100%;background:linear-gradient(90deg,#7efcf6,#4ad5ff);width:0%;transition:width .18s ease}

.results{background:rgba(0,0,0,0.25);border:1px solid rgba(255,72,0,0.12);border-radius:12px;padding:14px}
.results h3{margin-bottom:8px}

/* Live Monitor Page */
.live-monitor{margin-top:20px;display:flex;flex-direction:column;gap:20px}
.network-status h3{margin-bottom:12px;font-size:18px}
.status-card{background:rgba(0,0,0,0.25);border:1px solid rgba(255,72,0,0.12);border-radius:12px;padding:16px;display:flex;flex-direction:column;gap:10px}
.status-item{display:flex;justify-content:space-between;align-items:center;padding:8px 0}
.status-item .label{color:#9fb9ff;font-size:14px}
.status-item .value{color:#e6f0ff;font-weight:600}
.status-badge{display:inline-flex;align-items:center;gap:6px}
.status-dot{width:8px;height:8px;border-radius:50%;background:#4ad5ff}
.status-dot.active{background:#4ad5ff;box-shadow:0 0 8px rgba(74,213,255,0.6);animation:pulse 2s infinite}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:0.6}}

.scan-controls{text-align:center;padding:20px 0}
.scan-button{font-size:16px;padding:14px 24px;display:inline-flex;align-items:center;gap:8px;min-width:220px;justify-content:center}
.scan-button .btn-icon{font-size:20px}
.scan-button:disabled{opacity:0.6;cursor:not-allowed}
.scan-hint{margin-top:10px;opacity:0.8}

.scanning-status{background:rgba(0,0,0,0.25);border:1px solid rgba(255,72,0,0.12);border-radius:12px;padding:18px}
.scanning-status h3{margin-bottom:12px;text-align:center}

.scan-report{background:rgba(0,0,0,0.25);border:1px solid rgba(255,72,0,0.12);border-radius:12px;padding:18px}
.scan-report h3{margin-bottom:14px}
.report-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px;padding-bottom:12px;border-bottom:1px solid rgba(255,72,0,0.08)}
.report-summary{display:flex;align-items:center;gap:10px;font-size:16px;font-weight:600}
.summary-icon{font-size:24px}
.summary-icon.warning{color:#ff9f43}
.report-time{opacity:0.8}

.report-details{display:flex;flex-direction:column;gap:16px}
.detail-section h4{font-size:15px;margin-bottom:8px;color:#7efcf6}
.detail-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:6px}
.detail-list li{font-size:14px;padding:4px 0;color:#bcd7ff}
.detail-list li strong{color:#e6f0ff}

/* Cowboy badge */
.badge{display:inline-flex;align-items:center;gap:10px;padding:8px 12px;background:linear-gradient(90deg,#ff9f43 0%,#ffd97a 100%);color:#111;border-radius:999px;font-weight:700}
.badge svg{width:28px;height:28px}

/* Buttons */
.actions{display:flex;gap:14px}
.btn{display:inline-block;padding:12px 18px;border-radius:10px;font-weight:700;color:#041225;text-decoration:none}
.btn-primary{background:linear-gradient(90deg,#7efcf6,#4ad5ff);box-shadow:0 6px 18px rgba(76,218,255,0.12)}
.btn-ghost{background:transparent;border:1px solid rgba(126,252,246,0.16);color:#bfefff}

/* Panel removed — styles deprecated. If needed later, use .card-extra */
.panel{
    background:linear-gradient(180deg, rgba(169, 47, 0, 0.08), rgba(122, 25, 0, 0.03));
    border-radius:12px;
    padding:18px;
    border:1px solid rgba(255, 72, 0, 0.08);
    box-shadow: inset 0 1px 16px rgba(255, 72, 0, 0.03);
}
.panel h3{margin-bottom:12px}

textarea{
    width:100%;
    min-height:140px;
    border-radius:8px;
    padding:12px;
    background:rgba(122, 25, 0, 0.15);
    border:1px solid rgba(255, 72, 0, 0.16);
    color:#ffe6e0;
}
.small{font-size:13px;color:#9fb9ff}

/* cowboy silhouette at bottom */
.silhouette{position:absolute;left:0;right:0;bottom:-24px;height:120px;pointer-events:none;opacity:0.22}

/* responsive */
@media (max-width:920px){.card{grid-template-columns:1fr;}}

/* Mars surface texture */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.03;
    z-index: -1;
    border-radius: 16px;
    pointer-events: none;
}

/* Crater effect */
.card::after {
    content: '';
    position: absolute;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle at center, rgba(169, 47, 0, 0.2) 0%, transparent 70%);
    top: -20px;
    right: -20px;
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
}

/* About preview */
.preview{
    background:linear-gradient(180deg, rgba(169, 47, 0, 0.05), rgba(122, 25, 0, 0.02));
    padding:12px;
    border-radius:8px;
    border:1px dashed rgba(255, 72, 0, 0.08);
    min-height:88px;
}

/* Star field (rendered only around the card via JS) */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0; /* behind card (card uses z-index:1) */
    pointer-events: none;
}

.star {
    position: absolute;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 2px 1px rgba(255, 255, 255, 0.25);
    animation: twinkleRandom var(--twinkle-duration, 4s) ease-in-out infinite;
    animation-delay: var(--twinkle-delay, 0s);
    opacity: 0.8;
}

/* Pause star animation during scans */
.pause-stars .star{
    animation: none !important; /* fully stop animation to reduce CPU and visual motion */
}

@keyframes twinkleRandom {
    0%, 100% { opacity: 0.3; }
    50% { opacity: var(--twinkle-opacity, 1); }
}