/* === CSS/PLANNER.CSS === */
/* Phase 4: The Architect Studio - Corkboard, Outliner, Timeline, Diagnostics & Visuals */

/* Main Planner Shell & Navigation */
.planner-studio-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    background: var(--bg-color, #0b0d13);
    color: var(--panel-text, var(--main-color, #e2e8f0));
    box-sizing: border-box;
    overflow: hidden;
}

/* Sub-viewport Tabbed Toolbar */
.planner-subview-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: var(--panel-bg, #11141d);
    border-bottom: 1px solid var(--border-color, rgba(128, 128, 128, 0.25));
    flex-shrink: 0;
    gap: 12px;
    flex-wrap: wrap;
}

.planner-tabs-cluster {
    display: flex;
    gap: 4px;
    align-items: center;
}

.planner-tab-btn {
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.5px;
    padding: 5px 12px;
    background: transparent;
    border: 1px solid var(--border-color, rgba(128, 128, 128, 0.25));
    color: inherit;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    user-select: none;
}

.planner-tab-btn:hover {
    border-color: var(--main-color, #00ff66);
    background: rgba(128, 128, 128, 0.08);
}

.planner-tab-btn.active {
    background: var(--main-color, #00ff66);
    color: var(--bg-color, #0b0d13);
    border-color: var(--main-color, #00ff66);
    box-shadow: 0 0 10px rgba(0, 255, 102, 0.3);
}

.planner-actions-cluster {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Planner Subview Viewports Container */
.planner-viewport-stage {
    flex: 1;
    overflow: auto;
    padding: 16px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.planner-subview-panel {
    display: none;
    width: 100%;
    height: 100%;
}

.planner-subview-panel.active {
    display: flex;
    flex-direction: column;
}

/* ========================================================================= */
/* CORKBOARD & SCENE BOARD STYLING                                           */
/* ========================================================================= */
.corkboard-canvas {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 24px;
    align-items: flex-start;
    min-height: calc(100vh - 170px);
}

.corkboard-swimlane {
    flex: 0 0 310px;
    background: var(--panel-bg, #11141d);
    border: 1px solid var(--border-color, rgba(128, 128, 128, 0.25));
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 180px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.swimlane-header {
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color, rgba(128, 128, 128, 0.2));
    background: rgba(0, 0, 0, 0.1);
}

.swimlane-title-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.swimlane-title {
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 0.5px;
    color: var(--main-color, #00ff66);
}

.swimlane-badge {
    font-size: 9px;
    opacity: 0.7;
    background: rgba(128, 128, 128, 0.15);
    padding: 1px 5px;
    border-radius: 3px;
}

.swimlane-body {
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 120px;
    flex: 1;
}

.corkboard-empty-dropzone {
    border: 2px dashed var(--border-color, rgba(128, 128, 128, 0.3));
    border-radius: 4px;
    padding: 30px 10px;
    text-align: center;
    font-size: 11px;
    opacity: 0.6;
}

/* Individual Corkboard Index Card */
.corkboard-card {
    background: var(--bg-color, #0b0d13);
    border: 1px solid var(--border-color, rgba(128, 128, 128, 0.25));
    border-radius: 5px;
    padding: 12px;
    cursor: grab;
    user-select: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    position: relative;
    overflow: hidden;
}

.corkboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
    border-color: var(--main-color, #00ff66);
}

.corkboard-card.is-dragging {
    opacity: 0.4;
    cursor: grabbing;
}

.corkboard-card.drop-indicator-top {
    border-top: 3px solid var(--main-color, #00ff66);
}

.corkboard-card.drop-indicator-bottom {
    border-bottom: 3px solid var(--main-color, #00ff66);
}

.card-color-strip {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
}

.card-top-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.card-order-badge {
    font-family: monospace;
    font-size: 10px;
    font-weight: bold;
    opacity: 0.75;
}

.card-status-pill {
    font-size: 8.5px;
    font-weight: bold;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
}

.card-status-pill.status-idea { background: rgba(156, 163, 175, 0.2); color: #9ca3af; }
.card-status-pill.status-outline { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.card-status-pill.status-draft { background: rgba(234, 179, 8, 0.2); color: #facc15; }
.card-status-pill.status-revised { background: rgba(168, 85, 247, 0.2); color: #c084fc; }
.card-status-pill.status-final { background: rgba(16, 185, 129, 0.2); color: #34d399; }

.card-title {
    font-size: 13px;
    font-weight: bold;
    line-height: 1.3;
    margin-bottom: 6px;
    color: var(--panel-text, var(--main-color, #e2e8f0));
}

.card-synopsis {
    font-size: 11px;
    opacity: 0.8;
    line-height: 1.4;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-bottom-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    opacity: 0.85;
    border-top: 1px dashed var(--border-color, rgba(128, 128, 128, 0.2));
    padding-top: 6px;
}

.card-meta-pill {
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-cast-cluster {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.cast-chip {
    font-size: 8.5px;
    padding: 1px 5px;
    background: rgba(128, 128, 128, 0.15);
    border-radius: 2px;
}

.cast-chip-more {
    font-size: 8.5px;
    opacity: 0.7;
}

/* ========================================================================= */
/* OUTLINER SPREADSHEET TABLE                                                */
/* ========================================================================= */
.outliner-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    background: var(--panel-bg, #11141d);
    border: 1px solid var(--border-color, rgba(128, 128, 128, 0.25));
    border-radius: 6px;
    overflow: hidden;
}

.outliner-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid var(--border-color, rgba(128, 128, 128, 0.2));
    gap: 10px;
}

.outliner-toolbar .toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.batch-count {
    font-size: 11px;
    opacity: 0.8;
}

.outliner-table-container {
    flex: 1;
    overflow: auto;
}

.outliner-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11.5px;
    text-align: left;
}

.outliner-table th {
    background: var(--panel-bg, #11141d);
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 8px 10px;
    border-bottom: 2px solid var(--border-color, rgba(128, 128, 128, 0.3));
    font-weight: bold;
    font-size: 10px;
    letter-spacing: 0.5px;
    color: var(--main-color, #00ff66);
    user-select: none;
}

.outliner-table th.is-sortable {
    cursor: pointer;
}

.outliner-table th.is-sortable:hover {
    background: rgba(128, 128, 128, 0.1);
}

.outliner-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color, rgba(128, 128, 128, 0.15));
}

.outliner-row:hover {
    background: rgba(128, 128, 128, 0.06);
}

.outliner-row.row-selected {
    background: rgba(59, 130, 246, 0.12);
}

.outliner-card-link {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: transparent;
    transition: text-decoration-color 0.15s ease;
}

.outliner-card-link:hover {
    text-decoration-color: var(--main-color, #00ff66);
}

/* ========================================================================= */
/* MULTI-TRACK TIMELINE                                                      */
/* ========================================================================= */
.timeline-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--panel-bg, #11141d);
    border: 1px solid var(--border-color, rgba(128, 128, 128, 0.25));
    border-radius: 6px;
    overflow: hidden;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color, rgba(128, 128, 128, 0.2));
    background: rgba(0, 0, 0, 0.1);
}

.timeline-title-group .timeline-title {
    font-size: 13px;
    letter-spacing: 0.5px;
    color: var(--main-color, #00ff66);
}

.timeline-title-group .timeline-subtitle {
    font-size: 10px;
    opacity: 0.7;
    margin-left: 8px;
}

.timeline-stage {
    flex: 1;
    overflow: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.timeline-track-lane {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.track-label-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.track-label {
    font-size: 12px;
    font-weight: bold;
    color: var(--main-color, #00ff66);
}

.track-count {
    font-size: 9px;
    opacity: 0.7;
}

.track-rail-container {
    position: relative;
    padding: 14px 0;
}

.track-rail-line {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--border-color, rgba(128, 128, 128, 0.3));
    z-index: 1;
}

.track-events-grid {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 6px 4px;
}

.timeline-event-card {
    flex: 0 0 170px;
    background: var(--bg-color, #0b0d13);
    border: 1px solid var(--border-color, rgba(128, 128, 128, 0.3));
    border-radius: 4px;
    padding: 8px 10px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s ease;
}

.timeline-event-card:hover {
    transform: translateY(-2px);
    border-color: var(--main-color, #00ff66);
}

.event-seq-chip {
    font-size: 9px;
    font-family: monospace;
    font-weight: bold;
    color: var(--main-color, #00ff66);
}

.event-card-title {
    font-size: 11px;
    font-weight: bold;
    margin: 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 9px;
    opacity: 0.8;
}

/* ========================================================================= */
/* NARRATIVE DIAGNOSTICS SUITE                                               */
/* ========================================================================= */
.diagnostics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 16px;
}

.diagnostic-card {
    background: var(--panel-bg, #11141d);
    border: 1px solid var(--border-color, rgba(128, 128, 128, 0.25));
    border-radius: 6px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.diagnostic-title {
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 0.5px;
    color: var(--main-color, #00ff66);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Continuous Flow Ribbon */
.flow-ribbon-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 110px;
    padding: 10px 4px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    overflow-x: auto;
}

.flow-ribbon-bar {
    flex: 0 0 16px;
    background: var(--main-color, #00ff66);
    border-radius: 2px 2px 0 0;
    transition: height 0.2s ease, opacity 0.2s ease;
    cursor: pointer;
    position: relative;
}

.flow-ribbon-bar:hover {
    opacity: 0.75;
}

/* Diagnostic Alert Callouts */
.diag-alert-item {
    background: rgba(239, 68, 68, 0.1);
    border-left: 3px solid #ef4444;
    padding: 8px 12px;
    border-radius: 0 4px 4px 0;
    font-size: 11px;
    line-height: 1.4;
}

.diag-alert-item.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-left-color: #f59e0b;
}

.diag-alert-item.alert-good {
    background: rgba(16, 185, 129, 0.1);
    border-left-color: #10b981;
}

/* POV Balance Bar Chart */
.pov-balance-bar-container {
    display: flex;
    height: 20px;
    border-radius: 4px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
}

.pov-balance-segment {
    height: 100%;
    transition: width 0.3s ease;
}

.pov-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.pov-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
}

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

/* ========================================================================= */
/* UNIFIED CARD INSPECTOR DRAWER                                             */
/* ========================================================================= */
.card-inspector-drawer {
    position: fixed;
    top: 42px;
    right: 0;
    width: 440px;
    max-width: 95vw;
    height: calc(100vh - 42px);
    background: var(--panel-bg, #11141d);
    border-left: 2px solid var(--border-color, rgba(128, 128, 128, 0.3));
    z-index: 10000;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.card-inspector-drawer.open {
    transform: translateX(0);
}

.inspector-header {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color, rgba(128, 128, 128, 0.2));
    background: rgba(0, 0, 0, 0.1);
}

.inspector-title {
    font-size: 13px;
    font-weight: bold;
    color: var(--main-color, #00ff66);
    letter-spacing: 0.5px;
}

.inspector-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.inspector-field-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.inspector-field-label {
    font-size: 10px;
    opacity: 0.8;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.inspector-input {
    background: var(--bg-color, #0b0d13);
    border: 1px solid var(--border-color, rgba(128, 128, 128, 0.25));
    border-radius: 4px;
    padding: 6px 8px;
    color: inherit;
    font-size: 12px;
    outline: none;
}

.inspector-input:focus {
    border-color: var(--main-color, #00ff66);
}

.inspector-backlinks-box {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color, rgba(128, 128, 128, 0.2));
    border-radius: 4px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.backlink-item {
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.backlink-item:hover {
    color: var(--main-color, #00ff66);
}
