/**
 * Spectre AI - Main Stylesheet
 * 
 * ═══════════════════════════════════════════════════════════════════════════════
 * 🧊 SPECTRE AI | Bitghost.com | v0.1.0-beta
 * ═══════════════════════════════════════════════════════════════════════════════
 * 
 * Design System:
 * - Primary: #000000 (Black)
 * - Secondary: #ffffff (White)
 * - Accent: #FFB800 (Amber)
 * - Border Radius: 22px
 * - Font: Inter, system-ui
 */

/* ═══════════════════════════════════════════════════════════════════════════════
   CSS Variables
   ═══════════════════════════════════════════════════════════════════════════════ */

:root {
    /* Colors */
    --spectre-bg-primary: #000000;
    --spectre-bg-secondary: #0a0a0a;
    --spectre-bg-tertiary: #111111;
    --spectre-bg-card: #141414;
    --spectre-bg-hover: #1a1a1a;
    --spectre-bg-input: #0d0d0d;
    
    --spectre-text-primary: #ffffff;
    --spectre-text-secondary: #a0a0a0;
    --spectre-text-muted: #666666;
    
    --spectre-accent: #FFB800;
    --spectre-accent-hover: #FFC933;
    --spectre-accent-glow: rgba(255, 184, 0, 0.3);
    
    --spectre-border: #2a2a2a;
    --spectre-border-light: #333333;
    --spectre-border-focus: #FFB800;
    
    --spectre-success: #00ff88;
    --spectre-error: #ff4444;
    --spectre-warning: #ffaa00;
    --spectre-info: #00aaff;
    
    /* Sizing */
    --spectre-radius-sm: 8px;
    --spectre-radius-md: 12px;
    --spectre-radius-lg: 22px;
    --spectre-radius-xl: 28px;
    
    /* Shadows */
    --spectre-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --spectre-shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --spectre-shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --spectre-shadow-glow: 0 0 30px var(--spectre-accent-glow);
    
    /* Transitions */
    --spectre-transition-fast: 0.15s ease;
    --spectre-transition-normal: 0.25s ease;
    --spectre-transition-slow: 0.4s ease;
    
    /* Font */
    --spectre-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --spectre-font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Base Styles
   ═══════════════════════════════════════════════════════════════════════════════ */

.spectre-ai-container {
    position: relative;
    min-height: 100vh;
    background: var(--spectre-bg-primary);
    color: var(--spectre-text-primary);
    font-family: var(--spectre-font-family);
    font-size: 14px;
    line-height: 1.6;
    overflow-x: hidden;
}

.spectre-ai-container * {
    box-sizing: border-box;
}

.spectre-ai-container a {
    color: var(--spectre-accent);
    text-decoration: none;
    transition: color var(--spectre-transition-fast);
}

.spectre-ai-container a:hover {
    color: var(--spectre-accent-hover);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Matrix Background
   ═══════════════════════════════════════════════════════════════════════════════ */

.spectre-matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.15;
}

/* Mouse Glow Effect */
.spectre-mouse-glow {
    position: fixed;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--spectre-accent-glow) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.spectre-ai-container:hover .spectre-mouse-glow {
    opacity: 0.5;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Header
   ═══════════════════════════════════════════════════════════════════════════════ */

.spectre-header {
    position: relative;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--spectre-border);
}

.spectre-header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.spectre-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--spectre-text-primary);
}

.spectre-logo-icon {
    font-size: 24px;
}

.spectre-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.spectre-credits-display {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--spectre-bg-card);
    border: 1px solid var(--spectre-border);
    border-radius: var(--spectre-radius-lg);
    font-size: 13px;
}

.spectre-credits-icon {
    color: var(--spectre-accent);
}

/* Buttons */
.spectre-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--spectre-radius-lg);
    cursor: pointer;
    transition: all var(--spectre-transition-fast);
    border: none;
    outline: none;
}

.spectre-btn-primary {
    background: var(--spectre-accent);
    color: #000;
}

