/* CSS Design System for AetherDev Pro IDE */

:root {
    --bg-dark: #070913;
    --bg-panel: rgba(15, 22, 42, 0.65);
    --bg-panel-solid: #0f172a;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(0, 242, 254, 0.15);
    
    /* Neon Accents */
    --color-cyan: #00f2fe;
    --color-emerald: #10b981;
    --color-amber: #f59e0b;
    --color-rose: #f43f5e;
    --color-violet: #8b5cf6;
    --color-gray: #64748b;
    
    /* Text colors */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    
    --transition-speed: 0.25s;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Plus Jakarta Sans', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background-image: 
        radial-gradient(at 10% 20%, rgba(139, 92, 246, 0.08) 0px, transparent 50%),
        radial-gradient(at 90% 10%, rgba(0, 242, 254, 0.08) 0px, transparent 50%),
        radial-gradient(at 50% 80%, rgba(16, 185, 129, 0.05) 0px, transparent 50%);
    background-attachment: fixed;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 242, 254, 0.3);
}

/* APP CONTAINER */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 1rem;
    gap: 1rem;
}

/* NAVBAR HEADER */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.logo-glow {
    position: absolute;
    width: 30px;
    height: 30px;
    background: var(--color-cyan);
    filter: blur(15px);
    opacity: 0.6;
    border-radius: 50%;
    z-index: 1;
}

.logo-icon {
    font-size: 1.5rem;
    color: var(--color-cyan);
    z-index: 2;
    animation: pulse 3s infinite alternate;
}

.brand-name {
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: 1.5px;
    z-index: 2;
}

.gradient-text {
    background: linear-gradient(135deg, var(--color-cyan) 0%, var(--color-violet) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.api-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    color: #34d399;
}

.text-emerald {
    color: var(--color-emerald);
}

/* DASHBOARD GRID */
.dashboard-grid {
    display: grid;
    grid-template-columns: 320px 1fr 340px;
    grid-template-rows: calc(100vh - 180px - 72px) 180px;
    gap: 1rem;
    flex-grow: 1;
    min-height: 0;
}

/* PANEL BASE */
.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: border-color var(--transition-speed);
}

.panel:hover {
    border-color: rgba(0, 242, 254, 0.2);
}

.panel-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
}

.panel-header h2 {
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-main);
}

.panel-icon {
    color: var(--color-cyan);
    font-size: 1rem;
}

.panel-body {
    padding: 1rem;
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* 1. CONTROL PANEL (LEFT) */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.form-group label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group-sm {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.form-group-sm label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

textarea, select, input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all var(--transition-speed);
}

textarea:focus, select:focus, input:focus {
    outline: none;
    border-color: var(--color-cyan);
    box-shadow: 0 0 8px rgba(0, 242, 254, 0.2);
}

textarea {
    resize: none;
    height: 110px;
    line-height: 1.4;
}

/* Collapsible Accordion Styles */
.accordion {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.01);
    overflow: hidden;
}

.accordion-header {
    padding: 0.6rem 0.75rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background var(--transition-speed);
}

.accordion-header:hover {
    background: rgba(255, 255, 255, 0.06);
}

.accordion-chevron {
    transition: transform var(--transition-speed);
    color: var(--text-muted);
}

.accordion-chevron.rotate {
    transform: rotate(180deg);
}

.accordion-content {
    padding: 0.75rem;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    animation: slideDown 0.2s ease-out;
}

.agent-model-select {
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-cyan) 0%, var(--color-violet) 100%);
    color: #030712;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.25);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 242, 254, 0.4);
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-muted);
}

.btn-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.btn-success:hover {
    background: rgba(16, 185, 129, 0.25);
    border-color: var(--color-emerald);
}

.btn-ghost {
    background: transparent;
    border: none;
    color: var(--text-muted);
}

.btn-ghost:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

/* PROJECT INFO BOX */
.project-info-box {
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    animation: fadeIn 0.4s ease-out;
}

.project-info-box h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.35rem;
    margin-bottom: 0.25rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.info-label {
    color: var(--text-muted);
}

.info-value {
    color: var(--text-main);
    text-align: right;
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* PROGRESS BAR */
.progress-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--color-cyan), var(--color-violet));
    border-radius: 2px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 2. EDITOR / FILE EXPLORER PANEL (MIDDLE) */
.editor-panel {
    grid-column: 2;
}

.editor-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    height: 100%;
}

/* FILE EXPLORER */
.file-explorer {
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.15);
}

.sub-panel-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.file-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.file-item {
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-speed);
    margin-bottom: 0.25rem;
    border-left: 2px solid transparent;
}

.file-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.file-item.active {
    background: rgba(0, 242, 254, 0.06);
    border-left-color: var(--color-cyan);
}

