/* --- AI TERMINAL CORE ENVIRONMENT STYLES --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #06060c;
    color: #f0f2f5;
    font-family: 'Space Grotesk', sans-serif;
    height: 100vh;
    overflow: hidden;
}

.chatbot-internal-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    width: 100%;
    height: 100vh;
    background: #06060c;
}

/* --- HIGH-TECH SIDEBAR CONSOLE --- */
.terminal-sidebar {
    background: #090912;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.sidebar-action-header {
    margin-bottom: 2rem;
}

.new-session-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    color: #8a99ad;
    padding: 0.75rem;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.new-session-btn:hover {
    border-color: #ff007f;
    color: #ff007f;
    background: rgba(2ff, 0, 127, 0.02);
}

.conversation-history-log {
    flex: 1;
    overflow-y: auto;
}

.history-item-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.75rem;
    background: rgba(0, 243, 255, 0.02);
    border: 1px solid rgba(0, 243, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
}

.history-item-badge.active .label {
    color: #00f3ff;
    font-weight: 600;
}

.history-meta {
    display: flex;
    flex-direction: column;
}

.history-meta .label {
    font-size: 0.85rem;
    font-family: 'Orbitron', sans-serif;
}

.history-meta .timestamp {
    font-size: 0.75rem;
    color: #586677;
}

/* --- MESSAGING STREAM WORKSPACE --- */
.terminal-chat-workspace {
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
    background: radial-gradient(circle at top left, #0d0d1a 0%, #06060c 100%);
}

.message-stream-scroller {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Scrollbar Interface Custom Tracking Overrides */
.message-stream-scroller::-webkit-scrollbar, .conversation-history-log::-webkit-scrollbar {
    width: 6px;
}
.message-stream-scroller::-webkit-scrollbar-thumb, .conversation-history-log::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

/* Bubble Variant Micro-Architectures */
.chat-bubble {
    display: flex;
    max-width: 80%;
    animation: bubbleSlideIn 0.3s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes bubbleSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.bubble-contents {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* System Prompt Core Node Visual Style */
.bubble-system .bubble-contents {
    background: rgba(16, 16, 32, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #a2b4cb;
    width: 100%;
}

.sender-title {
    display: block;
    font-family: monospace;
    font-size: 0.8rem;
    color: #ff007f;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

/* Inbound AI Response Stream Style */
.bubble-bot {
    align-self: flex-start;
}
.bubble-bot .bubble-contents {
    background: rgba(128, 0, 255, 0.05);
    border: 1px solid rgba(128, 0, 255, 0.2);
    box-shadow: 0 4px 15px rgba(128, 0, 255, 0.05);
    color: #e2e8f0;
    border-radius: 2px 14px 14px 14px;
}

/* Outbound Client Request Stream Style */
.bubble-user {
    align-self: flex-end;
}
.bubble-user .bubble-contents {
    background: rgba(0, 243, 255, 0.06);
    border: 1px solid rgba(0, 243, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 243, 255, 0.05);
    color: #ffffff;
    border-radius: 14px 14px 2px 14px;
}

/* --- PROCESSING LOGICAL TICKER INDICATOR --- */
.ai-thinking-indicator-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 2rem 1rem 2rem;
}

.ai-thinking-indicator-row.hidden {
    display: none !important;
}

.ticker-dot {
    width: 6px;
    height: 6px;
    background-color: #00f3ff;
    border-radius: 50%;
    animation: pulseSync 1.4s infinite ease-in-out both;
}

.ticker-dot:nth-child(2) { animation-delay: 0.2s; }
.ticker-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes pulseSync {
    0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
    40% { transform: scale(1); opacity: 1; }
}

.thinking-text {
    font-size: 0.8rem;
    color: #8a99ad;
    margin-left: 6px;
    font-family: monospace;
}

/* --- BOTTOM DATA TRANSMISSION CONSOLE BAR --- */
.terminal-input-console-bar {
    padding: 1.5rem 2rem;
    background: #040408;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.console-form-element {
    display: flex;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 0.5rem;
    align-items: center;
    transition: all 0.3s ease;
}

.console-form-element:focus-within {
    border-color: #00f3ff;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.1);
}

.console-form-element input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
}

.console-transmit-btn {
    background: none;
    border: none;
    color: #8a99ad;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.console-transmit-btn:hover {
    color: #00f3ff;
}

.console-transmit-btn svg {
    width: 18px;
    height: 18px;
}

/* --- MOBILE FRAME CONSTRAINTS OVERRIDES --- */
@media (max-width: 650px) {
    .chatbot-internal-layout {
        grid-template-columns: 1fr;
    }
    .terminal-sidebar {
        display: none; /* Strip context logs on small views to protect viewport area */
    }
}
/* Card එක Frame එක ඇතුළේ හරියටම මැදට (Center) ගන්න */
.matrix-init-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 40px 20px;
    box-sizing: border-box;
}

/* Futuristic Glassmorphism Card Style */
.matrix-card {
    background: rgba(15, 18, 36, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 242, 254, 0.15);
    border-radius: 16px;
    padding: 40px 30px;
    text-align: center;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), 
                inset 0 0 20px rgba(147, 51, 234, 0.05);
    transition: all 0.4s ease;
}

/* Card එක උඩට මවුස් එක ගෙනිද්දී වෙනස් වීම */
.matrix-card:hover {
    border-color: rgba(0, 242, 254, 0.35);
    box-shadow: 0 20px 50px rgba(0, 242, 254, 0.08), 
                inset 0 0 30px rgba(147, 51, 234, 0.1);
}

/* Icon එක Glow වෙමින් පල්ස් වෙන ඇනිමේෂන් එක */
.icon-container {
    margin-bottom: 22px;
}
.pulse-icon {
    filter: drop-shadow(0 0 8px rgba(0, 242, 254, 0.6));
    animation: cyberPulse 2.5s infinite ease-in-out;
}

@keyframes cyberPulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 8px rgba(0, 242, 254, 0.5)); }
    50% { transform: scale(1.06); filter: drop-shadow(0 0 18px rgba(147, 51, 234, 0.8)); }
}

/* Typography Styles */
.ai-title {
    color: #ffffff;
    font-family: 'Segoe UI', Roboto, sans-serif;
    font-weight: 700;
    font-size: 1.65rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin: 0 0 12px 0;
    background: linear-gradient(90deg, #ffffff, #00f2fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ai-subtitle {
    color: #94a3b8;
    font-family: 'Segoe UI', sans-serif;
    font-size: 0.92rem;
    line-height: 1.6;
    margin: 0 0 30px 0;
}

/* Advanced Glowing Button */
.advanced-ai-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 38px;
    background: linear-gradient(90deg, #00f2fe, #9333ea);
    color: #ffffff !important;
    text-decoration: none;
    font-family: 'Segoe UI', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.4);
}

.advanced-ai-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 25px rgba(147, 51, 234, 0.7);
    letter-spacing: 2px;
}

/* Button එක හරහා යන Light Streak (Glow) Effect එක */
.btn-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transition: 0.6s;
}

.advanced-ai-btn:hover .btn-glow {
    left: 100%;
}

/* Live Terminal Status Text */
.status-terminal {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.8rem;
    color: #00f2fe;
    margin-top: 18px;
    min-height: 20px;
    text-align: center;
    font-weight: bold;
}