.spectre-btn-primary:hover {
    background: var(--spectre-accent-hover);
    box-shadow: var(--spectre-shadow-glow);
}

.spectre-btn-ghost {
    background: transparent;
    color: var(--spectre-text-primary);
    border: 1px solid var(--spectre-border);
}

.spectre-btn-ghost:hover {
    background: var(--spectre-bg-hover);
    border-color: var(--spectre-border-light);
}

/* User Menu */
.spectre-user-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--spectre-bg-card);
    border: 1px solid var(--spectre-border);
    cursor: pointer;
    transition: all var(--spectre-transition-fast);
}

.spectre-user-btn:hover {
    border-color: var(--spectre-accent);
}

.spectre-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--spectre-text-primary);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Main Content
   ═══════════════════════════════════════════════════════════════════════════════ */

.spectre-main {
    position: relative;
    z-index: 10;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Hero Section
   ═══════════════════════════════════════════════════════════════════════════════ */

.spectre-hero {
    text-align: center;
    padding: 60px 0;
}

.spectre-hero-title {
    font-size: 48px;
    font-weight: 700;
    margin: 0 0 16px 0;
    letter-spacing: -0.02em;
}

.spectre-title-gradient {
    background: linear-gradient(135deg, #fff 0%, #FFB800 50%, #fff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}

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

.spectre-hero-subtitle {
    font-size: 18px;
    color: var(--spectre-text-secondary);
    margin: 0 0 40px 0;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Prompt Input
   ═══════════════════════════════════════════════════════════════════════════════ */

.spectre-prompt-container {
    max-width: 720px;
    margin: 0 auto;
}

.spectre-prompt-box {
    background: var(--spectre-bg-card);
    border: 1px solid var(--spectre-border);
    border-radius: var(--spectre-radius-lg);
    padding: 16px;
    transition: all var(--spectre-transition-normal);
}

.spectre-prompt-box:focus-within {
    border-color: var(--spectre-accent);
    box-shadow: var(--spectre-shadow-glow);
}

.spectre-prompt-input-wrapper {
    margin-bottom: 12px;
}

.spectre-prompt-input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--spectre-text-primary);
    font-family: var(--spectre-font-family);
    font-size: 16px;
    line-height: 1.5;
    resize: none;
    outline: none;
    min-height: 24px;
    max-height: 200px;
}

.spectre-prompt-input::placeholder {
    color: var(--spectre-text-muted);
}

.spectre-prompt-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.spectre-prompt-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

.spectre-tool-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--spectre-bg-hover);
    border: 1px solid var(--spectre-border);
    border-radius: var(--spectre-radius-sm);
    cursor: pointer;
    transition: all var(--spectre-transition-fast);
}

.spectre-tool-btn:hover {
    background: var(--spectre-bg-tertiary);
    border-color: var(--spectre-border-light);
}

.spectre-icon {
    font-size: 16px;
}

/* Model Selector */
.spectre-model-selector {
    position: relative;
}

.spectre-model-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--spectre-bg-hover);
    border: 1px solid var(--spectre-border);
    border-radius: var(--spectre-radius-sm);
    cursor: pointer;
    transition: all var(--spectre-transition-fast);
    color: var(--spectre-text-primary);
    font-size: 13px;
}

.spectre-model-btn:hover {
    border-color: var(--spectre-accent);
}

.spectre-model-icon {
    color: var(--spectre-accent);
}

.spectre-dropdown-arrow {
    font-size: 10px;
    color: var(--spectre-text-muted);
    transition: transform var(--spectre-transition-fast);
}

.spectre-model-selector.open .spectre-dropdown-arrow {
    transform: rotate(180deg);
}

.spectre-model-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    min-width: 280px;
    background: var(--spectre-bg-card);
    border: 1px solid var(--spectre-border);
    border-radius: var(--spectre-radius-md);
    box-shadow: var(--spectre-shadow-lg);
    z-index: 1000;
    display: none;
}

.spectre-model-selector.open .spectre-model-dropdown {
    display: block;
}

