/**
 * Financial Formula Explorer - Light Theme Styles
 * A modern, clean design with soft colors and smooth animations
 */

/* ==================== CSS Variables ==================== */
:root {
    /* Colors - Light Theme */
    --ffe-bg-primary: #f8fafc;
    --ffe-bg-secondary: #ffffff;
    --ffe-bg-tertiary: #f1f5f9;
    --ffe-bg-hover: #e2e8f0;
    
    --ffe-text-primary: #1e293b;
    --ffe-text-secondary: #475569;
    --ffe-text-muted: #94a3b8;
    --ffe-text-light: #cbd5e1;
    
    --ffe-border: #e2e8f0;
    --ffe-border-light: #f1f5f9;
    --ffe-border-dark: #cbd5e1;
    
    /* Accent Colors */
    --ffe-blue: #3b82f6;
    --ffe-blue-light: #eff6ff;
    --ffe-blue-dark: #1d4ed8;
    
    --ffe-green: #10b981;
    --ffe-green-light: #ecfdf5;
    --ffe-green-dark: #059669;
    
    --ffe-red: #ef4444;
    --ffe-red-light: #fef2f2;
    --ffe-red-dark: #dc2626;
    
    --ffe-purple: #8b5cf6;
    --ffe-purple-light: #f5f3ff;
    --ffe-purple-dark: #7c3aed;
    
    --ffe-orange: #f59e0b;
    --ffe-orange-light: #fffbeb;
    --ffe-orange-dark: #d97706;
    
    --ffe-teal: #14b8a6;
    --ffe-teal-light: #f0fdfa;
    
    /* Shadows */
    --ffe-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --ffe-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --ffe-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --ffe-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --ffe-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    
    /* Border Radius */
    --ffe-radius-sm: 6px;
    --ffe-radius: 10px;
    --ffe-radius-lg: 14px;
    --ffe-radius-xl: 20px;
    
    /* Transitions */
    --ffe-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --ffe-transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== Base Container ==================== */
.ffe-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--ffe-bg-primary);
    color: var(--ffe-text-primary);
    padding: 32px;
    border-radius: var(--ffe-radius-xl);
    box-shadow: var(--ffe-shadow-lg);
    max-width: 1400px;
    margin: 0 auto;
}

.ffe-container *,
.ffe-container *::before,
.ffe-container *::after {
    box-sizing: border-box;
}

/* ==================== Header ==================== */
.ffe-header {
    text-align: center;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--ffe-border);
}

.ffe-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--ffe-text-primary);
    margin: 0 0 12px 0;
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, var(--ffe-blue) 0%, var(--ffe-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ffe-subtitle {
    font-size: 1rem;
    color: var(--ffe-text-secondary);
    margin: 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* ==================== Tabs ==================== */
.ffe-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.ffe-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: var(--ffe-radius);
    border: 1px solid var(--ffe-border);
    background: var(--ffe-bg-secondary);
    color: var(--ffe-text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--ffe-transition);
    font-family: inherit;
}

.ffe-tab:hover {
    background: var(--ffe-bg-tertiary);
    border-color: var(--ffe-border-dark);
    color: var(--ffe-text-primary);
}

.ffe-tab.active {
    background: linear-gradient(135deg, var(--ffe-blue-light) 0%, var(--ffe-purple-light) 100%);
    border-color: var(--ffe-blue);
    color: var(--ffe-blue-dark);
    box-shadow: var(--ffe-shadow-md);
}

.ffe-tab svg {
    flex-shrink: 0;
}

/* ==================== Main Layout ==================== */
.ffe-main {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
}

@media (max-width: 1024px) {
    .ffe-main {
        grid-template-columns: 1fr;
    }
}

/* ==================== Sidebar ==================== */
.ffe-sidebar {
    background: var(--ffe-bg-secondary);
    border: 1px solid var(--ffe-border);
    border-radius: var(--ffe-radius-lg);
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 24px;
    box-shadow: var(--ffe-shadow);
}

.ffe-sidebar-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ffe-border-light);
}

.ffe-sidebar-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--ffe-radius-sm);
    background: var(--ffe-blue-light);
    color: var(--ffe-blue);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ffe-sidebar-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ffe-text-muted);
    font-weight: 600;
}

