/* CAPM Calculator - DCF Style Layout */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css');

/* Unified Page Header Styling */
.page-header {
    padding-bottom: 20px;
    margin-top: 4rem;
    margin-bottom: 4rem;
    text-align: center;
    border-bottom: 1px solid #eaeaea;
}

.page-header h1 {
    color: #003366;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 10px;
}

.page-header .model-description {
    text-align: center;
    color: #666;
    font-size: 14px;
    max-width: 700px;
    margin: 0 auto;
}


/* 입력 카드 스타일 */
.input-card {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.07);
    margin-bottom: 40px;
    overflow: hidden;
}

.card-header {
    background-color: #f8f9fa;
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.card-header h2 i {
    margin-right: 12px;
    color: var(--accent-color);
}

:root {
    --primary-color: #003366;
    --secondary-color: #0066cc;
    --accent-color: #DAA520;
    --text-color: #333;
    --light-gray: #f8f9fa;
    --border-color: #e0e0e0;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
}

#capm-form {
    padding: 30px;
}

.form-actions {
    text-align: center;
    margin-top: 30px;
}

/* Form Styling */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 25px;
}

.form-group {
    position: relative;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #1f2937;
    font-size: 0.95rem;
    letter-spacing: 0.025em;
}

.form-group label i {
    margin-right: 8px;
    color: var(--accent-color);
    font-size: 1.1em;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(218, 165, 32, 0.15), 0 4px 6px rgba(0, 0, 0, 0.07);
    transform: translateY(-1px);
}

.form-group input:hover,
.form-group select:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.form-group input::placeholder {
    color: #9ca3af;
    font-style: italic;
}

.form-group .helper-text {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 8px;
    font-style: italic;
    line-height: 1.4;
}

/* Ticker Lookup Link */
.ticker-lookup {
    margin-top: 8px;
    font-size: 13px;
    color: #6b7280;
}

.ticker-lookup a {
    color: #0056b3;
    text-decoration: none;
    font-weight: 500;
}

.ticker-lookup a:hover {
    text-decoration: underline;
}

.ticker-lookup i {
    font-size: 11px;
    margin-left: 4px;
    color: #6b7280;
}

/* Section Titles */
.section-title {
    font-weight: 600;
    color: #003366;
    margin: 30px 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    font-size: 1.1rem;
}

.section-title i {
    margin-right: 8px;
    color: var(--accent-color);
}

/* Radio Groups */
.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.radio-option {
    flex: 1;
    min-width: 200px;
    padding: 20px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    position: relative;
}

.radio-option:hover {
    border-color: #003366;
    box-shadow: 0 2px 10px rgba(0, 51, 102, 0.1);
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.radio-option input[type="radio"]:checked + .radio-content {
    color: #003366;
}

.radio-option input[type="radio"]:checked ~ .radio-custom {
    background: #003366;
    border-color: #003366;
}

.radio-option input[type="radio"]:checked ~ .radio-custom::after {
    opacity: 1;
}

.radio-custom {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.radio-content strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: #374151;
}

.radio-content small {
    color: #6b7280;
    line-height: 1.4;
}

/* Advanced Options */
.advanced-section {
    margin-top: 25px;
    padding: 25px;
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    display: none;
}

.advanced-section h3 {
    color: #003366;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
}

.advanced-section h3 i {
    margin-right: 8px;
    color: var(--accent-color);
}

.card-footer {
    padding: 20px 30px;
    background-color: #f8f9fa;
    border-top: 1px solid var(--border-color);
    text-align: right;
}

/* Submit Button */
.submit-btn {
    display: inline-block;
    padding: 14px 28px;
    background: linear-gradient(135deg, #003366 0%, #004080 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 51, 102, 0.2);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 51, 102, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn i {
    margin-right: 8px;
}

/* Loading Section */
#loading {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 40px;
    display: none;
}

.spinner-border {
    width: 4rem;
    height: 4rem;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #003366;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loading h3 {
    color: #003366;
    margin-bottom: 10px;
    font-weight: 600;
}

#loading p {
    color: #6b7280;
    margin: 0;
}

/* Results Section */
#results {
    display: none;
}

/* Company Info Card */
.info-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e1e4e8;
}

.info-card h3 {
    color: #003366;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
}

