/* ============================================
   BookedFlow — Orchestration Platform Styles
   ============================================ */

/* === Reset & Base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --bg-dark: #0a0a0a;
    --bg-section: #0f0f0f;
    --bg-card: #161616;
    --bg-card-hover: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --accent-primary: #4a9eff;
    --accent-secondary: #7b5cff;
    --border-color: #282828;
    --status-completed: #22c55e;
    --status-active: #3b82f6;
    --status-pending: #6b7280;
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;
    
    /* Layout */
    --max-width: 1200px;
    --border-radius: 8px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === Container === */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* === Hero Section === */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-section) 100%);
}

.node-network {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: var(--spacing-lg) 0;
}

.hero-headline {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 500;
    letter-spacing: -0.02em;
    margin-bottom: var(--spacing-md);
    line-height: 1.1;
    animation: fadeInUp 1s ease-out;
}

.hero-subheadline {
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    color: var(--text-secondary);
    font-weight: 400;
    max-width: 700px;
    margin: 0 auto;
    animation: fadeInUp 1s ease-out 0.2s backwards;
}

/* === Section Styles === */
.section {
    padding: var(--spacing-xl) 0;
    background-color: var(--bg-section);
}

.section:nth-child(even) {
    background-color: var(--bg-dark);
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 500;
    margin-bottom: var(--spacing-lg);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.large-text {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    max-width: 900px;
}

.large-text.emphasis {
    color: var(--text-primary);
    font-weight: 500;
    margin-top: var(--spacing-lg);
}

/* === What Section === */
.what-section {
    padding: var(--spacing-xl) 0;
}

/* === Flow Diagram === */
.flow-section {
    padding: var(--spacing-xl) 0;
}

.flow-diagram {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xl);
    flex-wrap: wrap;
}

.flow-phase {
    flex: 0 0 220px;
    width: 220px;
    padding: var(--spacing-md);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.flow-phase:hover {
    background-color: var(--bg-card-hover);
    border-color: var(--accent-primary);
    transform: translateY(-4px);
}

.phase-number {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-xs);
}

.phase-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
}

.phase-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.flow-connector {
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, var(--border-color) 0%, var(--accent-primary) 50%, var(--border-color) 100%);
    position: relative;
    flex-shrink: 0;
}

.flow-connector::after {
    content: '→';
    position: absolute;
    right: -12px;
    top: -10px;
    color: var(--accent-primary);
    font-size: 1.2rem;
}

/* === Dashboard Preview === */
.dashboard-preview,
.call-log-preview {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
}

.dashboard-label {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.timestamp {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* === Execution Timeline === */
.execution-timeline {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.timeline-item {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: var(--spacing-sm);
    align-items: center;
    padding: var(--spacing-sm);
    background-color: var(--bg-section);
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.timeline-item:hover {
    background-color: var(--bg-card-hover);
}

.timeline-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-completed {
    background-color: var(--status-completed);
    box-shadow: 0 0 8px var(--status-completed);
}

.status-active {
    background-color: var(--status-active);
    box-shadow: 0 0 8px var(--status-active);
    animation: pulse 2s ease-in-out infinite;
}

.status-pending {
    background-color: var(--status-pending);
}

.timeline-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.timeline-id {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-primary);
    font-weight: 500;
}

.timeline-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.timeline-progress {
    flex: 1;
    height: 4px;
    background-color: var(--bg-dark);
    border-radius: 2px;
    overflow: hidden;
    min-width: 100px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    transition: width 0.3s ease;
}

.progress-bar.active {
    animation: progressShimmer 2s ease-in-out infinite;
}

.timeline-time {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* === Call Log Preview === */
.call-log-entries {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.log-entry {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    background-color: var(--bg-section);
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.log-entry:hover {
    background-color: var(--bg-card-hover);
}

.log-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

.log-details {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    min-width: 0;
}

.log-id {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-primary);
    font-weight: 500;
}

.log-meta {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.log-field {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.log-value {
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

.log-context {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.log-duration {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    align-self: flex-start;
    margin-top: 4px;
}

/* === Voice Section === */
.voice-section {
    padding: var(--spacing-xl) 0;
}

/* === Philosophy Section === */
.philosophy-section {
    padding: var(--spacing-xl) 0;
}

.philosophy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.philosophy-item {
    padding: var(--spacing-md);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

.philosophy-item:hover {
    background-color: var(--bg-card-hover);
    border-color: var(--accent-primary);
    transform: translateY(-4px);
}

.philosophy-heading {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.philosophy-text {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* === Animations === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

/* === Responsive Design === */
@media (max-width: 1024px) {
    .flow-diagram {
        flex-direction: column;
        align-items: stretch;
    }
    
    .flow-connector {
        width: 2px;
        height: 40px;
        margin: 0 auto;
        background: linear-gradient(180deg, var(--border-color) 0%, var(--accent-primary) 50%, var(--border-color) 100%);
    }
    
    .flow-connector::after {
        content: '↓';
        right: auto;
        left: 50%;
        top: auto;
        bottom: -12px;
        transform: translateX(-50%);
    }
    
    .philosophy-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    :root {
        --spacing-lg: 3rem;
        --spacing-xl: 4rem;
    }
    
    .container {
        padding: 0 1.5rem;
    }
    
    .hero {
        min-height: 80vh;
    }
    
    .timeline-item {
        grid-template-columns: auto 1fr;
        gap: var(--spacing-xs);
    }
    
    .timeline-progress {
        grid-column: 1 / -1;
        margin-top: var(--spacing-xs);
    }
    
    .timeline-time {
        grid-column: 1 / -1;
        margin-left: 16px;
    }
    
    .log-entry {
        grid-template-columns: auto 1fr;
    }
    
    .log-duration {
        grid-column: 2 / -1;
        margin-left: 0;
        margin-top: var(--spacing-xs);
    }
    
    .log-meta {
        flex-direction: column;
        gap: var(--spacing-xs);
    }
}

@media (max-width: 480px) {
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-xs);
    }
    
    .flow-phase {
        min-width: auto;
    }
}