.ffe-inputs-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ==================== Input Cards ==================== */
.ffe-input-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--ffe-bg-tertiary);
    border: 1px solid transparent;
    border-radius: var(--ffe-radius);
    cursor: pointer;
    transition: var(--ffe-transition);
}

.ffe-input-card:hover {
    background: var(--ffe-bg-hover);
    border-color: var(--ffe-border);
}

.ffe-input-card.active {
    background: var(--ffe-bg-secondary);
    border-color: var(--ffe-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.ffe-input-card.highlighted {
    background: var(--ffe-blue-light);
    border-color: var(--ffe-blue);
}

.ffe-input-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--ffe-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

.ffe-input-icon.income { background: var(--ffe-blue-light); color: var(--ffe-blue); }
.ffe-input-icon.cost { background: var(--ffe-red-light); color: var(--ffe-red); }
.ffe-input-icon.non_cash { background: var(--ffe-orange-light); color: var(--ffe-orange); }
.ffe-input-icon.balance_sheet { background: var(--ffe-green-light); color: var(--ffe-green); }
.ffe-input-icon.liquidity { background: var(--ffe-purple-light); color: var(--ffe-purple); }

.ffe-input-content {
    flex: 1;
    min-width: 0;
}

.ffe-input-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ffe-text-muted);
    margin-bottom: 2px;
    font-weight: 500;
}

.ffe-input-field {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--ffe-text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    font-weight: 600;
    outline: none;
    padding: 0;
}

.ffe-input-field:focus {
    color: var(--ffe-blue);
}

.ffe-input-help {
    width: 28px;
    height: 28px;
    border-radius: var(--ffe-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ffe-text-light);
    cursor: pointer;
    transition: var(--ffe-transition);
    background: transparent;
    border: none;
}

.ffe-input-help:hover {
    background: var(--ffe-bg-hover);
    color: var(--ffe-text-secondary);
}

/* ==================== Canvas ==================== */
.ffe-canvas {
    background: var(--ffe-bg-secondary);
    border: 1px solid var(--ffe-border);
    border-radius: var(--ffe-radius-lg);
    overflow: hidden;
    box-shadow: var(--ffe-shadow);
}

/* ==================== Toolbar ==================== */
.ffe-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--ffe-border);
    background: var(--ffe-bg-tertiary);
    flex-wrap: wrap;
    gap: 12px;
}

.ffe-toolbar-left,
.ffe-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ffe-scenarios {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.ffe-scenario-btn {
    padding: 8px 14px;
    border-radius: var(--ffe-radius-sm);
    border: 1px solid var(--ffe-border);
    background: var(--ffe-bg-secondary);
    color: var(--ffe-text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--ffe-transition);
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ffe-scenario-btn:hover {
    background: var(--ffe-bg-hover);
    border-color: var(--ffe-border-dark);
}

.ffe-scenario-btn.active {
    background: var(--ffe-green-light);
    border-color: var(--ffe-green);
    color: var(--ffe-green-dark);
}

.ffe-view-mode {
    display: flex;
    background: var(--ffe-bg-secondary);
    border-radius: var(--ffe-radius-sm);
    padding: 4px;
    border: 1px solid var(--ffe-border);
}

.ffe-mode-btn {
    padding: 6px 12px;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: var(--ffe-text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--ffe-transition);
    font-family: inherit;
}

.ffe-mode-btn:hover {
    color: var(--ffe-text-secondary);
}

.ffe-mode-btn.active {
    background: var(--ffe-purple-light);
    color: var(--ffe-purple-dark);
}

.ffe-reset-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--ffe-radius-sm);
    border: 1px solid var(--ffe-red);
    background: var(--ffe-red-light);
    color: var(--ffe-red);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--ffe-transition);
    font-family: inherit;
}

.ffe-reset-btn:hover {
    background: var(--ffe-red);
    color: white;
}

/* ==================== Content Area ==================== */
.ffe-content {
    padding: 24px;
    min-height: 400px;
}

.ffe-view {
    display: none;
}

.ffe-view.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* ==================== Sections ==================== */
.ffe-section {
    margin-bottom: 32px;
}