.file-item-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.file-item-header .file-name {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.file-item-header .file-size {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.file-item-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-left: 1.25rem;
    margin-top: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* CODE VIEWER / MONACO IDE */
.code-viewer {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.1);
}

.active-filename {
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.text-cyan {
    color: var(--color-cyan);
}

.editor-actions {
    display: flex;
    gap: 0.5rem;
}

.code-body-container {
    flex-grow: 1;
    position: relative;
    background: #1e1e2e;
}

.code-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    gap: 0.75rem;
    z-index: 10;
}

.code-placeholder i {
    font-size: 2.5rem;
    color: var(--border-color);
    animation: floating 4s ease-in-out infinite;
}

/* Monaco target container */
#monaco-editor-target {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
}

/* 3. PIPELINE PIPELINE PANEL (RIGHT) */
.pipeline-panel {
    grid-column: 3;
}

.agent-timeline {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 0.25rem;
}

.timeline-node {
    display: flex;
    gap: 1rem;
    position: relative;
    padding-bottom: 0.5rem;
    transition: opacity var(--transition-speed);
}

.timeline-node:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 20px;
    top: 40px;
    bottom: -15px;
    width: 2px;
    background: var(--border-color);
    z-index: 1;
}

.timeline-node.active:not(:last-child)::after {
    background: linear-gradient(180deg, var(--color-cyan), var(--border-color));
}

.timeline-node.completed:not(:last-child)::after {
    background: var(--color-emerald);
}

.node-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--text-muted);
    flex-shrink: 0;
    z-index: 2;
    transition: all var(--transition-speed);
}

.node-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.node-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.node-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
    transition: color var(--transition-speed);
}

.node-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Node glows and styles */
.bg-cyan-glow { --node-glow: var(--color-cyan); }
.bg-emerald-glow { --node-glow: var(--color-emerald); }
.bg-amber-glow { --node-glow: var(--color-amber); }
.bg-rose-glow { --node-glow: var(--color-rose); }
.bg-violet-glow { --node-glow: var(--color-violet); }

.timeline-node.active .node-icon {
    border-color: var(--node-glow);
    box-shadow: 0 0 12px var(--node-glow);
    color: var(--node-glow);
    background: rgba(0, 0, 0, 0.2);
    animation: pulseGlow 2s infinite;
}

.timeline-node.active .node-name {
    color: var(--text-main);
}

.timeline-node.completed .node-icon {
    border-color: var(--color-emerald);
    color: var(--color-emerald);
    background: rgba(16, 185, 129, 0.05);
}

.timeline-node.completed .node-name {
    color: var(--text-main);
}

/* BADGES */
.badge {
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.badge-primary {
    background: rgba(0, 242, 254, 0.15);
    color: var(--color-cyan);
    border: 1px solid rgba(0, 242, 254, 0.2);
}

.timeline-node.active .badge {
    background: rgba(0, 242, 254, 0.2);
    color: var(--color-cyan);
    animation: textFlash 1.5s infinite;
}

.timeline-node.completed .badge {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

/* 4. CONSOLE PANEL (BOTTOM) */
.console-panel {
    grid-column: 1 / span 3;
    grid-row: 2;
}

.console-header {
    justify-content: space-between;
    align-items: center;
}

.title-with-icon {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.console-body {
    background: #05070e;
    color: #cbd5e1;
    overflow-y: auto;
    font-size: 0.8rem;
    padding: 0.75rem;
    line-height: 1.5;
    flex-grow: 1;
}

.console-line {
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    padding: 0.25rem 0;
    white-space: pre-wrap;
    animation: slideInLine 0.15s ease-out;
}

/* Console agent-specific colors */
.system-line { color: var(--text-muted); }
.user-line { color: #e2e8f0; font-weight: 500; }
.planner-line { color: #22d3ee; }
.engineer-line { color: #34d399; }
.reviewer-line { color: #fbbf24; }
.tester-line { color: #f43f5e; }
.documenter-line { color: #a78bfa; }
.error-line { 
    color: var(--color-rose);
    background: rgba(244, 63, 94, 0.05);
    border-left: 3px solid var(--color-rose);
    padding-left: 5px;
}

/* UTILITIES & ANIMATIONS */
.font-mono { font-family: 'Fira Code', monospace; }
.text-xs { font-size: 0.75rem; }
.font-semibold { font-weight: 600; }
.hidden { display: none !important; }
.text-glow {
    text-shadow: 0 0 6px rgba(0, 242, 254, 0.5);
}

@keyframes pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.15); filter: drop-shadow(0 0 5px var(--color-cyan)); }
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 8px var(--node-glow); }
    50% { box-shadow: 0 0 18px var(--node-glow); }
    100% { box-shadow: 0 0 8px var(--node-glow); }
}

@keyframes textFlash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes floating {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLine {
    from { opacity: 0; transform: translateX(-5px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideDown {
    from { height: 0; opacity: 0; }
    to { height: auto; opacity: 1; }
}

/* RESPONSIVE DESIGN */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto 250px;
        height: auto;
    }
    
    .app-container {
        height: auto;
    }
    
    .editor-panel {
        grid-column: 1;
        height: 500px;
    }
    
    .pipeline-panel {
        grid-column: 1;
    }
    
    .console-panel {
        grid-column: 1;
        grid-row: auto;
    }
}
