/* ============================================
   Operations Hub - Akasa Virtual
   Interactive Ecosystem Visualization
   ============================================ */

/* ============================================
   Section Container
   ============================================ */

.opshub-section {
    padding: 5rem var(--spacing-lg);
    position: relative;
}

.opshub-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, transparent, rgba(255, 99, 0, 0.3));
}

.opshub-header {
    max-width: 1000px;
    margin: 0 auto 3rem;
    text-align: center;
}

.opshub-header h2 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.opshub-header p {
    color: var(--text-muted);
    font-size: 1.25rem;
    max-width: 650px;
    margin: 0 auto;
}


/* ============================================
   View Controls
   ============================================ */

.opshub-controls {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.opshub-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.75rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.opshub-view-btn:hover {
    border-color: var(--color-primary);
    color: var(--text-primary);
    background: var(--color-primary-light);
}

.opshub-view-btn.active {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 20px rgba(255, 99, 0, 0.25), 0 4px 20px rgba(92, 15, 217, 0.15);
}

.opshub-view-btn svg {
    width: 18px;
    height: 18px;
}


/* ============================================
   Ecosystem Map - Node Grid
   ============================================ */

.opshub-canvas {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

/* Cluster Layout */
.opshub-clusters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 1.75rem;
}

.opshub-cluster {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.75rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.opshub-cluster::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    opacity: 0.8;
}

.opshub-cluster:hover {
    border-color: rgba(255, 99, 0, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(255, 99, 0, 0.06), 0 4px 20px rgba(92, 15, 217, 0.04);
}

.cluster-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.cluster-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(255, 99, 0, 0.12), rgba(92, 15, 217, 0.12));
    border-radius: 12px;
    position: absolute;
    top: 1.75rem;
    right: 1.75rem;
}

.cluster-title {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cluster-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 3px 10px;
    border-radius: var(--radius-full);
}


/* ============================================
   System Nodes
   ============================================ */

.opshub-nodes {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.opshub-node {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.opshub-node:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-color);
}

.opshub-node.active {
    background: var(--color-primary-light);
    border-color: rgba(255, 99, 0, 0.2);
}

.node-icon {
    width: 42px;
    height: 42px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.opshub-node:hover .node-icon {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.node-icon svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.opshub-node:hover .node-icon svg {
    color: var(--color-primary);
}

.node-info {
    flex: 1;
    min-width: 0;
}

.node-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.node-tagline {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.node-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.node-status.live {
    background: var(--color-success);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

.node-status.beta {
    background: var(--color-warning);
    box-shadow: 0 0 8px rgba(249, 115, 22, 0.4);
}

.node-status.planned {
    background: var(--text-muted);
}

.node-arrow {
    color: var(--text-muted);
    opacity: 0;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.opshub-node:hover .node-arrow {
    opacity: 1;
    transform: translateX(2px);
}

.node-arrow svg {
    width: 14px;
    height: 14px;
}


/* ============================================
   Detail Panel (Slide-in)
   ============================================ */

.opshub-detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.opshub-detail-overlay.open {
    opacity: 1;
    visibility: visible;
}

.opshub-detail-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(680px, 92vw);
    background: var(--bg-dark);
    border-left: 1px solid var(--border-color);
    z-index: 2001;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
}

.opshub-detail-panel.open {
    transform: translateX(0);
}

.detail-header {
    position: sticky;
    top: 0;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border-color);
    padding: 1.75rem 2rem;
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    z-index: 10;
}

.detail-header-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-secondary-light));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.detail-header-icon svg {
    width: 28px;
    height: 28px;
    color: var(--color-primary);
}

.detail-header-info {
    flex: 1;
}

.detail-header-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.detail-header-info p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.detail-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 8px;
}

.detail-status-badge.live {
    background: rgba(34, 197, 94, 0.1);
    color: var(--color-success);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.detail-status-badge.beta {
    background: rgba(249, 115, 22, 0.1);
    color: var(--color-warning);
    border: 1px solid rgba(249, 115, 22, 0.2);
}

.detail-status-badge.planned {
    background: var(--bg-card);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.detail-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.detail-close:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #EF4444;
}

.detail-close svg {
    width: 18px;
    height: 18px;
}

.detail-body {
    padding: 1.75rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}


/* ============================================
   Detail Sections
   ============================================ */

.detail-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.detail-section-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.25rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.detail-section-header svg {
    width: 16px;
    height: 16px;
    color: var(--color-primary);
}

/* How It Works - Step Flow */
.detail-steps {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.detail-step {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.7rem 0;
    position: relative;
}

.detail-step:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 15px;
    top: 2.4rem;
    bottom: -0.1rem;
    width: 1px;
    background: var(--border-color);
}

.step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--color-primary-light);
    border: 1px solid rgba(255, 99, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-primary);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.step-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    padding-top: 4px;
}

.step-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Connections - Badge Row */
.detail-connections {
    padding: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.connection-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 0.88rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.connection-badge:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--color-primary-light);
}

.connection-badge svg {
    width: 14px;
    height: 14px;
}

/* Rules/Features Grid */
.detail-rules {
    padding: 1.25rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
}

.detail-rule {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem;
    border-radius: 8px;
    background: transparent;
    transition: background 0.2s;
}

.detail-rule:hover {
    background: var(--bg-card-hover);
}

.rule-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

.rule-icon.enforce {
    background: rgba(34, 197, 94, 0.1);
}

