/**
 * Bitghost Artifact Generator - Console Styles
 * 
 * @package BitghostArtifactGenerator
 * @version 1.0.0
 * @timestamp 2025-12-07T00:00:00Z
 * 
 * Design System:
 * - Dark Mode: #000000 bg, #ffffff text
 * - Angular UI with sharp edges
 * - 22px borders on kanban boxes
 * - Shimmer loading effects
 * - Cube emojis for visual elements
 */

/* CSS Custom Properties */
:root {
    --bgag-bg-primary: #000000;
    --bgag-bg-secondary: #0a0a0a;
    --bgag-bg-tertiary: #141414;
    --bgag-bg-card: #1a1a1a;
    --bgag-text-primary: #ffffff;
    --bgag-text-secondary: #b3b3b3;
    --bgag-text-muted: #666666;
    --bgag-accent: #00ff00;
    --bgag-accent-hover: #00cc00;
    --bgag-accent-dim: rgba(0, 255, 0, 0.1);
    --bgag-border: #333333;
    --bgag-border-strong: #444444;
    --bgag-danger: #ff3333;
    --bgag-warning: #ffaa00;
    --bgag-success: #00ff00;
    --bgag-info: #00aaff;
    --bgag-border-width: 22px;
    --bgag-radius: 0px; /* Angular - no rounding */
    --bgag-shadow: 0 4px 20px rgba(0, 255, 0, 0.1);
    --bgag-font-mono: 'SF Mono', 'Fira Code', 'Monaco', 'Consolas', monospace;
    --bgag-font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --bgag-transition: all 0.2s ease;
}

/* Reset & Base */
.bgag-console,
.bgag-console * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.bgag-console {
    display: flex;
    flex-direction: column;
    background: var(--bgag-bg-primary);
    color: var(--bgag-text-primary);
    font-family: var(--bgag-font-sans);
    border: 2px solid var(--bgag-border);
    overflow: hidden;
}

/* ============================================
   HEADER
   ============================================ */
.bgag-console-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--bgag-bg-secondary);
    border-bottom: 2px solid var(--bgag-border);
}

.bgag-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bgag-logo-icon {
    font-size: 24px;
    animation: bgag-pulse 2s infinite;
}

.bgag-logo-text {
    font-family: var(--bgag-font-mono);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--bgag-accent);
}

.bgag-version {
    font-size: 10px;
    color: var(--bgag-text-muted);
    background: var(--bgag-bg-tertiary);
    padding: 2px 6px;
}

/* Navigation Tabs */
.bgag-console-tabs {
    display: flex;
    gap: 4px;
}

.bgag-tab {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--bgag-text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--bgag-transition);
    font-family: var(--bgag-font-sans);
}

.bgag-tab:hover {
    background: var(--bgag-bg-tertiary);
    color: var(--bgag-text-primary);
}

.bgag-tab.active {
    background: var(--bgag-bg-tertiary);
    border: 1px solid var(--bgag-accent);
    color: var(--bgag-accent);
}

/* Header Actions */
.bgag-console-actions {
    display: flex;
    gap: 8px;
}

/* ============================================
   BUTTONS
   ============================================ */
.bgag-btn {
    padding: 8px 16px;
    background: var(--bgag-bg-tertiary);
    border: 1px solid var(--bgag-border);
    color: var(--bgag-text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--bgag-transition);
    font-family: var(--bgag-font-sans);
}

.bgag-btn:hover {
    background: var(--bgag-bg-card);
    border-color: var(--bgag-border-strong);
}

.bgag-btn-primary {
    background: var(--bgag-accent);
    color: var(--bgag-bg-primary);
    border-color: var(--bgag-accent);
    font-weight: 600;
}

.bgag-btn-primary:hover {
    background: var(--bgag-accent-hover);
}

.bgag-btn-secondary {
    border-color: var(--bgag-accent);
    color: var(--bgag-accent);
}

