/* F.R.I.D.A.Y. 2.0 — Stark HUD Theme CSS */
:root {
    --bg-dark: #070a10;
    --card-bg: rgba(15, 23, 42, 0.75);
    --border-color: rgba(0, 240, 255, 0.2);
    --border-glow: rgba(0, 240, 255, 0.5);
    
    --cyan-neon: #00f0ff;
    --cyan-dim: #00a8b5;
    --blue-glow: #0077ff;
    --purple-glow: #8a2be2;
    
    --text-main: #f0f6fc;
    --text-muted: #8b949e;
    
    --status-online: #00ff88;
    --status-offline: #ff3366;
    
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* HUD Grid Background Effect */
.hud-grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: 
        linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -1;
    pointer-events: none;
}

/* Glassmorphism Card Style */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    border-color: rgba(0, 240, 255, 0.4);
    box-shadow: 0 8px 32px 0 rgba(0, 240, 255, 0.15);
}

/* App Container */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100vh;
    gap: 20px;
}

/* Header */
.hud-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Arc Reactor Icon */
.arc-reactor-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--cyan-neon);
    box-shadow: 0 0 15px var(--cyan-neon);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: rotateReactor 10s linear infinite;
}

.core-ring {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px dashed var(--cyan-neon);
}

.core-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #fff;
    box-shadow: 0 0 10px #fff, 0 0 20px var(--cyan-neon);
    position: absolute;
}

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

.brand-text h1 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge {
    font-size: 0.75rem;
    background: linear-gradient(135deg, var(--cyan-neon), var(--blue-glow));
    color: #000;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 700;
}

.subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* Status Bar */
.status-bar {
    display: flex;
    align-items: center;
    gap: 20px;
}

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

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.online {
    background-color: var(--status-online);
    box-shadow: 0 0 8px var(--status-online);
}

.status-dot.offline {
    background-color: var(--status-offline);
    box-shadow: 0 0 8px var(--status-offline);
}

/* Main Content Area */
.hud-main {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 20px;
    flex: 1;
    min-height: 0; /* Prevents overflow */
}

/* Sidebar */
.hud-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.voice-card, .metrics-card, .actions-card {
    padding: 20px;
}

.voice-card h3, .metrics-card h3, .actions-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--cyan-neon);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.visualizer-container {
    width: 100%;
    height: 100px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    margin-bottom: 12px;
}

#audioVisualizer {
    width: 100%;
    height: 100%;
}

.visualizer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    gap: 8px;
    pointer-events: none;
}

/* Metrics */
.metric-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
}

.metric-row span {
    color: var(--text-muted);
}

.text-success {
    color: var(--status-online);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--cyan-neon), var(--blue-glow));
    color: #050b14;
    font-weight: 700;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    width: 100%;
    font-family: var(--font-sans);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: var(--font-sans);
    width: 100%;
    transition: background 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(0, 240, 255, 0.1);
    border-color: var(--cyan-neon);
}

.btn-icon {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease;
}

.btn-icon:hover {
    border-color: var(--cyan-neon);
    color: var(--cyan-neon);
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Chat Section */
.hud-chat {
    display: flex;
    flex-direction: column;
    padding: 20px;
    min-height: 0;
}

.chat-feed {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-right: 8px;
}

/* Scrollbar Styling */
.chat-feed::-webkit-scrollbar {
    width: 6px;
}
.chat-feed::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}
.chat-feed::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

/* Chat Messages */
.message {
    display: flex;
    gap: 12px;
    max-width: 85%;
}

.system-message, .bot-message {
    align-self: flex-start;
}

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

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid var(--cyan-neon);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cyan-neon);
    flex-shrink: 0;
}

.user-message .message-avatar {
    background: rgba(138, 43, 226, 0.2);
    border-color: var(--purple-glow);
    color: var(--purple-glow);
}

.message-content {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 16px;
}

.user-message .message-content {
    background: rgba(0, 120, 255, 0.15);
    border-color: rgba(0, 120, 255, 0.3);
}

.message-header {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--cyan-neon);
    margin-bottom: 4px;
}

.user-message .message-header {
    color: var(--purple-glow);
    text-align: right;
}

.message-content p {
    font-size: 0.95rem;
    line-height: 1.5;
}

.message-time {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-top: 6px;
}

/* Chat Input Area */
.chat-input-area {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.input-wrapper {
    display: flex;
    gap: 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px 12px;
    align-items: center;
}

.input-wrapper:focus-within {
    border-color: var(--cyan-neon);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
}

#chatInput {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    resize: none;
}

.btn-send {
    background: var(--cyan-neon);
    border: none;
    color: #000;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.btn-send:hover {
    transform: scale(1.05);
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 100;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    width: 100%;
    max-width: 500px;
    padding: 24px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 1.1rem;
    color: var(--cyan-neon);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px;
    color: #fff;
    font-family: var(--font-mono);
    outline: none;
}

.form-input:focus {
    border-color: var(--cyan-neon);
}

.form-group small {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 4px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* Responsive */
@media (max-width: 900px) {
    .hud-main {
        grid-template-columns: 1fr;
    }
}