.spectre-model-option {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: all var(--spectre-transition-fast);
}

.spectre-model-option:hover {
    background: var(--spectre-bg-hover);
}

.spectre-model-option.active {
    background: rgba(255, 184, 0, 0.1);
}

.spectre-model-option-name {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--spectre-text-primary);
}

.spectre-model-option-desc {
    display: block;
    font-size: 12px;
    color: var(--spectre-text-muted);
    margin-top: 2px;
}

/* Prompt Actions */
.spectre-prompt-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.spectre-visibility-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--spectre-bg-hover);
    border-radius: var(--spectre-radius-sm);
    font-size: 12px;
    color: var(--spectre-text-secondary);
}

.spectre-toggle-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--spectre-border);
    border-radius: var(--spectre-radius-sm);
    cursor: pointer;
    transition: all var(--spectre-transition-fast);
    color: var(--spectre-text-secondary);
}

.spectre-toggle-btn:hover {
    background: var(--spectre-bg-hover);
    color: var(--spectre-text-primary);
}

.spectre-submit-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--spectre-accent);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--spectre-transition-fast);
}

.spectre-submit-btn:hover {
    background: var(--spectre-accent-hover);
    box-shadow: var(--spectre-shadow-glow);
    transform: scale(1.05);
}

.spectre-submit-icon {
    font-size: 20px;
    color: #000;
}

/* Quick Prompts */
.spectre-quick-prompts {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.spectre-quick-prompt {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--spectre-bg-card);
    border: 1px solid var(--spectre-border);
    border-radius: var(--spectre-radius-lg);
    cursor: pointer;
    transition: all var(--spectre-transition-fast);
    color: var(--spectre-text-secondary);
    font-size: 13px;
}

.spectre-quick-prompt:hover {
    background: var(--spectre-bg-hover);
    border-color: var(--spectre-border-light);
    color: var(--spectre-text-primary);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Tasks Section
   ═══════════════════════════════════════════════════════════════════════════════ */

.spectre-tasks-section {
    margin-top: 60px;
}

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

.spectre-tasks-tabs {
    display: flex;
    gap: 8px;
}

.spectre-tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: var(--spectre-text-muted);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--spectre-transition-fast);
    border-radius: var(--spectre-radius-md);
}

.spectre-tab-btn:hover {
    color: var(--spectre-text-secondary);
    background: var(--spectre-bg-hover);
}

.spectre-tab-btn.active {
    color: var(--spectre-text-primary);
    background: var(--spectre-bg-card);
}

.spectre-refresh-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--spectre-border);
    border-radius: var(--spectre-radius-sm);
    cursor: pointer;
    transition: all var(--spectre-transition-fast);
    color: var(--spectre-text-muted);
}

.spectre-refresh-btn:hover {
    background: var(--spectre-bg-hover);
    color: var(--spectre-text-primary);
}

/* Tasks Table */
.spectre-tasks-content {
    background: var(--spectre-bg-card);
    border: 1px solid var(--spectre-border);
    border-radius: var(--spectre-radius-lg);
    overflow: hidden;
}

.spectre-tab-panel {
    display: none;
}

.spectre-tab-panel.active {
    display: block;
}

.spectre-tasks-table {
    width: 100%;
}

.spectre-table-header {
    display: grid;
    grid-template-columns: 120px 1fr 150px 60px;
    padding: 12px 20px;
    background: var(--spectre-bg-tertiary);
    border-bottom: 1px solid var(--spectre-border);
}

.spectre-th {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--spectre-text-muted);
    letter-spacing: 0.5px;
}

.spectre-table-row {
    display: grid;
    grid-template-columns: 120px 1fr 150px 60px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--spectre-border);
    transition: background var(--spectre-transition-fast);
    cursor: pointer;
}

.spectre-table-row:hover {
    background: var(--spectre-bg-hover);
}

.spectre-table-row:last-child {
    border-bottom: none;
}

.spectre-task-id {
    font-family: var(--spectre-font-mono);
    font-size: 12px;
    color: var(--spectre-accent);
}

