/* ========================================
   FrankieOne ROI Calculator - Sales Tool
   Dark Mode Design
   ======================================== */

/* CSS Variables */
:root {
    /* Primary Colors */
    --primary-blue: #4284fb;
    --primary-blue-hover: #5a9aff;
    --primary-blue-light: rgba(66, 132, 251, 0.15);

    /* Dark Theme Colors */
    --bg-primary: #0a0f1a;
    --bg-secondary: #111827;
    --bg-tertiary: #1a2234;
    --bg-elevated: #1f2937;
    --bg-hover: #252f3f;

    /* Borders */
    --border-color: #2d3a4f;
    --border-light: #374151;

    /* Text Colors */
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    /* Semantic Colors */
    --success: #34d399;
    --success-light: rgba(52, 211, 153, 0.15);
    --warning: #fbbf24;
    --warning-light: rgba(251, 191, 36, 0.15);
    --danger: #f87171;
    --danger-light: rgba(248, 113, 113, 0.15);

    /* Typography */
    --font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* Container */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* ========================================
   Header
   ======================================== */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: var(--space-md) 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.logo-badge {
    background: var(--primary-blue-light);
    color: var(--primary-blue);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.header-actions {
    display: flex;
    gap: var(--space-sm);
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 12px 20px;
    font-family: var(--font-family);
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-primary {
    background: var(--primary-blue);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-blue-hover);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
}

.btn-full {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========================================
   Main Content
   ======================================== */
.main-content {
    padding: var(--space-xl) 0;
    min-height: calc(100vh - 140px);
}

.page-header {
    margin-bottom: var(--space-xl);
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.page-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ========================================
   Calculator Layout
   ======================================== */
.calculator-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: var(--space-xl);
    align-items: start;
}

/* Customer View Mode - Hide inputs */
body.customer-view .input-section {
    display: none;
}

body.customer-view .calculator-layout {
    grid-template-columns: 1fr;
    max-width: 900px;
    margin: 0 auto;
}

body.customer-view .page-header {
    text-align: center;
}

body.customer-view .header-actions {
    display: none;
}

body.customer-view .logo-badge {
    display: none;
}

@media (max-width: 1024px) {
    .calculator-layout {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Cards
   ======================================== */
.card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: var(--space-lg);
}

.card-header p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.card-body {
    padding: var(--space-lg);
}

/* ========================================
   Form Elements
   ======================================== */
.form-group {
    margin-bottom: var(--space-md);
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.form-input,
.form-select {
    width: 100%;
    padding: 12px 14px;
    font-family: var(--font-family);
    font-size: 0.9375rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px var(--primary-blue-light);
}

.form-select {
    cursor: pointer;
}

.form-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-select optgroup {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-weight: 700;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.input-with-prefix,
.input-with-suffix {
    position: relative;
}

.input-prefix,
.input-suffix {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-weight: 500;
}

.input-prefix {
    left: 14px;
}

.input-suffix {
    right: 14px;
}

.input-with-prefix .form-input {
    padding-left: 32px;
}

.input-with-suffix .form-input {
    padding-right: 40px;
}

.tooltip-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: var(--bg-elevated);
    border-radius: 50%;
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: help;
    margin-left: 4px;
}

/* ========================================
   Regions Manager
   ======================================== */
.regions-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.regions-title h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.regions-title p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.regions-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* Region Card */
.region-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: border-color var(--transition-fast);
}

.region-card.active {
    border-color: var(--primary-blue);
}

.region-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.region-header:hover {
    background: var(--bg-tertiary);
}

.region-header-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.region-country-badge {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.region-country-badge.empty {
    color: var(--text-muted);
    font-style: italic;
}

.region-summary {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.region-stat {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: 'Monaco', 'Menlo', monospace;
}

.region-stat-improvement {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--success);
    background: var(--success-light);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

.region-stat-volume {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.region-stat-empty {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

.region-header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.region-remove-btn {
    background: transparent;
    border: none;
    padding: 6px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.region-remove-btn:hover {
    background: var(--danger-light);
    color: var(--danger);
}

.region-expand-icon {
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

/* Region Body */
.region-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.region-body.expanded {
    max-height: 2000px;
    border-top: 1px solid var(--border-color);
}

.region-section {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.region-section:last-child {
    border-bottom: none;
}

.region-section h4 {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Customer View Region Styles */
.customer-view-section {
    padding: var(--space-lg);
}

.region-detail-row {
    display: flex;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-color);
}

.region-detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.detail-value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.875rem;
}

.region-stack-summary {
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-color);
}

.region-stack-summary h5 {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-sm);
}

.stack-summary-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) 0;
}

.stack-summary-item .stack-num {
    width: 20px;
    height: 20px;
    background: var(--primary-blue);
    color: white;
    border-radius: 50%;
    font-size: 0.625rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stack-summary-item .stack-name {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* No Regions State */
.no-regions {
    padding: var(--space-2xl);
    text-align: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 2px dashed var(--border-color);
}

.no-regions p {
    color: var(--text-muted);
}

/* Region Flow Selector */
.region-flow-selector {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.region-flow-selector label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.region-flow-selector .form-select {
    flex: 1;
    padding: 8px 12px;
}

/* Flow Region Badge */
.flow-region-badge {
    background: var(--primary-blue-light);
    color: var(--primary-blue);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    margin-left: auto;
}

/* ROI Region Breakdown */
.region-breakdown {
    margin-bottom: var(--space-lg);
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.region-breakdown h4 {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-md);
}

.region-breakdown-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.region-breakdown-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.region-breakdown-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.region-breakdown-stats {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.rb-stat {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: 'Monaco', 'Menlo', monospace;
}

.rb-stat.improvement {
    color: var(--success);
    font-weight: 700;
}

.rb-stat.value {
    color: var(--primary-blue);
    font-weight: 600;
}

/* Total Regions Badge */
.total-regions-badge {
    background: var(--primary-blue-light);
    color: var(--primary-blue);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    margin-left: auto;
}

/* ROI Totals Header */
.roi-totals-header {
    margin-bottom: var(--space-md);
}

.roi-totals-header h4 {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Card Header with Badge */
.card-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.card-header h2 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

/* ========================================
   Stack Items
   ======================================== */
.stack-items {
    margin-bottom: var(--space-md);
}

.stack-empty {
    padding: var(--space-xl);
    text-align: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    border: 2px dashed var(--border-color);
}

.stack-empty p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.stack-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    background: var(--primary-blue-light);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-sm);
    border: 1px solid rgba(66, 132, 251, 0.3);
}

.stack-item-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.stack-item-order {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--primary-blue);
    color: white;
    border-radius: 50%;
    font-size: 0.875rem;
    font-weight: 700;
}

.stack-item-details {
    display: flex;
    flex-direction: column;
}

.stack-item-name {
    font-weight: 600;
    color: var(--text-primary);
}

.stack-item-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.stack-item-remove {
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.stack-item-remove:hover {
    background: var(--danger-light);
    color: var(--danger);
}

/* ========================================
   Flow Visualization
   ======================================== */
.flow-card .card-body {
    padding: var(--space-xl);
}

.flow-visualization {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.flow-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.flow-label {
    width: 100px;
    flex-shrink: 0;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.flow-label.frankieone {
    color: var(--primary-blue);
}

.flow-nodes {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.flow-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    min-width: 80px;
}

.flow-node svg {
    color: var(--text-muted);
}

.flow-node span {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
}

.flow-node.frankieone-node {
    background: var(--primary-blue-light);
    border-color: var(--primary-blue);
}

.flow-node.frankieone-node svg {
    color: var(--primary-blue);
}

.flow-node.frankieone-node span {
    color: var(--primary-blue);
    font-weight: 600;
}

.flow-node.stack-node {
    background: var(--primary-blue-light);
    border-color: rgba(66, 132, 251, 0.4);
    position: relative;
    min-width: 100px;
}

.stack-badge {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 20px;
    height: 20px;
    background: var(--primary-blue);
    color: white;
    border-radius: 50%;
    font-size: 0.625rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stack-label {
    font-size: 0.75rem;
    color: var(--primary-blue);
    font-weight: 600;
}

.flow-connector {
    color: var(--primary-blue);
    font-weight: 700;
    font-size: 1.25rem;
}

.flow-stack {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.flow-arrow {
    color: var(--text-muted);
    flex-shrink: 0;
}

.flow-arrow.equals {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-muted);
}

.flow-arrow.equals span {
    font-size: 1.25rem;
}

.result-node {
    min-width: 100px;
    padding: var(--space-md) var(--space-lg);
}

.result-node.current-result {
    background: var(--bg-tertiary);
    border-color: var(--border-light);
}

.result-node.frankieone-result {
    background: var(--success-light);
    border-color: var(--success);
}

.result-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.frankieone-result .result-value {
    color: var(--success);
}

.result-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.flow-divider {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) 0;
}

.flow-divider::before,
.flow-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.flow-divider span {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* ========================================
   ROI Results
   ======================================== */
.results-card .card-body {
    padding: var(--space-xl);
}

.roi-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.roi-metric {
    padding: var(--space-lg);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    text-align: center;
}

.roi-metric.highlight {
    background: var(--success-light);
}

.metric-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-sm);
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.metric-value.improvement.positive {
    color: var(--success);
}

.metric-value.money {
    color: var(--success);
}

.metric-value.large {
    font-size: 2rem;
}

.roi-breakdown {
    padding: var(--space-lg);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.roi-breakdown h4 {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-color);
}

.breakdown-item:last-child {
    border-bottom: none;
}

.breakdown-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.breakdown-value {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

/* ========================================
   Benchmark Reference
   ======================================== */
.benchmark-reference {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.benchmark-reference summary {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.benchmark-reference summary::-webkit-details-marker {
    display: none;
}

.benchmark-reference summary::after {
    content: '+';
    margin-left: auto;
    font-size: 1.25rem;
    color: var(--text-muted);
}

.benchmark-reference[open] summary::after {
    content: '-';
}

.benchmark-content {
    padding: 0 var(--space-lg) var(--space-lg);
}

.benchmark-note {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.benchmark-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.benchmark-item {
    display: flex;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.benchmark-name {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.benchmark-rate {
    font-weight: 700;
    color: var(--primary-blue);
}

/* ========================================
   HubSpot Section
   ======================================== */
.hubspot-section {
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-color);
}

.hubspot-section h3 {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.hubspot-section h3 svg {
    color: #ff7a59;
}

.deal-search-container {
    position: relative;
    margin-bottom: var(--space-md);
}

.deal-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
    display: none;
}

.deal-results.active {
    display: block;
}

.deal-result-item {
    padding: var(--space-md);
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}

.deal-result-item:last-child {
    border-bottom: none;
}

.deal-result-item:hover {
    background: var(--bg-hover);
}

.deal-result-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.deal-result-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.selected-deal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    background: var(--primary-blue-light);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-md);
    border: 1px solid rgba(66, 132, 251, 0.3);
}

.selected-deal-info {
    display: flex;
    flex-direction: column;
}

.selected-deal-name {
    font-weight: 600;
    color: var(--text-primary);
}

.selected-deal-company {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.selected-deal-clear {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}

.selected-deal-clear:hover {
    color: var(--danger);
}

.hubspot-status {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-top: var(--space-md);
}

.hubspot-status.success {
    background: var(--success-light);
    color: var(--success);
}

.hubspot-status.error {
    background: var(--danger-light);
    color: var(--danger);
}

/* ========================================
   Modal
   ======================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    padding: var(--space-lg);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(20px) scale(0.95);
    transition: transform var(--transition-base);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    background: var(--bg-elevated);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-header {
    padding: var(--space-xl) var(--space-xl) var(--space-md);
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.modal-header p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.modal-body {
    padding: 0 var(--space-xl) var(--space-xl);
}

/* Product Info in Modal */
.product-info {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
}

.product-info-row {
    display: flex;
    justify-content: space-between;
    padding: var(--space-xs) 0;
}

.info-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.info-value {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

/* Export Options */
.export-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-sm);
    margin-top: var(--space-lg);
}

.export-section-title:first-child {
    margin-top: 0;
}

.export-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.export-option {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-family);
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.export-option:hover {
    background: var(--primary-blue-light);
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.export-option svg {
    flex-shrink: 0;
}

.export-option .option-details {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.export-option .option-title {
    font-weight: 600;
    color: inherit;
}

.export-option .option-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.export-preview {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: var(--space-md);
    margin-top: var(--space-lg);
}

.export-preview h4 {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.export-preview pre {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: pre-wrap;
    max-height: 200px;
    overflow-y: auto;
}

/* ========================================
   Toast
   ======================================== */
.toast {
    position: fixed;
    bottom: var(--space-xl);
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-elevated);
    color: var(--text-primary);
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0;
    transition: all var(--transition-base);
    z-index: 3000;
    border: 1px solid var(--border-color);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: var(--success-light);
    border-color: var(--success);
    color: var(--success);
}

.toast.error {
    background: var(--danger-light);
    border-color: var(--danger);
    color: var(--danger);
}

/* ========================================
   Footer
   ======================================== */
.footer.compact {
    padding: var(--space-md) 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.footer.compact p {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

/* Customer view footer */
body.customer-view .footer.compact p::after {
    content: ' | Prepared by FrankieOne';
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    .calculator-layout {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .roi-metrics {
        grid-template-columns: 1fr;
    }

    .flow-nodes {
        flex-direction: column;
        align-items: flex-start;
    }

    .flow-arrow {
        transform: rotate(90deg);
    }

    .flow-label {
        width: auto;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }

    .header,
    .input-section,
    .footer,
    .benchmark-reference {
        display: none;
    }

    .calculator-layout {
        grid-template-columns: 1fr;
    }

    .card {
        background: white;
        border: 1px solid #ddd;
        box-shadow: none;
    }

    .results-section {
        page-break-inside: avoid;
    }

    .modal-overlay {
        display: none;
    }

    .roi-metric,
    .roi-breakdown,
    .flow-node {
        background: #f5f5f5;
    }

    .text-primary,
    .result-value,
    .metric-value {
        color: black !important;
    }
}