.rule-icon.info {
    background: rgba(59, 130, 246, 0.1);
}

.rule-icon.warn {
    background: rgba(249, 115, 22, 0.1);
}

.rule-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}


/* ============================================
   Flow View — Flight Lifecycle (Redesigned)
   ============================================ */

.opshub-flow {
    display: none;
    max-width: 1400px;
    margin: 0 auto;
}

.opshub-flow.active {
    display: block;
}

.flow-title {
    text-align: center;
    margin-bottom: 2.5rem;
}

.flow-title h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.flow-title p {
    font-size: 1rem;
    color: var(--text-muted);
}

/* Flow Grid */
.flow-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    position: relative;
}

/* Connecting line behind cards */
.flow-grid::before {
    content: '';
    position: absolute;
    top: 48px;
    left: 40px;
    right: 40px;
    height: 2px;
    background: linear-gradient(90deg, 
        var(--color-primary) 0%, 
        var(--color-secondary) 50%, 
        var(--color-primary) 100%);
    opacity: 0.15;
    z-index: 0;
}

.flow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 0.5rem;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    z-index: 1;
}

.flow-step:hover {
    transform: translateY(-4px);
}

/* Step number circle */
.flow-step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    transition: all 0.25s ease;
}

.flow-step:hover .flow-step-number {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--color-primary-light);
    box-shadow: 0 0 12px rgba(255, 99, 0, 0.2);
}

/* Icon container */
.flow-step-dot {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    margin-bottom: 0.85rem;
}

.flow-step:hover .flow-step-dot {
    border-color: rgba(255, 99, 0, 0.3);
    background: linear-gradient(135deg, rgba(255, 99, 0, 0.08), rgba(92, 15, 217, 0.08));
    box-shadow: 0 8px 24px rgba(255, 99, 0, 0.1);
}

.flow-step-dot svg {
    width: 26px;
    height: 26px;
    color: var(--text-muted);
    transition: color 0.25s ease;
}

.flow-step:hover .flow-step-dot svg {
    color: var(--color-primary);
}

/* Labels */
.flow-step-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.3;
    margin-bottom: 0.3rem;
}

.flow-step-system {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    text-align: center;
    padding: 3px 10px;
    background: var(--bg-card);
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
}

.flow-step:hover .flow-step-system {
    border-color: rgba(255, 99, 0, 0.2);
    color: var(--color-primary);
}

/* Arrow between steps */
.flow-connector {
    display: none;
}

/* Flow progress bar at bottom */
.flow-progress {
    margin-top: 2.5rem;
    padding: 1.25rem 1.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.flow-progress-label {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    white-space: nowrap;
}

.flow-progress-bar {
    flex: 1;
    height: 5px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.flow-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    border-radius: 3px;
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Step counter shows current hover */
.flow-progress-count {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--color-primary);
    white-space: nowrap;
    min-width: 80px;
    text-align: right;
    transition: color 0.2s ease;
}


/* ============================================
   Legend
   ============================================ */

.opshub-legend {
    display: flex;
    justify-content: center;
    gap: 1.75rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-dot.live { background: var(--color-success); }
.legend-dot.beta { background: var(--color-warning); }
.legend-dot.planned { background: var(--text-muted); }


/* ============================================
   Cluster Accent Colors — Unified Akasa Gradient
   ============================================ */

.opshub-cluster[data-cluster="flight-ops"] {
    --cluster-accent: var(--color-primary);
}

.opshub-cluster[data-cluster="airline-mgmt"] {
    --cluster-accent: var(--color-primary);
}

.opshub-cluster[data-cluster="realism"] {
    --cluster-accent: var(--color-primary);
}

.opshub-cluster[data-cluster="pilot-systems"] {
    --cluster-accent: var(--color-primary);
}

.opshub-cluster[data-cluster="infrastructure"] {
    --cluster-accent: var(--color-primary);
}


/* ============================================
   Light Theme Overrides
   ============================================ */

[data-theme="light"] .opshub-cluster {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .opshub-cluster:hover {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .opshub-detail-overlay {
    background: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .opshub-detail-panel {
    background: var(--bg-dark);
}

[data-theme="light"] .detail-header {
    background: var(--bg-dark);
}

[data-theme="light"] .node-icon {
    background: rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .opshub-view-btn {
    background: rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .opshub-view-btn.active {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
    color: #fff;
}

[data-theme="light"] .flow-step-dot {
    background: var(--bg-dark);
}

[data-theme="light"] .flow-step-number {
    background: var(--bg-dark);
}

[data-theme="light"] .flow-progress {
    background: rgba(255, 255, 255, 0.8);
}


/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    .opshub-clusters {
        grid-template-columns: 1fr;
    }
    
    .opshub-header h2 {
        font-size: 2rem;
    }
    
    .opshub-controls {
        gap: 0.35rem;
    }
    
    .opshub-view-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .opshub-detail-panel {
        width: 100vw;
    }
    
    .detail-rules {
        grid-template-columns: 1fr;
    }
    
    .flow-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .flow-grid::before {
        display: none;
    }
}

@media (max-width: 480px) {
    .opshub-section {
        padding: 3rem var(--spacing-sm);
    }
    
    .opshub-header h2 {
        font-size: 1.75rem;
    }
    
    .opshub-legend {
        gap: 1rem;
    }
    
    .flow-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}