.spectre-task-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.spectre-task-title {
    font-weight: 500;
    color: var(--spectre-text-primary);
}

.spectre-task-desc {
    font-size: 12px;
    color: var(--spectre-text-muted);
}

.spectre-time-ago {
    font-size: 13px;
    color: var(--spectre-text-secondary);
}

.spectre-action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--spectre-text-muted);
    border-radius: var(--spectre-radius-sm);
    transition: all var(--spectre-transition-fast);
}

.spectre-action-btn:hover {
    background: var(--spectre-bg-tertiary);
    color: var(--spectre-text-primary);
}

/* Empty State */
.spectre-empty-state {
    padding: 60px 20px;
    text-align: center;
}

.spectre-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.spectre-empty-text {
    color: var(--spectre-text-muted);
    font-size: 14px;
}

/* Pagination */
.spectre-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-top: 1px solid var(--spectre-border);
}

.spectre-page-info {
    font-size: 13px;
    color: var(--spectre-text-muted);
}

.spectre-page-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.spectre-page-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--spectre-bg-hover);
    border: 1px solid var(--spectre-border);
    border-radius: var(--spectre-radius-sm);
    cursor: pointer;
    color: var(--spectre-text-primary);
    transition: all var(--spectre-transition-fast);
}

.spectre-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.spectre-page-btn:not(:disabled):hover {
    border-color: var(--spectre-accent);
}

.spectre-page-current {
    font-weight: 500;
}

.spectre-page-size {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--spectre-text-muted);
}

.spectre-page-size select {
    padding: 6px 10px;
    background: var(--spectre-bg-hover);
    border: 1px solid var(--spectre-border);
    border-radius: var(--spectre-radius-sm);
    color: var(--spectre-text-primary);
    font-size: 13px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Showcase Section
   ═══════════════════════════════════════════════════════════════════════════════ */

.spectre-showcase-section {
    margin-top: 80px;
}

.spectre-showcase-header {
    margin-bottom: 24px;
}

.spectre-showcase-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.spectre-showcase-subtitle {
    color: var(--spectre-text-muted);
    font-size: 14px;
    margin: 0;
}

.spectre-showcase-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.spectre-filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--spectre-bg-card);
    border: 1px solid var(--spectre-border);
    border-radius: var(--spectre-radius-lg);
    cursor: pointer;
    transition: all var(--spectre-transition-fast);
    color: var(--spectre-text-secondary);
    font-size: 13px;
}

.spectre-filter-btn:hover {
    border-color: var(--spectre-border-light);
    color: var(--spectre-text-primary);
}

.spectre-filter-btn.active {
    background: var(--spectre-accent);
    border-color: var(--spectre-accent);
    color: #000;
}

/* Showcase Grid */
.spectre-showcase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.spectre-showcase-card {
    background: var(--spectre-bg-card);
    border: 1px solid var(--spectre-border);
    border-radius: var(--spectre-radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--spectre-transition-normal);
}

.spectre-showcase-card:hover {
    border-color: var(--spectre-border-light);
    transform: translateY(-4px);
    box-shadow: var(--spectre-shadow-lg);
}

.spectre-card-preview {
    aspect-ratio: 16/10;
    background: var(--spectre-bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.spectre-card-placeholder {
    font-size: 48px;
    opacity: 0.3;
}

.spectre-card-info {
    padding: 16px;
}

.spectre-card-title {
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 4px 0;
    color: var(--spectre-text-primary);
}

.spectre-card-category {
    font-size: 12px;
    color: var(--spectre-text-muted);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Chat Panel
   ═══════════════════════════════════════════════════════════════════════════════ */

.spectre-chat-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 900px;
    height: 100vh;
    background: var(--spectre-bg-secondary);
    border-left: 1px solid var(--spectre-border);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: right var(--spectre-transition-slow);
}

.spectre-chat-panel.open {
    right: 0;
}

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

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

.spectre-chat-icon {
    font-size: 20px;
}

.spectre-chat-actions {
    display: flex;
    gap: 8px;
}

.spectre-chat-action-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--spectre-border);
    border-radius: var(--spectre-radius-sm);
    cursor: pointer;
    color: var(--spectre-text-muted);
    transition: all var(--spectre-transition-fast);
}

