/*
 * 4What Digital - Hub Product Page Styles
 * Interactive demo components for the 4What Hub showcase
 */

/* ============================================
   HUB HERO
   ============================================ */
.hub-hero {
    min-height: 60vh;
    display: flex;
    align-items: center;
    padding-top: 6rem;
}

.hub-hero .hero-status {
    margin-bottom: 1rem;
}

.hub-hero-subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.8;
    max-width: 600px;
    margin-bottom: 2rem;
}

/* ============================================
   MODULE OVERVIEW GRID
   ============================================ */
.hub-module-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.hub-module-card {
    padding: 1.5rem;
    cursor: pointer;
    transition: all var(--transition-medium);
    position: relative;
    overflow: visible;
}

.hub-module-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--brand-red);
    transform: scaleX(0);
    transition: transform var(--transition-medium);
}

.hub-module-card:hover::after,
.hub-module-card.active::after {
    transform: scaleX(1);
}

.hub-module-card.active {
    background: rgba(190, 30, 45, 0.05);
    border-color: rgba(190, 30, 45, 0.2);
}

.hub-module-icon {
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    transition: border-color var(--transition-medium);
}

.hub-module-card:hover .hub-module-icon,
.hub-module-card.active .hub-module-icon {
    border-color: var(--brand-red);
}

.hub-module-card h4 {
    font-family: 'Manrope', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.hub-module-card p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.hub-module-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
    display: block;
}

@media (max-width: 1024px) {
    .hub-module-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .hub-module-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   BRAND VOICE DEMO
   ============================================ */
.voice-demo {
    max-width: 700px;
    margin: 2rem auto 0;
}

.voice-demo-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.voice-demo-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--glass-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all var(--transition-medium);
}

.voice-demo-tab:hover {
    background: var(--glass-bg-hover);
    color: var(--text-secondary);
}

.voice-demo-tab.active {
    background: rgba(190, 30, 45, 0.05);
    border-color: rgba(190, 30, 45, 0.2);
    color: var(--text-primary);
}

.voice-demo-tab-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.voice-demo-output {
    padding: 2rem;
    min-height: 180px;
    position: relative;
}

.voice-demo-text {
    font-family: 'Manrope', sans-serif;
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
}

.voice-demo-meta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.voice-demo-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: 0.25rem 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
}

.voice-demo-content {
    animation: voice-fade-in 0.4s ease-out;
}

@keyframes voice-fade-in {
    from { opacity: 0; transform: translateY(0.5rem); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
    .voice-demo-tabs {
        flex-direction: column;
    }

    .voice-demo-output {
        padding: 1.25rem;
    }
}

/* ============================================
   ONBOARDING TIMELINE
   ============================================ */
.hub-timeline {
    position: relative;
    max-width: 700px;
    margin: 3rem auto 0;
    padding-left: 2rem;
}

.hub-timeline-track {
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(
        to bottom,
        rgba(190, 30, 45, 0.4),
        rgba(190, 30, 45, 0.1)
    );
}

.hub-timeline-step {
    position: relative;
    padding-bottom: 2rem;
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    opacity: 0;
    transform: translateY(1rem);
    transition: opacity 0.6s cubic-bezier(0.19, 1, 0.22, 1),
                transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

.hub-timeline-step.animated {
    opacity: 1;
    transform: translateY(0);
}

.hub-timeline-step:last-child {
    padding-bottom: 0;
}

.hub-timeline-node {
    position: absolute;
    left: -1.65rem;
    top: 1.25rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--brand-red);
    border: 2px solid var(--dark-bg);
    flex-shrink: 0;
    z-index: 1;
}

.hub-timeline-node--final {
    width: 14px;
    height: 14px;
    left: -1.7rem;
    box-shadow: 0 0 12px rgba(190, 30, 45, 0.5);
}

.hub-timeline-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid rgba(190, 30, 45, 0.3);
    animation: timeline-pulse 2s ease-out infinite;
}

@keyframes timeline-pulse {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

.hub-timeline-content {
    padding: 1.25rem 1.5rem;
    flex: 1;
}

.hub-timeline-content h4 {
    font-family: 'Manrope', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.hub-timeline-content p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.hub-timeline-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--brand-red);
    margin-bottom: 0.5rem;
    display: block;
}