.bgag-btn-dice {
    width: 40px;
    padding: 8px;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bgag-btn-dice:hover {
    animation: bgag-shake 0.5s;
}

.bgag-btn-execute {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
}

.bgag-btn-small {
    padding: 4px 8px;
    font-size: 11px;
}

/* ============================================
   MAIN BODY
   ============================================ */
.bgag-console-body {
    flex: 1;
    overflow: hidden;
    background: var(--bgag-bg-primary);
}

.bgag-panel {
    display: none;
    height: 100%;
    overflow: auto;
    padding: 20px;
}

.bgag-panel.active {
    display: block;
}

/* ============================================
   AGENTS PANEL
   ============================================ */
.bgag-agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.bgag-ghost-card {
    background: var(--bgag-bg-card);
    border: 2px solid var(--bgag-border);
    padding: 16px;
    cursor: pointer;
    transition: var(--bgag-transition);
    position: relative;
}

.bgag-ghost-card:hover {
    border-color: var(--bgag-accent);
    box-shadow: var(--bgag-shadow);
}

.bgag-ghost-card.selected {
    border-color: var(--bgag-accent);
    background: var(--bgag-accent-dim);
}

.bgag-ghost-card.selected::before {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    color: var(--bgag-accent);
    font-weight: bold;
}

.bgag-ghost-gravatar {
    width: 64px;
    height: 64px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bgag-bg-primary);
    border: 1px solid var(--bgag-border);
}

.bgag-ghost-gravatar img {
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
}

.bgag-ghost-placeholder {
    font-size: 32px;
}

.bgag-ghost-info {
    text-align: center;
}

.bgag-ghost-info h3 {
    font-family: var(--bgag-font-mono);
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--bgag-accent);
}

.bgag-ghost-role {
    display: block;
    font-size: 11px;
    color: var(--bgag-text-secondary);
    margin-bottom: 4px;
}

.bgag-ghost-hash {
    font-family: var(--bgag-font-mono);
    font-size: 10px;
    color: var(--bgag-text-muted);
}

.bgag-agents-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding-top: 20px;
    border-top: 1px solid var(--bgag-border);
}

/* ============================================
   KANBAN PANEL
   ============================================ */
.bgag-kanban-wrapper {
    width: 100%;
}

.bgag-kanban-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
    min-height: 400px;
}

.bgag-kanban-column {
    flex: 0 0 280px;
    background: var(--bgag-bg-secondary);
    border: var(--bgag-border-width) solid var(--bgag-border);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 300px);
}

.bgag-kanban-column-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bgag-bg-tertiary);
    border-bottom: 2px solid var(--bgag-border);
}

.bgag-column-icon {
    font-size: 16px;
}

.bgag-column-name {
    flex: 1;
    font-weight: 600;
    font-size: 14px;
}

.bgag-column-count {
    background: var(--bgag-bg-primary);
    padding: 2px 8px;
    font-size: 12px;
    font-family: var(--bgag-font-mono);
}

.bgag-kanban-cards {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bgag-kanban-card {
    background: var(--bgag-bg-card);
    border: 2px solid var(--bgag-border);
    padding: 12px;
    cursor: grab;
    transition: var(--bgag-transition);
}

.bgag-kanban-card:hover {
    border-color: var(--bgag-accent);
}

.bgag-kanban-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.bgag-kanban-card[data-priority="urgent"] {
    border-left: 4px solid var(--bgag-danger);
}

.bgag-kanban-card[data-priority="high"] {
    border-left: 4px solid var(--bgag-warning);
}

.bgag-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.bgag-card-title {
    font-weight: 600;
    font-size: 13px;
    flex: 1;
}

.bgag-card-menu {
    background: none;
    border: none;
    color: var(--bgag-text-muted);
    cursor: pointer;
    padding: 0 4px;
}

.bgag-card-description {
    font-size: 12px;
    color: var(--bgag-text-secondary);
    margin-bottom: 8px;
    line-height: 1.4;
}

.bgag-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bgag-card-ghosts {
    display: flex;
    gap: -4px;
}

.bgag-ghost-avatar {
    font-size: 14px;
}

.bgag-ghost-more {
    font-size: 10px;
    color: var(--bgag-text-muted);
    margin-left: 4px;
}

.bgag-card-labels {
    display: flex;
    gap: 4px;
}

.bgag-label {
    font-size: 10px;
    padding: 2px 6px;
    background: var(--bgag-accent-dim);
    color: var(--bgag-accent);
}

.bgag-add-card {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px dashed var(--bgag-border);
    color: var(--bgag-text-muted);
    cursor: pointer;
    transition: var(--bgag-transition);
    font-size: 13px;
}

.bgag-add-card:hover {
    border-color: var(--bgag-accent);
    color: var(--bgag-accent);
}

/* ============================================
   CODE PANEL
   ============================================ */
.bgag-code-editor {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.bgag-code-toolbar {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: var(--bgag-bg-secondary);
    border-bottom: 1px solid var(--bgag-border);
}

.bgag-code-toolbar select {
    padding: 8px 12px;
    background: var(--bgag-bg-tertiary);
    border: 1px solid var(--bgag-border);
    color: var(--bgag-text-primary);
    font-family: var(--bgag-font-mono);
}

#bgag-code-textarea {
    flex: 1;
    width: 100%;
    padding: 16px;
    background: var(--bgag-bg-primary);
    border: none;
    color: var(--bgag-accent);
    font-family: var(--bgag-font-mono);
    font-size: 14px;
    line-height: 1.6;
    resize: none;
}

#bgag-code-textarea:focus {
    outline: none;
}