.spectre-chat-action-btn:hover {
    background: var(--spectre-bg-hover);
    color: var(--spectre-text-primary);
}

.spectre-chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.spectre-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Messages */
.spectre-message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.spectre-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--spectre-bg-card);
    border: 1px solid var(--spectre-border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.spectre-message.user .spectre-message-avatar {
    background: var(--spectre-accent);
    color: #000;
}

.spectre-message.assistant .spectre-message-avatar {
    background: var(--spectre-bg-tertiary);
}

.spectre-message-content {
    flex: 1;
    min-width: 0;
}

.spectre-message-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.spectre-message-sender {
    font-weight: 500;
    font-size: 13px;
}

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

.spectre-message-body {
    font-size: 14px;
    line-height: 1.6;
    color: var(--spectre-text-secondary);
}

.spectre-message-body pre {
    background: var(--spectre-bg-primary);
    border: 1px solid var(--spectre-border);
    border-radius: var(--spectre-radius-md);
    padding: 16px;
    overflow-x: auto;
    font-family: var(--spectre-font-mono);
    font-size: 13px;
    margin: 12px 0;
}

.spectre-message-body code {
    font-family: var(--spectre-font-mono);
    background: var(--spectre-bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

/* Preview Panel */
.spectre-preview-panel {
    border-top: 1px solid var(--spectre-border);
    background: var(--spectre-bg-primary);
}

.spectre-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--spectre-border);
}

.spectre-preview-tabs {
    display: flex;
    gap: 4px;
}

.spectre-preview-tab {
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: var(--spectre-text-muted);
    font-size: 13px;
    cursor: pointer;
    border-radius: var(--spectre-radius-sm);
    transition: all var(--spectre-transition-fast);
}

.spectre-preview-tab:hover {
    color: var(--spectre-text-secondary);
}

.spectre-preview-tab.active {
    background: var(--spectre-bg-card);
    color: var(--spectre-text-primary);
}

.spectre-preview-actions {
    display: flex;
    gap: 6px;
}

.spectre-preview-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--spectre-border);
    border-radius: var(--spectre-radius-sm);
    cursor: pointer;
    color: var(--spectre-text-muted);
    transition: all var(--spectre-transition-fast);
}

.spectre-preview-btn:hover {
    background: var(--spectre-bg-hover);
    color: var(--spectre-text-primary);
}

.spectre-preview-content {
    height: 300px;
    background: #fff;
}

.spectre-preview-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.spectre-code-viewer {
    height: 100%;
    overflow: auto;
    background: var(--spectre-bg-primary);
    padding: 16px;
    font-family: var(--spectre-font-mono);
    font-size: 13px;
    color: var(--spectre-text-secondary);
}

.spectre-files-tree {
    padding: 16px;
}

/* Chat Input */
.spectre-chat-input-container {
    padding: 16px;
    background: var(--spectre-bg-primary);
    border-top: 1px solid var(--spectre-border);
}

.spectre-chat-input-wrapper {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    background: var(--spectre-bg-card);
    border: 1px solid var(--spectre-border);
    border-radius: var(--spectre-radius-lg);
}

.spectre-chat-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--spectre-text-primary);
    font-family: var(--spectre-font-family);
    font-size: 14px;
    resize: none;
    outline: none;
}

.spectre-chat-input::placeholder {
    color: var(--spectre-text-muted);
}

.spectre-chat-send-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--spectre-accent);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--spectre-transition-fast);
}

.spectre-chat-send-btn:hover {
    background: var(--spectre-accent-hover);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Loading Overlay
   ═══════════════════════════════════════════════════════════════════════════════ */

.spectre-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all var(--spectre-transition-normal);
}

