/**
 * LBO Model Builder Styles
 * 
 * Styling for James Norton's LBO Model Builder component
 */

.lbo-model-builder {
    background: #0D353E;
    border-radius: 12px;
    padding: 30px;
    color: #fff;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.lbo-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(108, 255, 196, 0.2);
}

.lbo-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #6CFFC4;
    margin-bottom: 10px;
}

.lbo-header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
}

/* Content Layout */
.lbo-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 30px;
    margin-bottom: 30px;
}

.lbo-results-section {
    grid-column: 1 / -1;
}

/* Input Section */
.lbo-inputs-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 25px;
    border: 1px solid rgba(108, 255, 196, 0.1);
}

.lbo-input-group {
    margin-bottom: 30px;
}

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

.lbo-input-group h3 {
    font-size: 18px;
    font-weight: 600;
    color: #6CFFC4;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.lbo-input-group h3::before {
    content: '';
    width: 4px;
    height: 20px;
    background: #6CFFC4;
    margin-right: 10px;
    border-radius: 2px;
}

.lbo-input-row {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lbo-input-row label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    flex: 1;
}

.lbo-input-row input[type="number"],
.lbo-input-row select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(108, 255, 196, 0.3);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    width: 120px;
    text-align: right;
}

.lbo-input-row input[type="range"] {
    flex: 1;
    margin: 0 15px;
    -webkit-appearance: none;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
}

.lbo-input-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #6CFFC4;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(108, 255, 196, 0.4);
    transition: all 0.2s ease;
}

.lbo-input-row input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 12px rgba(108, 255, 196, 0.6);
}

.value-display {
    font-size: 14px;
    font-weight: 600;
    color: #6CFFC4;
    min-width: 60px;
    text-align: right;
}

/* Visualization Section */
.lbo-visualization-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 25px;
    border: 1px solid rgba(108, 255, 196, 0.1);
}

.lbo-visualization {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.sources-uses-chart,
.value-bridge-chart {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 20px;
}

.sources-uses-chart h3,
.value-bridge-chart h3,
.leverage-profile h3 {
    font-size: 16px;
    font-weight: 600;
    color: #6CFFC4;
    margin-bottom: 15px;
}

.chart-container {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
}

.leverage-profile {
    grid-column: 1 / -1;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 20px;
}

.leverage-bars {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 150px;
    position: relative;
}

.leverage-bar {
    flex: 1;
    max-width: 100px;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
}

.bar-fill {
    width: 60px;
    background: linear-gradient(180deg, #6CFFC4 0%, rgba(108, 255, 196, 0.6) 100%);
    border-radius: 4px 4px 0 0;
    transition: height 0.5s ease;
    position: relative;
}

.bar-label {
    margin-top: 10px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.bar-value {
    position: absolute;
    top: -25px;
    font-size: 16px;
    font-weight: 600;
    color: #6CFFC4;
}

/* Results Section */
.lbo-results {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 25px;
    border: 1px solid rgba(108, 255, 196, 0.1);
}

.lbo-results h3 {
    font-size: 20px;
    font-weight: 600;
    color: #6CFFC4;
    margin-bottom: 25px;
}

.key-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(108, 255, 196, 0.2);
    transition: all 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 255, 196, 0.2);
    border-color: rgba(108, 255, 196, 0.4);
}

.metric-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.metric-value {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 5px;
}

.metric-indicator {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    opacity: 0.6;
}

.metric-indicator.positive {
    color: #6CFFC4;
}

.metric-indicator.neutral {
    color: #FFD700;
}

.metric-indicator.negative {
    color: #FF6B6B;
}

/* Results Table */
.detailed-results {
    margin-bottom: 30px;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

.results-table th,
.results-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.results-table th {
    background: rgba(108, 255, 196, 0.1);
    color: #6CFFC4;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.results-table td {
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
}

.results-table td:not(:first-child) {
    text-align: right;
    font-family: 'Monaco', 'Courier New', monospace;
}

/* Actions */
.lbo-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.lbo-actions button {
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    outline: none;
}

.lbo-calculate-btn {
    background: linear-gradient(135deg, #6CFFC4 0%, #4AD09B 100%);
    color: #0D353E;
}

.lbo-calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 255, 196, 0.4);
}

.lbo-save-btn,
.lbo-export-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(108, 255, 196, 0.3);
}

.lbo-save-btn:hover,
.lbo-export-btn:hover {
    background: rgba(108, 255, 196, 0.1);
    border-color: rgba(108, 255, 196, 0.5);
}

/* Sensitivity Analysis */
.sensitivity-analysis {
    margin-top: 30px;
}

.sensitivity-analysis h4 {
    font-size: 16px;
    font-weight: 600;
    color: #6CFFC4;
    margin-bottom: 15px;
}

.sensitivity-grid {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 20px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .lbo-content {
        grid-template-columns: 1fr;
    }
    
    .lbo-visualization {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .lbo-model-builder {
        padding: 20px;
    }
    
    .key-metrics {
        grid-template-columns: 1fr;
    }
    
    .lbo-actions {
        flex-direction: column;
    }
    
    .lbo-actions button {
        width: 100%;
    }
}

/* Loading State */
.lbo-model-builder.loading {
    opacity: 0.7;
    pointer-events: none;
}

.lbo-model-builder.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(108, 255, 196, 0.3);
    border-top-color: #6CFFC4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}