#bgag-code-textarea::placeholder {
    color: var(--bgag-text-muted);
}

/* ============================================
   PREVIEW PANEL
   ============================================ */
.bgag-preview-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.bgag-preview-toolbar {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: var(--bgag-bg-secondary);
    border-bottom: 1px solid var(--bgag-border);
}

.bgag-preview-size {
    padding: 8px 12px;
}

.bgag-preview-size.active {
    background: var(--bgag-accent);
    color: var(--bgag-bg-primary);
}

#bgag-preview-frame {
    flex: 1;
    width: 100%;
    background: #ffffff;
    border: none;
    transition: width 0.3s ease;
    margin: 0 auto;
}

#bgag-preview-frame[data-size="mobile"] {
    width: 375px;
}

#bgag-preview-frame[data-size="tablet"] {
    width: 768px;
}

/* ============================================
   FILES PANEL
   ============================================ */
.bgag-files-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 16px;
    height: 100%;
}

.bgag-files-tree {
    background: var(--bgag-bg-secondary);
    border: 1px solid var(--bgag-border);
    padding: 12px;
    overflow-y: auto;
}

.bgag-file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    cursor: pointer;
    transition: var(--bgag-transition);
    font-family: var(--bgag-font-mono);
    font-size: 13px;
}

.bgag-file-item:hover {
    background: var(--bgag-bg-tertiary);
}

.bgag-file-item.active {
    background: var(--bgag-accent-dim);
    color: var(--bgag-accent);
}

.bgag-file-viewer {
    background: var(--bgag-bg-secondary);
    border: 1px solid var(--bgag-border);
    padding: 16px;
    overflow: auto;
    font-family: var(--bgag-font-mono);
    font-size: 13px;
    white-space: pre-wrap;
}

/* ============================================
   MEMORY PANEL
   ============================================ */
.bgag-memory-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bgag-memory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bgag-memory-header h3 {
    font-size: 18px;
}

.bgag-memory-timeline {
    background: var(--bgag-bg-secondary);
    border: 1px solid var(--bgag-border);
    padding: 16px;
    max-height: 300px;
    overflow-y: auto;
}

.bgag-memory-entry {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--bgag-border);
}

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

.bgag-entry-key {
    font-family: var(--bgag-font-mono);
    color: var(--bgag-accent);
    min-width: 150px;
}

.bgag-entry-type {
    background: var(--bgag-bg-tertiary);
    padding: 2px 8px;
    font-size: 11px;
}

.bgag-entry-time {
    font-size: 11px;
    color: var(--bgag-text-muted);
    margin-left: auto;
}

.bgag-checkpoints h4 {
    margin-bottom: 12px;
}

.bgag-checkpoint-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bgag-bg-secondary);
    border: 1px solid var(--bgag-border);
    margin-bottom: 8px;
}

.bgag-checkpoint-name {
    flex: 1;
    font-family: var(--bgag-font-mono);
}

.bgag-checkpoint-time {
    font-size: 11px;
    color: var(--bgag-text-muted);
}

/* ============================================
   FOOTER / PROMPT INPUT
   ============================================ */
.bgag-console-footer {
    padding: 16px 20px;
    background: var(--bgag-bg-secondary);
    border-top: 2px solid var(--bgag-border);
}

.bgag-prompt-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bgag-selected-ghosts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bgag-ghost-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--bgag-bg-tertiary);
    border: 1px solid var(--bgag-border);
    font-size: 12px;
}

.bgag-ghost-tag.active {
    border-color: var(--bgag-accent);
    color: var(--bgag-accent);
}

.bgag-prompt-input-wrapper {
    display: flex;
    gap: 12px;
}

#bgag-prompt-input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bgag-bg-primary);
    border: 2px solid var(--bgag-border);
    color: var(--bgag-text-primary);
    font-family: var(--bgag-font-sans);
    font-size: 14px;
    resize: none;
}

#bgag-prompt-input:focus {
    outline: none;
    border-color: var(--bgag-accent);
}

/* Thinking Indicator */
.bgag-thinking-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bgag-accent-dim);
    margin-top: 12px;
}

.bgag-thinking-animation {
    display: flex;
    gap: 4px;
}