.spectre-loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.spectre-loading-spinner {
    text-align: center;
}

.spectre-spinner-ring {
    width: 60px;
    height: 60px;
    border: 3px solid var(--spectre-border);
    border-top-color: var(--spectre-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.spectre-spinner-ring:nth-child(2) {
    width: 48px;
    height: 48px;
    animation-duration: 0.8s;
    animation-direction: reverse;
    position: absolute;
    top: 6px;
    left: 6px;
}

.spectre-spinner-ring:nth-child(3) {
    width: 36px;
    height: 36px;
    animation-duration: 0.6s;
    position: absolute;
    top: 12px;
    left: 12px;
}

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

.spectre-loading-text {
    font-size: 16px;
    color: var(--spectre-text-secondary);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Toast Notifications
   ═══════════════════════════════════════════════════════════════════════════════ */

.spectre-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.spectre-toast {
    padding: 16px 20px;
    background: var(--spectre-bg-card);
    border: 1px solid var(--spectre-border);
    border-radius: var(--spectre-radius-md);
    box-shadow: var(--spectre-shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
    min-width: 300px;
}

.spectre-toast.success {
    border-color: var(--spectre-success);
}

.spectre-toast.error {
    border-color: var(--spectre-error);
}

.spectre-toast.warning {
    border-color: var(--spectre-warning);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Responsive Design
   ═══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .spectre-hero-title {
        font-size: 32px;
    }
    
    .spectre-hero-subtitle {
        font-size: 16px;
    }
    
    .spectre-prompt-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .spectre-prompt-tools,
    .spectre-prompt-actions {
        justify-content: space-between;
    }
    
    .spectre-table-header,
    .spectre-table-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .spectre-th-id,
    .spectre-th-modified,
    .spectre-th-actions,
    .spectre-td-modified,
    .spectre-td-actions {
        display: none;
    }
    
    .spectre-showcase-grid {
        grid-template-columns: 1fr;
    }
    
    .spectre-chat-panel {
        max-width: 100%;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Shimmer Animation
   ═══════════════════════════════════════════════════════════════════════════════ */

.spectre-shimmer {
    background: linear-gradient(
        90deg,
        var(--spectre-bg-card) 0%,
        var(--spectre-bg-hover) 50%,
        var(--spectre-bg-card) 100%
    );
    background-size: 200% 100%;
    animation: shimmerBg 2s ease-in-out infinite;
}

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

/* Glow Effect on Hover */
.spectre-glow-hover {
    position: relative;
}

.spectre-glow-hover::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, var(--spectre-accent), transparent, var(--spectre-accent));
    border-radius: inherit;
    opacity: 0;
    transition: opacity var(--spectre-transition-normal);
    z-index: -1;
}

.spectre-glow-hover:hover::before {
    opacity: 0.5;
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Toggle Switch
   ═══════════════════════════════════════════════════════════════════════════════ */

.spectre-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.spectre-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.spectre-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--spectre-bg-tertiary);
    transition: var(--spectre-transition-fast);
    border-radius: 20px;
    border: 1px solid var(--spectre-border);
}

.spectre-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: var(--spectre-text-primary);
    transition: var(--spectre-transition-fast);
    border-radius: 50%;
}

.spectre-switch input:checked + .spectre-slider {
    background-color: var(--spectre-accent);
}

.spectre-switch input:checked + .spectre-slider:before {
    transform: translateX(16px);
    background-color: #000;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Deployed Apps Grid
   ═══════════════════════════════════════════════════════════════════════════════ */

.spectre-deployed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px;
}

.spectre-deployed-card {
    background: var(--spectre-bg-tertiary);
    border: 1px solid var(--spectre-border);
    border-radius: var(--spectre-radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--spectre-transition-normal);
}

.spectre-deployed-card:hover {
    border-color: var(--spectre-border-light);
    transform: translateY(-4px);
    box-shadow: var(--spectre-shadow-lg);
}

.spectre-deployed-preview {
    aspect-ratio: 16/10;
    background: var(--spectre-bg-primary);
    overflow: hidden;
}

.spectre-deployed-preview iframe {
    width: 100%;
    height: 100%;
    border: none;
    pointer-events: none;
}

.spectre-deployed-info {
    padding: 16px;
}

.spectre-deployed-info h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--spectre-text-primary);
}