.ffe-section:last-child {
    margin-bottom: 0;
}

.ffe-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.ffe-section-icon {
    font-size: 1.25rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--ffe-radius);
}

.ffe-section-icon.profit { background: var(--ffe-green-light); }
.ffe-section-icon.margin { background: var(--ffe-purple-light); }

.ffe-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ffe-text-primary);
    margin: 0;
}

.ffe-section-hint {
    font-size: 0.8rem;
    color: var(--ffe-text-muted);
    margin-left: auto;
}

/* ==================== Flow Cards ==================== */
.ffe-flow {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ffe-flow-arrow {
    color: var(--ffe-text-light);
    flex-shrink: 0;
}

.ffe-formula-card {
    background: var(--ffe-bg-tertiary);
    border: 2px solid transparent;
    border-radius: var(--ffe-radius-lg);
    padding: 20px;
    min-width: 140px;
    cursor: pointer;
    transition: var(--ffe-transition);
    text-align: center;
}

.ffe-formula-card:hover {
    background: var(--ffe-bg-hover);
    border-color: var(--ffe-border);
    transform: translateY(-2px);
    box-shadow: var(--ffe-shadow-md);
}

.ffe-formula-card.active {
    border-color: var(--ffe-blue);
    background: var(--ffe-blue-light);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.ffe-formula-card.highlighted {
    border-color: var(--ffe-green);
    background: var(--ffe-green-light);
}

.ffe-formula-card.dimmed {
    opacity: 0.4;
}

.ffe-formula-card-emoji {
    font-size: 1.75rem;
    margin-bottom: 8px;
    display: block;
}

.ffe-formula-card-label {
    font-size: 0.8rem;
    color: var(--ffe-text-secondary);
    margin-bottom: 4px;
}

.ffe-formula-card-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ffe-text-primary);
}

.ffe-formula-card.active .ffe-formula-card-value {
    color: var(--ffe-blue-dark);
}

/* ==================== Ratios Grid ==================== */
.ffe-ratios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.ffe-ratio-card {
    background: var(--ffe-bg-tertiary);
    border: 2px solid transparent;
    border-radius: var(--ffe-radius-lg);
    padding: 16px;
    cursor: pointer;
    transition: var(--ffe-transition);
    text-align: center;
}

.ffe-ratio-card:hover {
    background: var(--ffe-bg-hover);
    border-color: var(--ffe-border);
    transform: translateY(-2px);
    box-shadow: var(--ffe-shadow-md);
}

.ffe-ratio-card.active {
    border-color: var(--ffe-purple);
    background: var(--ffe-purple-light);
}

.ffe-ratio-card.highlighted {
    border-color: var(--ffe-green);
    background: var(--ffe-green-light);
}

.ffe-ratio-card.dimmed {
    opacity: 0.4;
}

.ffe-ratio-card-emoji {
    font-size: 1.5rem;
    margin-bottom: 6px;
    display: block;
}

.ffe-ratio-card-label {
    font-size: 0.75rem;
    color: var(--ffe-text-secondary);
    margin-bottom: 4px;
}

.ffe-ratio-card-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ffe-text-primary);
}

/* ==================== Library Grid ==================== */
.ffe-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.ffe-library-card {
    background: var(--ffe-bg-tertiary);
    border: 1px solid var(--ffe-border);
    border-radius: var(--ffe-radius-lg);
    padding: 20px;
    cursor: pointer;
    transition: var(--ffe-transition);
}

.ffe-library-card:hover {
    background: var(--ffe-bg-secondary);
    border-color: var(--ffe-blue);
    transform: translateY(-2px);
    box-shadow: var(--ffe-shadow-lg);
}

.ffe-library-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.ffe-library-card-emoji {
    font-size: 2rem;
}

.ffe-library-card-title {
    font-weight: 600;
    color: var(--ffe-text-primary);
    margin: 0 0 4px 0;
    font-size: 1rem;
}

.ffe-library-card-formula {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--ffe-text-muted);
}

