/**
 * Marketing Module - Components
 * Reusable UI components
 */

/* ========== MODULE CARDS ========== */
.module {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.module-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(to right, var(--bg), transparent);
}

.module-number {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.module-number.green {
    background: var(--success);
}

.module-number.purple {
    background: var(--secondary);
}

.module-number.orange {
    background: var(--warning);
}

.module-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.module-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.module-body {
    padding: 1.5rem;
}

/* ========== VARIABLE GRID ========== */
.var-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.var-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    text-align: center;
    transition: all 0.2s;
}

.var-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.var-symbol {
    font-family: 'Space Mono', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.var-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text);
    margin-top: 4px;
}

.var-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ========== FORMULA CARDS ========== */
.formula-card {
    background: linear-gradient(135deg, var(--primary-light) 0%, #f0f9ff 100%);
    border: 2px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    text-align: center;
    margin-bottom: 1rem;
}

.formula-card.success {
    background: linear-gradient(135deg, var(--success-light) 0%, #ecfdf5 100%);
    border-color: var(--success);
}

.formula-card.warning {
    background: linear-gradient(135deg, var(--warning-light) 0%, #fffbeb 100%);
    border-color: var(--warning);
}

.formula-card.purple {
    background: linear-gradient(135deg, var(--secondary-light) 0%, #faf5ff 100%);
    border-color: var(--secondary);
}

.formula-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.formula {
    font-family: 'Space Mono', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

.formula-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* ========== EXPLAIN BOX ========== */
.explain-box {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    margin-top: 1rem;
    border-left: 4px solid var(--primary);
}

.explain-box h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.explain-box p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.explain-box code {
    font-family: 'Space Mono', monospace;
    background: var(--primary-light);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.explain-box.success {
    border-left-color: var(--success);
}

.explain-box.success code {
    background: var(--success-light);
    color: var(--success);
}

.explain-box.warning {
    border-left-color: var(--warning);
}

.explain-box.warning code {
    background: var(--warning-light);
    color: var(--warning);
}

/* ========== ALERTS ========== */
.alert {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin: 1rem 0;
    font-size: 0.85rem;
}

.alert.info {
    background: var(--primary-light);
    color: var(--primary);
}

.alert.success {
    background: rgba(5, 150, 105, 0.08);
    color: var(--text);
    border: 1px solid rgba(5, 150, 105, 0.2);
}

.alert.success .alert-icon {
    color: var(--success);
}

.alert.success strong {
    color: var(--success);
}

.alert.warning {
    background: var(--warning-light);
    color: var(--warning);
}

.alert.danger {
    background: var(--danger-light);
    color: var(--danger);
}

.alert-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.alert-content strong {
    display: block;
    margin-bottom: 2px;
}

/* ========== ROAS STATUS ========== */
.roas-status {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.status-card {
    flex: 1;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 0.8rem;
}

.status-card.loss {
    background: var(--danger-light);
    color: var(--danger);
}

.status-card.bep {
    background: var(--warning-light);
    color: var(--warning);
}

.status-card.profit {
    background: var(--success-light);
    color: var(--success);
}

.status-card strong {
    display: block;
    font-size: 1rem;
}

/* ========== QUICK REFERENCE ========== */
.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.quick-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
}

.quick-item code {
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    color: var(--primary);
    display: block;
    margin-bottom: 4px;
}

.quick-item small {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ========== FLOW ========== */
.flow-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
}

.flow-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}

.flow-step span {
    background: rgba(255, 255, 255, 0.2);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.flow-arrow {
    color: var(--text-muted);
    font-size: 1.25rem;
}

/* ========== CALCULATOR ========== */
.calc-section {
    margin-top: 1rem;
}

.calc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.calc-input {
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    transition: all 0.2s;
}

.calc-input:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.calc-input label {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.calc-input input {
    width: 100%;
    border: none;
    background: transparent;
    font-family: 'Space Mono', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    outline: none;
}

.calc-input input::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

.calc-btn {
    display: block;
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 1.5rem;
}

.calc-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

/* ========== RESULTS ========== */
.results-section {
    display: none;
}

.results-section.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.result-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    text-align: center;
    transition: all 0.2s;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.result-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-value {
    font-family: 'Space Mono', monospace;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    margin-top: 4px;
}

/* ========== STATUS INDICATOR ========== */
.status-indicator {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    text-align: center;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-indicator.profit {
    background: linear-gradient(135deg, var(--success-light), #ecfdf5);
    border: 1px solid var(--success);
}

.status-indicator.loss {
    background: linear-gradient(135deg, var(--danger-light), #fef2f2);
    border: 1px solid var(--danger);
}

.status-indicator.bep {
    background: linear-gradient(135deg, var(--warning-light), #fffbeb);
    border: 1px solid var(--warning);
}

.status-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.status-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.status-indicator.profit .status-title {
    color: var(--success);
}

.status-indicator.loss .status-title {
    color: var(--danger);
}

.status-indicator.bep .status-title {
    color: var(--warning);
}

.status-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ========== ANALYSIS BOX ========== */
.analysis-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.analysis-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.analysis-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px dashed var(--border);
}

.analysis-row:last-child {
    border-bottom: none;
}

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

.analysis-value {
    font-family: 'Space Mono', monospace;
    font-weight: 600;
    color: var(--text);
}

/* ========== CONCLUSION BOX ========== */
.conclusion-box {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 1rem;
}

.conclusion-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.conclusion-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--surface);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    border-left: 3px solid var(--primary);
}

.conclusion-item.success {
    border-left-color: var(--success);
}

.conclusion-item.warning {
    border-left-color: var(--warning);
}

.conclusion-item.danger {
    border-left-color: var(--danger);
}

.conclusion-icon {
    font-size: 1.25rem;
}

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

.conclusion-text strong {
    color: var(--text);
}

/* ========== PROGRESS BAR ========== */
.progress-container {
    margin: 1rem 0;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
}

.progress-bar {
    height: 10px;
    background: var(--border);
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.5s ease;
}

.progress-fill.profit {
    background: var(--success);
}

.progress-fill.warning {
    background: var(--warning);
}

.progress-fill.danger {
    background: var(--danger);
}

/* ========== FAQ ACCORDION ========== */
.faq-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.faq-item:hover {
    border-color: var(--primary);
}

.faq-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
    gap: 1rem;
}

.faq-header:hover {
    background: rgba(37, 99, 235, 0.05);
}

.faq-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.faq-symbol {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary);
    background: var(--primary-light);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    min-width: 45px;
    text-align: center;
}

.faq-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

.faq-icon {
    font-size: 1.25rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.active .faq-content {
    max-height: 500px;
}

.faq-body {
    padding: 0 1.25rem 1.25rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.faq-body p {
    margin-bottom: 0.75rem;
}

.faq-body p:last-child {
    margin-bottom: 0;
}

.faq-body code {
    font-family: 'Space Mono', monospace;
    background: var(--primary-light);
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.faq-body strong {
    color: var(--text);
}

.faq-body .example {
    background: var(--surface);
    border-left: 3px solid var(--primary);
    padding: 0.75rem 1rem;
    border-radius: 0 8px 8px 0;
    margin: 0.75rem 0;
}

/* ========== ADVANCED CALCULATOR ========== */

/* Comparison Grid Layout */
.calc-comparison-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Calculator Panels */
.calc-panel {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.2s;
}

.calc-panel:hover {
    box-shadow: var(--shadow-lg);
}

.calc-panel.target-panel {
    border-color: var(--primary);
}

.calc-panel.current-panel {
    border-color: var(--success);
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    font-weight: 700;
    font-size: 0.95rem;
}

.target-panel .panel-header {
    background: linear-gradient(135deg, var(--primary-light), #f0f9ff);
    color: var(--primary);
}

.current-panel .panel-header {
    background: linear-gradient(135deg, var(--success-light), #ecfdf5);
    color: var(--success);
}

.panel-icon {
    font-size: 1.25rem;
}

.panel-title {
    font-weight: 700;
}

.panel-body {
    padding: 1.25rem;
}

.input-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.input-group:last-child {
    margin-bottom: 0;
}

.calc-input.full-width {
    grid-column: span 2;
}

/* Section Titles */
.section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Comparison Section */
.comparison-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Metrics Comparison Table */
.metrics-comparison {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.metric-row {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1.5fr 1fr;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    align-items: center;
}

.metric-row:last-child {
    border-bottom: none;
}

.metric-row.header-row {
    background: var(--bg);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.metric-label {
    font-size: 0.85rem;
    color: var(--text);
    font-weight: 500;
}

.metric-target,
.metric-current {
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
}

.metric-target {
    color: var(--primary);
}

.metric-current {
    color: var(--success);
}

.metric-current.good {
    color: var(--success);
}

.metric-current.warning {
    color: var(--warning);
}

.metric-current.bad {
    color: var(--danger);
}

.metric-status {
    text-align: center;
    font-size: 0.9rem;
}

.metric-status.good {
    color: var(--success);
}

.metric-status.warning {
    color: var(--warning);
}

.metric-status.bad {
    color: var(--danger);
}

/* Progress Section */
.progress-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.progress-metrics {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.progress-item {
    flex: 1;
}

.progress-item .progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.progress-item .progress-bar {
    height: 12px;
    background: var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.progress-item .progress-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s ease;
    background: var(--primary);
}

.progress-item .progress-fill.good {
    background: var(--success);
}

.progress-item .progress-fill.warning {
    background: var(--warning);
}

.progress-item .progress-fill.bad {
    background: var(--danger);
}

/* Projection Section */
.projection-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.projection-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.projection-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    text-align: center;
    transition: all 0.2s;
}

.projection-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.projection-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.projection-value {
    font-family: 'Space Mono', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.projection-value.positive {
    color: var(--success);
}

.projection-value.negative {
    color: var(--danger);
}

/* Analysis Section */
.analysis-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

/* Status Summary */
.status-summary {
    margin-bottom: 1.5rem;
}

.status-indicator {
    background: var(--bg);
    border: 2px solid var(--border);
}

.status-indicator.analyzing {
    background: linear-gradient(135deg, var(--primary-light), #f0f9ff);
    border-color: var(--primary);
}

.status-indicator.analyzing .status-title {
    color: var(--primary);
}

/* ========== AI TOOLTIPS ========== */
.ai-tooltip-trigger {
    position: relative;
    cursor: help;
}

.ai-tooltip-trigger::after {
    content: '✨';
    font-size: 0.7rem;
    margin-left: 4px;
    opacity: 0.7;
}

.ai-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.ai-tooltip::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: rgba(255, 255, 255, 0.95);
}

.ai-tooltip-trigger:hover .ai-tooltip {
    opacity: 1;
    visibility: visible;
}

.ai-tooltip-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.ai-tooltip-icon {
    font-size: 1.2rem;
}

.ai-tooltip-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.ai-tooltip-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.ai-loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* BEP Projection Section */
.bep-section {
    background: linear-gradient(135deg, var(--warning-light), #fffbeb);
    border: 1px solid var(--warning);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.bep-section .section-title {
    color: var(--warning);
}

.bep-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.bep-card {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-sm);
    padding: 1rem;
    text-align: center;
}

.bep-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--warning);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.bep-sublabel {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.bep-value {
    font-family: 'Space Mono', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.bep-value.positive {
    color: var(--success);
    font-size: 0.9rem;
}

.bep-value.negative {
    color: var(--danger);
    font-size: 0.9rem;
}

.bep-value.neutral {
    color: var(--warning);
    font-size: 0.9rem;
}

/* AI Recommendation Box */
.ai-recommendation {
    background: linear-gradient(135deg, #ede9fe, #f5f3ff);
    border: 1px solid var(--secondary);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.ai-recommendation .section-title {
    color: var(--secondary);
}

.ai-content {
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--text);
}

.ai-content p {
    margin-bottom: 0.75rem;
}

.ai-provider-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-loading-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    color: var(--text-muted);
}

.ai-loading-box .ai-loading-spinner {
    width: 32px;
    height: 32px;
    border-width: 3px;
}

/* Responsive BEP Grid */
@media (max-width: 768px) {
    .bep-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========== AI METRIC MODAL ========== */
.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    background: var(--primary-light);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    vertical-align: middle;
    margin-left: 4px;
}

.info-icon:hover {
    background: var(--primary);
    transform: scale(1.1);
}

.ai-metric-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}

.ai-metric-modal.active {
    display: flex;
}

.ai-modal-content {
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 450px;
    max-height: 80vh;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-modal-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, var(--primary), #1d4ed8);
    color: white;
}

.ai-modal-icon {
    font-size: 1.5rem;
}

.ai-modal-title {
    flex: 1;
    font-weight: 700;
    font-size: 1rem;
}

.ai-modal-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.ai-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.ai-modal-body {
    padding: 1.25rem;
    max-height: 400px;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.ai-modal-body strong {
    color: var(--text);
}

.ai-modal-body .metric-detail {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--border);
}

.ai-modal-body .metric-detail:last-child {
    border-bottom: none;
}

.ai-modal-body .metric-detail-label {
    color: var(--text-muted);
}

.ai-modal-body .metric-detail-value {
    font-family: 'Space Mono', monospace;
    font-weight: 600;
    color: var(--text);
}

.ai-modal-body .ai-insight {
    margin-top: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-light), #f0f9ff);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary);
}

.ai-modal-body .ai-insight-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-modal-body .ai-insight-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Enhanced AI Insight Styles */
.ai-modal-body .ai-insight.premium {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-left: none;
    color: white;
}

.ai-modal-body .ai-insight.premium .ai-insight-title {
    color: rgba(255, 255, 255, 0.9);
}

.ai-modal-body .ai-insight.premium .ai-insight-text {
    color: rgba(255, 255, 255, 0.95);
}

.ai-modal-body .ai-provider-mini {
    margin-top: 0.75rem;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
}

/* Metric Overview Box */
.metric-overview {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.metric-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

/* Status Colors in Modal */
.ai-modal-body .metric-detail-value.good {
    color: var(--success);
}

.ai-modal-body .metric-detail-value.warning {
    color: var(--warning);
}

.ai-modal-body .metric-detail-value.bad {
    color: var(--danger);
}

/* Inline Loading */
.ai-loading-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.ai-loading-spinner.small {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

/* ========== INPUT VISUAL FEEDBACK ========== */

/* Shake animation for invalid input */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-5px);
    }
}

.input-error {
    animation: shake 0.3s ease;
    border-color: var(--danger) !important;
    background: var(--danger-light) !important;
}

/* Highlight animation for auto-calculated fields */
@keyframes autoHighlight {
    0% {
        background: rgba(5, 150, 105, 0.3);
        box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.2);
    }

    100% {
        background: transparent;
        box-shadow: none;
    }
}

.auto-calculated {
    animation: autoHighlight 0.8s ease;
}

.calc-input:has(.auto-calculated) {
    border-color: var(--success) !important;
}

/* Input feedback tooltip */
.input-feedback {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    font-size: 0.7rem;
    color: var(--danger);
    background: var(--danger-light);
    padding: 4px 8px;
    border-radius: 4px;
    margin-top: 4px;
    text-align: center;
    animation: fadeInUp 0.2s ease;
    z-index: 10;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Make calc-input relative for feedback positioning */
.calc-input {
    position: relative;
}

/* Sync indicator styling */
.sync-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    margin-left: 4px;
    animation: pulse 1s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}