.spectre-deployed-info p {
    margin: 0;
    font-size: 12px;
    color: var(--spectre-text-muted);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Status Badges
   ═══════════════════════════════════════════════════════════════════════════════ */

.spectre-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.spectre-status-draft {
    background: rgba(102, 102, 102, 0.2);
    color: var(--spectre-text-muted);
}

.spectre-status-processing {
    background: rgba(0, 170, 255, 0.2);
    color: var(--spectre-info);
}

.spectre-status-completed {
    background: rgba(0, 255, 136, 0.2);
    color: var(--spectre-success);
}

.spectre-status-deployed {
    background: rgba(255, 184, 0, 0.2);
    color: var(--spectre-accent);
}

.spectre-status-failed {
    background: rgba(255, 68, 68, 0.2);
    color: var(--spectre-error);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Context Menu
   ═══════════════════════════════════════════════════════════════════════════════ */

.spectre-context-menu {
    position: absolute;
    min-width: 180px;
    background: var(--spectre-bg-card);
    border: 1px solid var(--spectre-border);
    border-radius: var(--spectre-radius-md);
    box-shadow: var(--spectre-shadow-lg);
    z-index: 1000;
    overflow: hidden;
}

.spectre-context-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--spectre-text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: background var(--spectre-transition-fast);
    text-align: left;
}

.spectre-context-menu-item:hover {
    background: var(--spectre-bg-hover);
}

.spectre-context-menu-item.danger {
    color: var(--spectre-error);
}

.spectre-context-menu-divider {
    height: 1px;
    background: var(--spectre-border);
    margin: 4px 0;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Skeleton Loading
   ═══════════════════════════════════════════════════════════════════════════════ */

.spectre-skeleton {
    background: linear-gradient(
        90deg,
        var(--spectre-bg-tertiary) 25%,
        var(--spectre-bg-hover) 50%,
        var(--spectre-bg-tertiary) 75%
    );
    background-size: 400% 100%;
    animation: skeleton 1.5s ease-in-out infinite;
    border-radius: var(--spectre-radius-sm);
}

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

.spectre-skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.spectre-skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 12px;
}

.spectre-skeleton-card {
    height: 200px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Modal Overlay
   ═══════════════════════════════════════════════════════════════════════════════ */

.spectre-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--spectre-transition-normal);
}

.spectre-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.spectre-modal {
    background: var(--spectre-bg-card);
    border: 1px solid var(--spectre-border);
    border-radius: var(--spectre-radius-lg);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform var(--spectre-transition-normal);
}

.spectre-modal-overlay.active .spectre-modal {
    transform: scale(1);
}

.spectre-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--spectre-border);
}

.spectre-modal-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.spectre-modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--spectre-text-muted);
    cursor: pointer;
    border-radius: var(--spectre-radius-sm);
    transition: all var(--spectre-transition-fast);
}

.spectre-modal-close:hover {
    background: var(--spectre-bg-hover);
    color: var(--spectre-text-primary);
}

.spectre-modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(80vh - 140px);
}

.spectre-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--spectre-border);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Form Elements
   ═══════════════════════════════════════════════════════════════════════════════ */

.spectre-form-group {
    margin-bottom: 20px;
}

.spectre-form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--spectre-text-secondary);
    margin-bottom: 8px;
}

.spectre-form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--spectre-bg-input);
    border: 1px solid var(--spectre-border);
    border-radius: var(--spectre-radius-md);
    color: var(--spectre-text-primary);
    font-family: var(--spectre-font-family);
    font-size: 14px;
    transition: all var(--spectre-transition-fast);
}

.spectre-form-input:focus {
    outline: none;
    border-color: var(--spectre-accent);
    box-shadow: 0 0 0 3px var(--spectre-accent-glow);
}