.ffe-library-card-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.75rem;
    font-weight: 700;
    margin: 16px 0;
    background: linear-gradient(135deg, var(--ffe-blue) 0%, var(--ffe-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ffe-library-card-desc {
    font-size: 0.85rem;
    color: var(--ffe-text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
}

.ffe-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.ffe-category-badge.profit { background: var(--ffe-green-light); color: var(--ffe-green-dark); }
.ffe-category-badge.margin { background: var(--ffe-purple-light); color: var(--ffe-purple-dark); }
.ffe-category-badge.efficiency { background: var(--ffe-orange-light); color: var(--ffe-orange-dark); }
.ffe-category-badge.liquidity { background: var(--ffe-blue-light); color: var(--ffe-blue-dark); }

/* ==================== Explanation Panel ==================== */
.ffe-explanation {
    border-top: 1px solid var(--ffe-border);
    padding: 24px;
    background: linear-gradient(180deg, var(--ffe-bg-tertiary) 0%, var(--ffe-bg-secondary) 100%);
    display: none;
}

.ffe-explanation.active {
    display: block;
    animation: slideUp 0.3s ease;
}

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

.ffe-explanation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.ffe-explanation-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ffe-explanation-emoji {
    font-size: 1.75rem;
}

.ffe-explanation-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ffe-text-primary);
    margin: 0;
}

.ffe-explanation-close {
    width: 36px;
    height: 36px;
    border-radius: var(--ffe-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ffe-bg-secondary);
    border: 1px solid var(--ffe-border);
    color: var(--ffe-text-secondary);
    cursor: pointer;
    transition: var(--ffe-transition);
}

.ffe-explanation-close:hover {
    background: var(--ffe-red-light);
    border-color: var(--ffe-red);
    color: var(--ffe-red);
}

.ffe-explanation-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .ffe-explanation-body {
        grid-template-columns: 1fr;
    }
}

/* ==================== Steps ==================== */
.ffe-steps-container {
    background: var(--ffe-bg-secondary);
    border: 1px solid var(--ffe-border);
    border-radius: var(--ffe-radius-lg);
    padding: 20px;
}

.ffe-steps-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ffe-text-muted);
    margin-bottom: 16px;
    font-weight: 600;
}

.ffe-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--ffe-border-light);
    animation: stepReveal 0.4s ease-out backwards;
}

.ffe-step:last-child {
    border-bottom: none;
}