.info-card h3 i {
    margin-right: 10px;
    color: var(--accent-color);
}

.company-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.company-header h4 {
    margin: 0;
    color: #1f2937;
    font-size: 1.4rem;
    font-weight: 600;
}

.ticker-badge {
    background: #003366;
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
}

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

.metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f3f4f6;
}

.metric label {
    font-weight: 500;
    color: #6b7280;
    margin: 0;
}

.metric span {
    font-weight: 600;
    color: #1f2937;
}

/* Step Navigation */
.step {
    background: white;
    border-radius: 12px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e1e4e8;
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.step.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.step h3 {
    color: #003366;
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0 0 30px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #f3f4f6;
    display: flex;
    align-items: center;
}

.step h3 i {
    margin-right: 12px;
    color: var(--accent-color);
}

/* Formula Section */
.formula-section {
    margin-bottom: 40px;
}

.formula-box {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 30px;
    border-radius: 12px;
    border-left: 5px solid #003366;
}

.formula-box h4 {
    color: #003366;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.formula-main {
    font-size: 2rem;
    font-family: 'Courier New', monospace;
    text-align: center;
    padding: 25px;
    background: white;
    border-radius: 10px;
    margin-bottom: 25px;
    color: #003366;
    font-weight: 600;
    border: 2px solid #e1e4e8;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

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

.formula-part {
    padding: 15px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.formula-part strong {
    color: #003366;
    display: block;
    margin-bottom: 5px;
}

/* Educational Content */
.educational-content {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    margin-top: 25px;
}

.educational-content h4 {
    color: #003366;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.explanation-text {
    color: #4b5563;
    line-height: 1.7;
    font-size: 1rem;
}

.explanation-text ul {
    margin: 15px 0;
    padding-left: 0;
    list-style: none;
}

.explanation-text li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
}

.explanation-text li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
    font-size: 1.1rem;
}

/* Beta Analysis */
.beta-analysis {
    margin-bottom: 40px;
}

.beta-card {
    background: linear-gradient(135deg, #003366 0%, #004080 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(0, 51, 102, 0.3);
}

.beta-card h4 {
    margin-bottom: 20px;
    opacity: 0.9;
    font-size: 1.2rem;
}

.beta-number {
    font-size: 3.5rem;
    font-weight: 700;
    display: block;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.beta-meaning {
    font-size: 1.2rem;
    opacity: 0.9;
    font-style: italic;
}

.beta-explanation {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
}

.beta-explanation h4 {
    color: #003366;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.beta-guide {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.beta-range {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #003366;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.range-label {
    font-weight: 600;
    color: #003366;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
}

.range-desc {
    color: #6b7280;
    font-weight: 500;
}

/* Rate Analysis */
.rate-analysis {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.rate-card {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    border-left: 5px solid #003366;
}

.rate-card h4 {
    color: #003366;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 25px;
}

.rate-display {
    text-align: center;
    margin-bottom: 25px;
}

.rate-value {
    font-size: 2.8rem;
    font-weight: 700;
    color: #003366;
    display: block;
    margin-bottom: 10px;
}

.rate-source {
    color: #6b7280;
    font-size: 0.95rem;
    font-style: italic;
}

.rate-explanation p {
    color: #4b5563;
    line-height: 1.6;
    margin: 0;
}

/* CAPM Calculation */
.capm-calculation {
    margin-bottom: 40px;
}

.calculation-box {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    border-left: 5px solid #003366;
}

.calculation-box h4 {
    color: #003366;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 25px;
}

.calculation-steps {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.calc-step {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #d1d5db;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.calc-step.calc-final {
    border-left-color: #003366;
    background: linear-gradient(135deg, #003366 0%, #004080 100%);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 51, 102, 0.3);
}

.calc-label {
    font-weight: 500;
    font-size: 1rem;
}

.calc-value,
.calc-result {
    font-weight: 600;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
}

.calc-result {
    font-size: 1.3rem;
}

/* Result Analysis */
.result-interpretation {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
}

.result-interpretation h4 {
    color: #003366;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 25px;
}

.analysis-content {
    color: #4b5563;
    line-height: 1.7;
    font-size: 1rem;
}

.analysis-content p {
    margin-bottom: 15px;
}

.analysis-content strong {
    color: #1f2937;
}

/* 차트 컨테이너 - CAPM 페이지에만 적용 */
/* Chart Explanations */
.chart-explanation {
    padding: 20px;
    margin-top: 25px;
    background-color: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #495057;
}

.chart-explanation strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* Chart Container */
.chart-container {
    background: white;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    min-height: 400px;
    display: block;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
}

/* Mobile chart optimizations */
@media (max-width: 768px) {
    .chart-container {
        margin: 10px 0;
        padding: 10px;
        min-height: 300px;
    }
    
    /* Limit chart size on mobile */
    .chart-container canvas,
    .chart-container svg,
    .chart-container .js-plotly-plot {
        max-width: 100% !important;
        max-height: 300px !important;
        width: auto !important;
        height: auto !important;
    }
    
    /* Specific fix for oversized charts */
    .chart-container div[id*="chart"] {
        max-width: 100% !important;
        max-height: 300px !important;
    }
}

.chart-container h4 {
    color: #003366;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
}

/* Next Step Buttons */
.next-step {
    display: inline-block;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    margin: 20px auto;
    display: block;
    width: fit-content;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.next-step:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
    text-decoration: none;
    color: white;
}

.next-step:active {
    transform: translateY(0);
}

.next-step i {
    margin-left: 8px;
}

/* Chart Fullscreen Icon */
.fullscreen-icon {
    cursor: pointer;
    color: #007bff;
    margin-left: 10px;
    font-size: 0.9em;
    transition: color 0.3s ease;
}

.fullscreen-icon:hover {
    color: #0056b3;
}

/* Chart Modal */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; 
    background-color: rgba(0,0,0,0.6);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto; 
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 1200px;
    border-radius: 10px;
    position: relative;
}

.close-button {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 25px;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
}

#modal-chart-container {
    width: 100%;
    height: 80vh;
}


/* Responsive Design */
@media (max-width: 768px) {
    .capm-container {
        padding: 15px;
    }
    
    .header-section {
        padding: 30px 15px;
    }
    
    .header-section h1 {
        font-size: 2rem;
    }
    
    .input-section {
        padding: 25px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .form-group {
        min-width: auto;
    }
    
    .radio-group {
        flex-direction: column;
    }
    
    .radio-option {
        min-width: auto;
    }
    
    .rate-analysis {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .company-metrics {
        grid-template-columns: 1fr;
    }
    
    .formula-explanation {
        grid-template-columns: 1fr;
    }
    
    .calc-step {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        text-align: left;
    }
    
    .step {
        padding: 25px;
    }
    
    .step h3 {
        font-size: 1.5rem;
    }
    
    .formula-main {
        font-size: 1.5rem;
        padding: 20px;
    }
    
    .beta-number {
        font-size: 2.5rem;
    }
    
    .rate-value {
        font-size: 2.2rem;
    }
}

@media (max-width: 480px) {
    .header-section h1 {
        font-size: 1.8rem;
    }
    
    .formula-main {
        font-size: 1.2rem;
    }
    
    .beta-number {
        font-size: 2rem;
    }
    
    .rate-value {
        font-size: 1.8rem;
    }
    
    .next-step {
        width: 100%;
        margin: 20px 0;
    }
}

/* --- Sensitivity Analysis Styles --- */

@media (max-width: 992px) {
    .wacc-details-grid {
        grid-template-columns: 1fr;
    }
    .sensitivity-controls {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .page-header {
        padding: 15px 0;
        margin-bottom: 25px;
    }
    .page-header h1 {
        font-size: 1.8rem;
    }
    .page-header .model-description p {
        font-size: 1rem;
    }
    .input-card, .info-card, .step {
        padding: 20px;
        margin-bottom: 25px;
    }
    .card-header {
        padding: 15px 20px;
    }
    .card-header h2 {
        font-size: 1.3rem;
    }
    #capm-form {
        padding: 20px;
    }
    .form-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .radio-group {
        flex-direction: column;
        gap: 15px;
    }
    .advanced-section {
        padding: 20px;
    }
    .company-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .company-metrics {
        grid-template-columns: 1fr;
    }
    .step h3 {
        font-size: 1.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .status-indicator {
        align-self: flex-start;
    }
    .formula-main {
        font-size: 1.4rem;
    }
    .formula-explanation {
        grid-template-columns: 1fr;
    }
    .rate-analysis {
        grid-template-columns: 1fr;
    }
    .beta-number {
        font-size: 3rem;
    }
    .rate-value {
        font-size: 2.5rem;
    }
    .calc-step {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .wacc-percentage {
        font-size: 3rem;
    }
    .results-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    .results-actions button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .page-header h1 {
        font-size: 1.6rem;
    }
    .input-card, .info-card, .step {
        padding: 15px;
    }
    #capm-form {
        padding: 15px;
    }
    .step h3 {
        font-size: 1.3rem;
    }
    .formula-main {
        font-size: 1.2rem;
        padding: 15px;
    }
    .beta-number {
        font-size: 2.5rem;
    }
    .rate-value {
        font-size: 2.2rem;
    }
    .wacc-percentage {
        font-size: 2.5rem;
    }
    .next-step {
        width: 100%;
        padding: 12px 20px;
        font-size: 1rem;
    }
}
.sensitivity-analysis-container, .wacc-container {
    padding: 20px;
}

.sensitivity-analysis-container .explanation-text,
.wacc-container .explanation-text {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid var(--accent-color);
    font-size: 1rem;
    line-height: 1.7;
    color: #4b5563;
}

.sensitivity-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.slider-group label {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 10px;
    display: block;
}

.slider-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 5px;
    outline: none;
    transition: opacity .2s;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    background: var(--primary-color);
    cursor: pointer;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

input[type="range"]::-moz-range-thumb {
    width: 22px;
    height: 22px;
    background: var(--primary-color);
    cursor: pointer;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.slider-value {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary-color);
    background-color: #f0f3f5;
    padding: 5px 10px;
    border-radius: 6px;
    min-width: 60px;
    text-align: center;
}

.sensitivity-results h4 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

#sensitivity-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

#sensitivity-table th, #sensitivity-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

#sensitivity-table thead th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #343a40;
}

#sensitivity-table tbody tr:hover {
    background-color: #f1f1f1;
}

#sensitivity-table tbody tr td:last-child {
    font-weight: bold;
    color: var(--secondary-color);
}

/* --- WACC Calculation Styles --- */
.wacc-result-display {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    text-align: center;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.wacc-result-display h4 {
    margin: 0 0 10px 0;
    font-weight: 500;
    opacity: 0.9;
}

.wacc-percentage {
    font-size: 3.5rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.wacc-container .formula {
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    color: #333;
    background-color: #e9ecef;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
}

.wacc-details-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 30px;
    align-items: center;
}

.wacc-chart-container {
    position: relative;
    height: 300px;
}

.wacc-components h5, .wacc-chart-container h5 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.wacc-components ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.wacc-components li {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f3f5;
}

.wacc-components li:last-child {
    border-bottom: none;
}

.wacc-components li strong {
    color: #343a40;
}

.wacc-components li span {
    font-weight: 600;
    color: var(--secondary-color);
}

@media (max-width: 992px) {
    .wacc-details-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Step Status Indicator Styles --- */
.step-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}

.status-indicator {
    font-size: 0.9rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 15px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.step-header.completed .status-indicator {
    background-color: #e8f5e9; /* Light Green */
    color: #2e7d32; /* Dark Green */
}

.step-header.in-progress .status-indicator {
    background-color: #e3f2fd; /* Light Blue */
    color: #1565c0; /* Dark Blue */
}

.step-header.pending .status-indicator {
    background-color: #f5f5f5; /* Light Gray */
    color: #616161; /* Dark Gray */
}

.step-header .status-indicator .fa-check-circle {
    color: #4caf50;
}

.step-header .status-indicator .fa-spinner {
    color: #1976d2;
}

.step-header .status-indicator .fa-circle {
    color: #9e9e9e;
}

.step-hidden {
    display: none;
}

/* Action Buttons Styling */
.results-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    padding: 1rem;
    border-top: 1px solid #e0e0e0;
}

.results-actions button {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#show-all-steps-btn {
    background-color: #4CAF50; /* Green */
    color: white;
}

#show-all-steps-btn:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

#reset-analysis-btn {
    background-color: #6c757d; /* Gray */
    color: white;
}

#reset-analysis-btn:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}