.spectre-form-input::placeholder {
    color: var(--spectre-text-muted);
}

.spectre-form-textarea {
    min-height: 100px;
    resize: vertical;
}

.spectre-form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Progress Bar
   ═══════════════════════════════════════════════════════════════════════════════ */

.spectre-progress {
    height: 6px;
    background: var(--spectre-bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.spectre-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--spectre-accent), var(--spectre-accent-hover));
    border-radius: 3px;
    transition: width var(--spectre-transition-slow);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Pulse Animation for Live Elements
   ═══════════════════════════════════════════════════════════════════════════════ */

.spectre-pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.spectre-live-dot {
    width: 8px;
    height: 8px;
    background: var(--spectre-success);
    border-radius: 50%;
    animation: livePulse 1.5s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.4);
    }
    50% { 
        box-shadow: 0 0 0 8px rgba(0, 255, 136, 0);
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Code Block Enhancements
   ═══════════════════════════════════════════════════════════════════════════════ */

.spectre-code-block {
    position: relative;
    background: var(--spectre-bg-primary);
    border: 1px solid var(--spectre-border);
    border-radius: var(--spectre-radius-md);
    overflow: hidden;
}

.spectre-code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: var(--spectre-bg-tertiary);
    border-bottom: 1px solid var(--spectre-border);
}

.spectre-code-lang {
    font-size: 12px;
    font-weight: 500;
    color: var(--spectre-text-muted);
    text-transform: uppercase;
}

.spectre-code-copy {
    padding: 4px 8px;
    background: transparent;
    border: 1px solid var(--spectre-border);
    border-radius: var(--spectre-radius-sm);
    color: var(--spectre-text-muted);
    font-size: 11px;
    cursor: pointer;
    transition: all var(--spectre-transition-fast);
}

.spectre-code-copy:hover {
    background: var(--spectre-bg-hover);
    color: var(--spectre-text-primary);
}

.spectre-code-copy.copied {
    background: var(--spectre-success);
    border-color: var(--spectre-success);
    color: #000;
}

.spectre-code-content {
    padding: 16px;
    overflow-x: auto;
}

.spectre-code-content pre {
    margin: 0;
    font-family: var(--spectre-font-mono);
    font-size: 13px;
    line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Tooltip
   ═══════════════════════════════════════════════════════════════════════════════ */

.spectre-tooltip {
    position: relative;
}

.spectre-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: var(--spectre-bg-tertiary);
    border: 1px solid var(--spectre-border);
    border-radius: var(--spectre-radius-sm);
    font-size: 12px;
    color: var(--spectre-text-primary);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--spectre-transition-fast);
    pointer-events: none;
    margin-bottom: 8px;
}

.spectre-tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   WordPress Theme Compatibility
   ═══════════════════════════════════════════════════════════════════════════════ */

.spectre-ai-container,
.spectre-ai-container * {
    box-sizing: border-box;
}

.spectre-ai-container h1,
.spectre-ai-container h2,
.spectre-ai-container h3,
.spectre-ai-container h4,
.spectre-ai-container h5,
.spectre-ai-container h6 {
    margin: 0;
    font-family: var(--spectre-font-family);
    color: var(--spectre-text-primary);
}

.spectre-ai-container p {
    margin: 0;
}

.spectre-ai-container ul,
.spectre-ai-container ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

.spectre-ai-container button {
    font-family: var(--spectre-font-family);
}

.spectre-ai-container select {
    font-family: var(--spectre-font-family);
}

.spectre-ai-container input,
.spectre-ai-container textarea {
    font-family: var(--spectre-font-family);
}

/* Full width container override */
body.spectre-full-width .site-content,
body.spectre-full-width .content-area,
body.spectre-full-width main {
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Hide WordPress theme elements when using Spectre */
body.spectre-active #masthead,
body.spectre-active .site-header,
body.spectre-active #colophon,
body.spectre-active .site-footer {
    display: none !important;
}