@keyframes stepReveal {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.ffe-step-operator {
    width: 32px;
    height: 32px;
    border-radius: var(--ffe-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.ffe-step-operator.add { background: var(--ffe-green-light); color: var(--ffe-green); }
.ffe-step-operator.sub { background: var(--ffe-red-light); color: var(--ffe-red); }
.ffe-step-operator.mul { background: var(--ffe-orange-light); color: var(--ffe-orange); }
.ffe-step-operator.div { background: var(--ffe-purple-light); color: var(--ffe-purple); }
.ffe-step-operator.eq { background: var(--ffe-blue-light); color: var(--ffe-blue); }

.ffe-step-content {
    flex: 1;
}

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

.ffe-step-detail {
    font-size: 0.75rem;
    color: var(--ffe-text-muted);
    margin-top: 2px;
}

.ffe-step-value {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 1rem;
    color: var(--ffe-text-primary);
}

.ffe-step.result {
    background: linear-gradient(135deg, var(--ffe-blue-light) 0%, var(--ffe-purple-light) 100%);
    border-radius: var(--ffe-radius);
    padding: 16px;
    margin-top: 12px;
    border: none;
}

.ffe-step.result .ffe-step-value {
    font-size: 1.25rem;
    color: var(--ffe-blue-dark);
}

.ffe-formula-calc {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    padding: 12px 16px;
    background: var(--ffe-bg-tertiary);
    border-radius: var(--ffe-radius-sm);
    color: var(--ffe-purple);
    margin-top: 16px;
    border: 1px solid var(--ffe-border);
}

/* ==================== Info Cards ==================== */
.ffe-info-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ffe-info-card {
    background: var(--ffe-bg-secondary);
    border: 1px solid var(--ffe-border);
    border-radius: var(--ffe-radius);
    padding: 16px;
}

.ffe-info-card-title {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ffe-text-muted);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.ffe-info-card-text {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--ffe-text-secondary);
}

.ffe-info-card-text.formula {
    font-family: 'JetBrains Mono', monospace;
    color: var(--ffe-purple);
}

/* ==================== Footer ==================== */
.ffe-footer {
    text-align: center;
    padding-top: 24px;
    margin-top: 24px;
    border-top: 1px solid var(--ffe-border);
}

.ffe-footer p {
    font-size: 0.85rem;
    color: var(--ffe-text-muted);
    margin: 0;
}

/* ==================== Tooltip ==================== */
.ffe-tooltip {
    position: fixed;
    background: var(--ffe-bg-secondary);
    border: 1px solid var(--ffe-border);
    border-radius: var(--ffe-radius);
    padding: 12px 16px;
    max-width: 280px;
    z-index: 10000;
    box-shadow: var(--ffe-shadow-xl);
    animation: tooltipIn 0.2s ease;
    pointer-events: none;
}

@keyframes tooltipIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.ffe-tooltip-title {
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--ffe-text-primary);
    font-size: 0.9rem;
}

.ffe-tooltip-text {
    font-size: 0.8rem;
    color: var(--ffe-text-secondary);
    line-height: 1.5;
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    .ffe-container {
        padding: 16px;
        border-radius: var(--ffe-radius-lg);
    }
    
    .ffe-title {
        font-size: 1.5rem;
    }
    
    .ffe-subtitle {
        font-size: 0.9rem;
    }
    
    .ffe-tabs {
        gap: 4px;
    }
    
    .ffe-tab {
        padding: 10px 14px;
        font-size: 0.8rem;
    }
    
    .ffe-tab span {
        display: none;
    }
    
    .ffe-sidebar {
        position: static;
    }
    
    .ffe-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .ffe-toolbar-left,
    .ffe-toolbar-right {
        justify-content: center;
    }
    
    .ffe-flow {
        flex-direction: column;
        align-items: stretch;
    }
    
    .ffe-flow-arrow {
        transform: rotate(90deg);
        align-self: center;
    }
    
    .ffe-formula-card {
        min-width: auto;
    }
    
    .ffe-section-hint {
        display: none;
    }
}

/* ==================== Print Styles ==================== */
@media print {
    .ffe-container {
        box-shadow: none;
        padding: 0;
    }
    
    .ffe-tabs,
    .ffe-toolbar,
    .ffe-input-help,
    .ffe-reset-btn,
    .ffe-explanation-close {
        display: none !important;
    }
}

/* ==================== Sidebar Currency Info ==================== */
.ffe-sidebar-currency-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--ffe-bg-tertiary);
    border-radius: var(--ffe-radius-sm);
    margin-bottom: 12px;
    border: 1px dashed var(--ffe-border);
}

.ffe-currency-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 8px;
    background: var(--ffe-green-light);
    color: var(--ffe-green-dark);
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ffe-period-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 8px;
    background: var(--ffe-blue-light);
    color: var(--ffe-blue-dark);
    border-radius: 4px;
}

.ffe-sidebar-help {
    margin-left: auto;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ffe-bg-secondary);
    border: 1px solid var(--ffe-border);
    color: var(--ffe-text-muted);
    cursor: pointer;
    transition: var(--ffe-transition);
}

.ffe-sidebar-help:hover {
    background: var(--ffe-purple-light);
    border-color: var(--ffe-purple);
    color: var(--ffe-purple);
}

/* ==================== View Mode Wrapper ==================== */
.ffe-view-mode-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ffe-help-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ffe-bg-secondary);
    border: 1px solid var(--ffe-border);
    color: var(--ffe-text-muted);
    cursor: pointer;
    transition: var(--ffe-transition);
}

.ffe-help-icon:hover {
    background: var(--ffe-purple-light);
    border-color: var(--ffe-purple);
    color: var(--ffe-purple);
}

/* ==================== Example Scenarios View ==================== */
.ffe-example-header {
    text-align: center;
    margin-bottom: 32px;
}

.ffe-example-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ffe-text-primary);
    margin: 0 0 8px 0;
}