.bgag-thinking-animation span {
    animation: bgag-thinking 1.4s infinite;
    font-size: 10px;
}

.bgag-thinking-animation span:nth-child(2) {
    animation-delay: 0.2s;
}

.bgag-thinking-animation span:nth-child(3) {
    animation-delay: 0.4s;
}

.bgag-thinking-text {
    font-size: 13px;
    color: var(--bgag-accent);
}

/* ============================================
   MODAL
   ============================================ */
.bgag-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.bgag-modal-content {
    background: var(--bgag-bg-primary);
    border: 2px solid var(--bgag-border);
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow: auto;
}

.bgag-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bgag-bg-secondary);
    border-bottom: 1px solid var(--bgag-border);
}

.bgag-modal-header h2 {
    font-size: 18px;
}

.bgag-modal-close {
    background: none;
    border: none;
    color: var(--bgag-text-primary);
    font-size: 24px;
    cursor: pointer;
}

.bgag-modal-body {
    padding: 20px;
}

/* ============================================
   GHOST BUILDER FORM
   ============================================ */
.bgag-ghost-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bgag-form-row {
    display: flex;
    gap: 20px;
}

.bgag-gravatar-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.bgag-gravatar {
    width: 80px;
    height: 80px;
    background: var(--bgag-bg-secondary);
    border: 1px solid var(--bgag-border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bgag-gravatar img {
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
}

.bgag-gravatar-placeholder {
    font-size: 40px;
}

.bgag-form-fields {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bgag-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bgag-form-group label {
    font-size: 12px;
    color: var(--bgag-text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.bgag-form-group input,
.bgag-form-group select,
.bgag-form-group textarea {
    padding: 10px 12px;
    background: var(--bgag-bg-secondary);
    border: 1px solid var(--bgag-border);
    color: var(--bgag-text-primary);
    font-family: var(--bgag-font-sans);
    font-size: 14px;
}

.bgag-form-group input:focus,
.bgag-form-group select:focus,
.bgag-form-group textarea:focus {
    outline: none;
    border-color: var(--bgag-accent);
}

.bgag-input-with-button {
    display: flex;
    gap: 8px;
}

.bgag-input-with-button input,
.bgag-input-with-button textarea {
    flex: 1;
}

/* Skill Tree */
.bgag-skill-tree {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.bgag-skill-category {
    background: var(--bgag-bg-secondary);
    border: 1px solid var(--bgag-border);
    padding: 12px;
}

.bgag-skill-category h4 {
    font-size: 12px;
    color: var(--bgag-accent);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--bgag-border);
}

.bgag-skills {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bgag-skill-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    cursor: pointer;
}

.bgag-skill-checkbox input[type="checkbox"] {
    accent-color: var(--bgag-accent);
}

.bgag-skill-level {
    width: 60px;
    height: 4px;
    margin-left: auto;
}

.bgag-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--bgag-border);
}

/* ============================================
   LOADING / SHIMMER
   ============================================ */
.bgag-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 16px;
}

.bgag-shimmer {
    width: 200px;
    height: 20px;
    background: linear-gradient(
        90deg,
        var(--bgag-bg-secondary) 25%,
        var(--bgag-bg-tertiary) 50%,
        var(--bgag-bg-secondary) 75%
    );
    background-size: 200% 100%;
    animation: bgag-shimmer 1.5s infinite;
}

.bgag-empty {
    text-align: center;
    color: var(--bgag-text-muted);
    padding: 20px;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes bgag-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes bgag-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px) rotate(-5deg); }
    75% { transform: translateX(5px) rotate(5deg); }
}

@keyframes bgag-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes bgag-thinking {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .bgag-console-tabs {
        display: none;
    }
    
    .bgag-kanban-column {
        flex: 0 0 250px;
        border-width: 12px;
    }
    
    .bgag-files-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .bgag-console-header {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .bgag-agents-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .bgag-form-row {
        flex-direction: column;
    }
    
    .bgag-skill-tree {
        grid-template-columns: 1fr;
    }
    
    .bgag-prompt-input-wrapper {
        flex-direction: column;
    }
    
    .bgag-btn-execute {
        width: 100%;
        justify-content: center;
    }
}

/* Impreza Theme Compatibility - Override aggressive styles */
.bgag-console,
.bgag-console * {
    line-height: 1.5 !important;
}

.bgag-console h1,
.bgag-console h2,
.bgag-console h3,
.bgag-console h4 {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.3 !important;
}

.bgag-console button {
    letter-spacing: normal !important;
    text-transform: none !important;
}
