/**
 * Business Interruption Loss Calculator Styles
 * 
 * @package BusinessInterruptionCalculator
 */

/* Reset and Base Styles */
.bil-calculator * {
    box-sizing: border-box;
}

.bil-calculator {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Header Styles */
.bil-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.bil-header h2 {
    color: #2c3e50;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    line-height: 1.2;
}

.bil-subtitle {
    color: #7f8c8d;
    font-size: 1.1rem;
    margin: 0;
    font-weight: 400;
}

/* Form Styles */
.bil-form {
    margin-bottom: 40px;
}

.bil-form-group {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid #e9ecef;
}

.bil-form-group h3 {
    color: #2c3e50;
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

.bil-input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 20px;
}

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

.bil-input-field {
    display: flex;
    flex-direction: column;
}

.bil-input-field label {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bil-input-field input[type="number"],
.bil-input-field select {
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #ffffff;
}

.bil-input-field input[type="number"]:focus,
.bil-input-field select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.bil-input-field input[type="number"]:invalid {
    border-color: #e74c3c;
}

/* Slider Styles */
.bil-slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.bil-slider-container input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #e9ecef;
    outline: none;
    -webkit-appearance: none;
}

.bil-slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bil-slider-container input[type="range"]::-webkit-slider-thumb:hover {
    background: #2980b9;
    transform: scale(1.1);
}

.bil-slider-container input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.bil-slider-container input[type="range"]::-moz-range-thumb:hover {
    background: #2980b9;
    transform: scale(1.1);
}

.bil-slider-value {
    font-weight: 600;
    color: #3498db;
    min-width: 50px;
    text-align: center;
}

.bil-input-field input[type="number"] {
    width: 100px;
    text-align: center;
}

/* Expense Toggle */
.bil-expense-toggle {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.bil-expense-toggle label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    color: #2c3e50;
    cursor: pointer;
}

.bil-expense-toggle input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

/* Tooltip Styles */
.bil-tooltip {
    color: #3498db;
    cursor: help;
    font-size: 1.1rem;
    position: relative;
    display: inline-block;
}

.bil-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e50;
    color: #ffffff;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 400;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    max-width: 300px;
    white-space: normal;
    text-align: center;
}

.bil-tooltip:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #2c3e50;
    z-index: 1000;
}

/* Button Styles */
.bil-form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.bil-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-width: 120px;
}

.bil-btn-primary {
    background: #3498db;
    color: #ffffff;
}

.bil-btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.bil-btn-secondary {
    background: #95a5a6;
    color: #ffffff;
}

.bil-btn-secondary:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(149, 165, 166, 0.3);
}

.bil-btn-text {
    background: transparent;
    color: #3498db;
    text-decoration: underline;
    padding: 8px 16px;
    min-width: auto;
}

.bil-btn-text:hover {
    color: #2980b9;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 4px;
}

/* Results Section */
.bil-results-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid #e9ecef;
}

.bil-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.bil-results-header h3 {
    color: #2c3e50;
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
}

/* Results Table */
.bil-results-table {
    overflow-x: auto;
    margin-bottom: 25px;
}

.bil-results-table table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.bil-results-table th,
.bil-results-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.bil-results-table th {
    background: #3498db;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
}

.bil-results-table td {
    color: #2c3e50;
    font-weight: 500;
}

.bil-results-table tr:nth-child(even) {
    background: #f8f9fa;
}

.bil-results-table tr:hover {
    background: #e3f2fd;
}

/* Loss Severity Color Coding */
.bil-results-table tr.low-loss {
    border-left: 4px solid #27ae60;
}

.bil-results-table tr.medium-loss {
    border-left: 4px solid #f39c12;
}

.bil-results-table tr.high-loss {
    border-left: 4px solid #e74c3c;
}

.bil-results-table tr.low-loss:hover {
    background: #d5f4e6;
}

.bil-results-table tr.medium-loss:hover {
    background: #fef9e7;
}

.bil-results-table tr.high-loss:hover {
    background: #fadbd8;
}