.ffe-example-subtitle {
    font-size: 0.95rem;
    color: var(--ffe-text-secondary);
    margin: 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.ffe-example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.ffe-example-card {
    background: var(--ffe-bg-secondary);
    border: 2px solid var(--ffe-border);
    border-radius: var(--ffe-radius-lg);
    padding: 24px;
    cursor: pointer;
    transition: var(--ffe-transition);
}

.ffe-example-card:hover {
    border-color: var(--ffe-blue);
    box-shadow: var(--ffe-shadow-md);
    transform: translateY(-2px);
}

.ffe-example-card.active {
    border-color: var(--ffe-green);
    background: linear-gradient(135deg, var(--ffe-green-light) 0%, var(--ffe-bg-secondary) 100%);
}

.ffe-example-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.ffe-example-icon {
    font-size: 2rem;
}

.ffe-example-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--ffe-text-primary);
    margin: 0;
}

.ffe-example-card-desc {
    font-size: 0.9rem;
    color: var(--ffe-text-secondary);
    margin: 0 0 16px 0;
    line-height: 1.5;
}

.ffe-example-values {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

.ffe-example-value {
    font-size: 0.8rem;
    color: var(--ffe-text-secondary);
    display: flex;
    justify-content: space-between;
    padding: 6px 10px;
    background: var(--ffe-bg-tertiary);
    border-radius: 4px;
}

.ffe-example-value strong {
    color: var(--ffe-text-primary);
    font-family: 'JetBrains Mono', monospace;
}

.ffe-example-value-more {
    grid-column: 1 / -1;
    font-size: 0.75rem;
    color: var(--ffe-text-muted);
    text-align: center;
    font-style: italic;
}

.ffe-example-load-btn {
    width: 100%;
    padding: 12px;
    border-radius: var(--ffe-radius);
    border: none;
    background: linear-gradient(135deg, var(--ffe-blue) 0%, var(--ffe-purple) 100%);
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--ffe-transition);
    font-family: inherit;
}

.ffe-example-load-btn:hover {
    transform: scale(1.02);
    box-shadow: var(--ffe-shadow-md);
}

.ffe-example-card.active .ffe-example-load-btn {
    background: var(--ffe-green);
}

/* ==================== Calculator View ==================== */
.ffe-calc-header {
    text-align: center;
    margin-bottom: 32px;
}

.ffe-calc-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ffe-text-primary);
    margin: 0 0 8px 0;
}

.ffe-calc-subtitle {
    font-size: 0.95rem;
    color: var(--ffe-text-secondary);
    margin: 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.ffe-calc-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 24px;
}

@media (max-width: 900px) {
    .ffe-calc-grid {
        grid-template-columns: 1fr;
    }
}

.ffe-calc-section {
    background: var(--ffe-bg-secondary);
    border: 1px solid var(--ffe-border);
    border-radius: var(--ffe-radius-lg);
    padding: 20px;
}

.ffe-calc-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ffe-text-primary);
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ffe-border-light);
}

.ffe-calc-inputs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ffe-calc-input-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--ffe-bg-tertiary);
    border-radius: var(--ffe-radius-sm);
}

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

.ffe-calc-input-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ffe-text-primary);
}

.ffe-calc-results {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

@media (max-width: 600px) {
    .ffe-calc-results {
        grid-template-columns: 1fr;
    }
}

.ffe-calc-result-card {
    background: var(--ffe-bg-tertiary);
    border: 1px solid var(--ffe-border);
    border-radius: var(--ffe-radius);
    padding: 16px;
    text-align: center;
}

.ffe-calc-result-card.highlight {
    background: linear-gradient(135deg, var(--ffe-green-light) 0%, var(--ffe-bg-secondary) 100%);
    border-color: var(--ffe-green);
}

.ffe-calc-result-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ffe-text-muted);
    margin-bottom: 4px;
}

.ffe-calc-result-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ffe-text-primary);
    margin-bottom: 4px;
}

.ffe-calc-result-formula {
    font-size: 0.7rem;
    color: var(--ffe-text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.ffe-calc-ratios {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ffe-calc-ratio {
    flex: 1;
    min-width: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    background: var(--ffe-bg-tertiary);
    border: 1px solid var(--ffe-border);
    border-radius: var(--ffe-radius-sm);
}

.ffe-calc-ratio span {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ffe-text-muted);
    margin-bottom: 4px;
}

.ffe-calc-ratio strong {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    color: var(--ffe-purple);
}