@media (max-width: 640px) {
    .hub-timeline {
        padding-left: 1.5rem;
    }

    .hub-timeline-node {
        left: -1.4rem;
    }

    .hub-timeline-node--final {
        left: -1.45rem;
    }
}

/* ============================================
   HUB SYSTEM STATS
   ============================================ */
.hub-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.hub-stat-card {
    padding: 1.5rem;
    text-align: center;
}

.hub-stat-value {
    font-family: 'Syncopate', sans-serif;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.hub-stat-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
}

.hub-stat-value--text {
    font-family: 'Syncopate', sans-serif;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

@media (max-width: 768px) {
    .hub-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .hub-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   PER-MODULE ACCENT COLORS
   ============================================ */
.hub-module-card[data-tab="analytics"]::after { background: var(--accent-green); }
.hub-module-card[data-tab="content"]::after { background: var(--accent-orange); }
.hub-module-card[data-tab="dashboard"]::after { background: var(--accent-blue); }

.hub-module-card[data-tab="analytics"].active {
    background: rgba(34, 197, 94, 0.05);
    border-color: rgba(34, 197, 94, 0.2);
}
.hub-module-card[data-tab="analytics"]:hover .hub-module-icon,
.hub-module-card[data-tab="analytics"].active .hub-module-icon {
    border-color: var(--accent-green);
}

.hub-module-card[data-tab="content"].active {
    background: rgba(249, 115, 22, 0.05);
    border-color: rgba(249, 115, 22, 0.2);
}
.hub-module-card[data-tab="content"]:hover .hub-module-icon,
.hub-module-card[data-tab="content"].active .hub-module-icon {
    border-color: var(--accent-orange);
}

.hub-module-card[data-tab="dashboard"].active {
    background: rgba(59, 130, 246, 0.05);
    border-color: rgba(59, 130, 246, 0.2);
}
.hub-module-card[data-tab="dashboard"]:hover .hub-module-icon,
.hub-module-card[data-tab="dashboard"].active .hub-module-icon {
    border-color: var(--accent-blue);
}

/* Active card connector */
.hub-module-card.active::before {
    content: '';
    position: absolute;
    bottom: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 1.5rem;
    background: rgba(255, 255, 255, 0.12);
    pointer-events: none;
}

/* ============================================
   MODULE DETAIL PANEL
   ============================================ */
.hub-module-detail {
    margin-top: 1.5rem;
    min-height: 320px;
}

.hub-detail-panel {
    display: none;
    opacity: 0;
}

.hub-detail-panel.active {
    display: block;
    animation: detail-enter 0.5s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

.hub-detail-panel.entering-initial {
    display: block;
    opacity: 1;
    animation: none;
}

.hub-detail-panel.exiting {
    display: block;
    animation: detail-exit 0.25s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

@keyframes detail-enter {
    from { opacity: 0; transform: translateY(1rem); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes detail-exit {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-0.5rem); }
}

.hub-detail-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
}

/* Detail info column */
.hub-detail-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hub-detail-title {
    font-family: 'Syncopate', sans-serif;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.hub-detail-desc {
    font-family: 'Manrope', sans-serif;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.25rem;
}

.hub-detail-capabilities {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hub-detail-capabilities li {
    font-family: 'Manrope', sans-serif;
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding-left: 1.25rem;
    position: relative;
    line-height: 1.5;
}

.hub-detail-capabilities li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5em;
    width: 6px;
    height: 1px;
    background: var(--brand-red);
}

/* Per-module capability bullet color */
.hub-detail-panel[data-panel="analytics"] .hub-detail-capabilities li::before {
    background: var(--accent-green);
}
.hub-detail-panel[data-panel="content"] .hub-detail-capabilities li::before {
    background: var(--accent-orange);
}
.hub-detail-panel[data-panel="dashboard"] .hub-detail-capabilities li::before {
    background: var(--accent-blue);
}

/* Connection indicators */
.hub-detail-connections {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.hub-detail-conn-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-right: 0.25rem;
}

.hub-detail-conn-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.hub-detail-conn-name {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: var(--text-secondary);
    margin-right: 0.5rem;
}

/* ============================================
   MOCK UI PREVIEWS (shared)
   ============================================ */
.hub-detail-preview {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 1.5rem;
    font-family: 'JetBrains Mono', monospace;
    min-height: 260px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mock-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.mock-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.mock-status-dot--live {
    animation: mock-pulse 2s ease-in-out infinite;
}

@keyframes mock-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.mock-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
}

.mock-badge {
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.15rem 0.4rem;
    border-radius: 2px;
    margin-left: auto;
}

.mock-badge--green {
    background: rgba(34, 197, 94, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.mock-badge--orange {
    background: rgba(249, 115, 22, 0.15);
    color: var(--accent-orange);
    border: 1px solid rgba(249, 115, 22, 0.2);
}

.mock-badge--blue {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* ============================================
   BRAND MOCK (config card)
   ============================================ */
.hub-detail-preview--brand {
    border-left: 2px solid var(--brand-red);
}

.mock-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0;
}

.mock-key {
    font-size: 0.65rem;
    color: var(--brand-red);
    min-width: 85px;
    flex-shrink: 0;
}

.mock-value {
    font-size: 0.65rem;
    color: var(--text-secondary);
}

.mock-bar-track {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
}

.mock-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 1s cubic-bezier(0.19, 1, 0.22, 1);
}

.mock-bar-fill--brand {
    background: var(--brand-red);
}

/* ============================================
   ANALYTICS MOCK (channel bars)
   ============================================ */
.hub-detail-preview--analytics {
    border-left: 2px solid var(--accent-green);
}

.mock-channel {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mock-channel-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    min-width: 75px;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mock-channel-bar {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 2px;
    overflow: hidden;
}

.mock-channel-fill {
    height: 100%;
    background: var(--accent-green);
    border-radius: 2px;
    opacity: 0.6;
    animation: bar-grow 1s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

@keyframes bar-grow {
    from { width: 0; }
}

.mock-channel-val {
    font-size: 0.6rem;
    color: var(--text-secondary);
    min-width: 30px;
    text-align: right;
}

/* ============================================
   CONTENT MOCK (generation card)
   ============================================ */
.hub-detail-preview--content {
    border-left: 2px solid var(--accent-orange);
}

.mock-prompt {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.mock-prompt-caret {
    color: var(--accent-orange);
    font-size: 0.7rem;
}

.mock-prompt-text {
    font-size: 0.65rem;
    color: var(--text-secondary);
}

.mock-generating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
}

.mock-cursor {
    width: 2px;
    height: 14px;
    background: var(--accent-orange);
    animation: cursor-blink 1s step-end infinite;
}

@keyframes cursor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.mock-gen-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.mock-output {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-left: 1px solid rgba(249, 115, 22, 0.2);
}

.mock-output-text {
    font-family: 'Manrope', sans-serif;
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.7;
    font-style: italic;
}

.mock-output-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mock-output-meta {
    font-size: 0.6rem;
    color: var(--text-muted);
}

/* ============================================
   DASHBOARD MOCK (command center)
   ============================================ */
.hub-detail-preview--dashboard {
    border-left: 2px solid var(--accent-blue);
    padding: 0;
    overflow: hidden;
}

.mock-dashboard {
    display: flex;
    height: 100%;
    min-height: 260px;
}

.mock-sidebar {
    width: 40px;
    background: rgba(0, 0, 0, 0.3);
    border-right: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 0;
    gap: 0.75rem;
}

.mock-sidebar-item {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.mock-sidebar-item--active {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
}

.mock-main {
    flex: 1;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mock-main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.mock-widgets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.mock-widget {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mock-widget-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.mock-widget-value {
    font-family: 'Manrope', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ============================================
   DETAIL PANEL RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .hub-detail-inner {
        grid-template-columns: 1fr;
    }

    .hub-detail-preview {
        min-height: 200px;
    }

    .hub-module-detail {
        min-height: auto;
    }
}

@media (max-width: 640px) {
    .hub-detail-inner {
        padding: 1.25rem;
        gap: 1.25rem;
    }

    .hub-module-card.active::before {
        display: none;
    }
}