/* Calculation Details */
.bil-calculation-details {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.bil-details-content {
    background: #ffffff;
    border-radius: 6px;
    padding: 20px;
    margin-top: 15px;
    border: 1px solid #e9ecef;
    font-size: 0.9rem;
    line-height: 1.6;
}

.bil-details-content h4 {
    color: #2c3e50;
    margin: 0 0 15px 0;
    font-size: 1.1rem;
}

.bil-details-content h5 {
    color: #34495e;
    margin: 20px 0 10px 0;
    font-size: 1rem;
}

.bil-details-content p {
    margin: 0 0 10px 0;
    color: #34495e;
}

.bil-details-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.bil-details-content li {
    margin: 5px 0;
    color: #34495e;
}

.bil-details-content .formula {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    border-left: 4px solid #3498db;
    margin: 15px 0;
}

/* Input Summary */
.bil-input-summary {
    background: #ffffff;
    border-radius: 6px;
    padding: 20px;
    border: 1px solid #e9ecef;
}

.bil-input-summary h4 {
    color: #2c3e50;
    margin: 0 0 15px 0;
    font-size: 1.1rem;
}

.bil-input-summary-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    font-size: 0.9rem;
}

.bil-input-summary-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.bil-input-summary-item:last-child {
    border-bottom: none;
}

.bil-input-summary-label {
    color: #7f8c8d;
    font-weight: 500;
}

.bil-input-summary-value {
    color: #2c3e50;
    font-weight: 600;
}

/* Disclaimer */
.bil-disclaimer {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 25px;
    text-align: center;
}

.bil-disclaimer p {
    margin: 0;
    color: #856404;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* FAQ Section */
.bil-faq-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 25px;
    border: 1px solid #e9ecef;
}

.bil-faq-section h3 {
    color: #2c3e50;
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0 0 25px 0;
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 2px solid #3498db;
}

.bil-faq-content {
    display: block;
}

.bil-faq-category {
    background: #ffffff;
    border-radius: 6px;
    padding: 20px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
}

.bil-faq-category:last-child {
    margin-bottom: 0;
}

.bil-faq-category h4 {
    color: #3498db;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.bil-faq-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.bil-faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.bil-faq-item summary {
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
}

.bil-faq-item summary:hover {
    background: rgba(52, 152, 219, 0.05);
    border-radius: 4px;
    padding: 8px;
    margin: -8px;
}

.bil-faq-item summary::-webkit-details-marker {
    color: #3498db;
    font-size: 1.2em;
    margin-right: 8px;
}

.bil-faq-item summary::-moz-list-bullet {
    color: #3498db;
    font-size: 1.2em;
    margin-right: 8px;
}

.bil-faq-item[open] summary {
    background: rgba(52, 152, 219, 0.1);
    border-radius: 4px;
    padding: 8px;
    margin: -8px;
    border-left: 3px solid #3498db;
}

.bil-faq-item h5 {
    color: #2c3e50;
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
    display: inline;
}

.bil-faq-item p {
    color: #34495e;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 15px 0 0 0;
    padding-left: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .bil-calculator {
        padding: 15px;
        margin: 10px;
    }
    
    .bil-header h2 {
        font-size: 2rem;
    }
    
    .bil-input-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .bil-form-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .bil-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .bil-results-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .bil-results-header button {
        width: 100%;
    }
    
    .bil-input-summary-content {
        grid-template-columns: 1fr;
    }
    
    .bil-faq-category {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .bil-calculator {
        padding: 10px;
        margin: 5px;
    }
    
    .bil-header h2 {
        font-size: 1.8rem;
    }
    
    .bil-form-group {
        padding: 20px 15px;
    }
    
    .bil-input-field input[type="number"],
    .bil-input-field select {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
    
    .bil-results-table {
        font-size: 0.8rem;
    }
    
    .bil-results-table th,
    .bil-results-table td {
        padding: 10px 8px;
    }
    
    .bil-faq-section {
        padding: 20px 15px;
    }
    
    .bil-faq-category {
        padding: 15px 12px;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    .bil-calculator * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .bil-calculator {
        border: 2px solid #000000;
    }
    
    .bil-form-group {
        border: 2px solid #000000;
    }
    
    .bil-btn {
        border: 2px solid #000000;
    }
    
    .bil-faq-category {
        border: 2px solid #000000;
    }
}

/* Focus Styles for Keyboard Navigation */
.bil-btn:focus,
.bil-input-field input:focus,
.bil-input-field select:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .bil-calculator {
        box-shadow: none;
        border: 1px solid #000000;
    }
    
    .bil-form-actions,
    .bil-btn {
        display: none;
    }
    
    .bil-results-section {
        break-inside: avoid;
    }
    
    .bil-faq-section {
        break-inside: avoid;
    }
}
