/**
 * Hot Water Heater Calculator Styles
 * Responsive, accessible, and modern design
 */

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

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

/* Header Styles */
.hwc-header {
    text-align: center;
    margin-bottom: 30px;
}

.hwc-header h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.2;
}

.hwc-intro {
    color: #5a6c7d;
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 0;
}

/* Progress Bar */
.hwc-progress {
    margin-bottom: 40px;
}

.hwc-progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.hwc-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2980b9);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.hwc-progress-text {
    display: block;
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Form Styles */
.hwc-form {
    margin-bottom: 30px;
}

.hwc-step {
    animation: fadeIn 0.3s ease-in-out;
}

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

.hwc-step h2 {
    color: #2c3e50;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 25px;
    text-align: center;
}

/* Fieldset Styles */
.hwc-fieldset {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    background: #f8f9fa;
}

.hwc-fieldset legend {
    color: #495057;
    font-size: 1.2rem;
    font-weight: 600;
    padding: 0 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

/* Form Groups */
.hwc-form-group {
    margin-bottom: 20px;
}

.hwc-label {
    display: block;
    color: #2c3e50;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    cursor: pointer;
}

.hwc-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 1rem;
    background: #ffffff;
    color: #495057;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.hwc-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.hwc-select:hover {
    border-color: #adb5bd;
}

.hwc-help-text {
    color: #6c757d;
    font-size: 0.85rem;
    margin-top: 5px;
    font-style: italic;
}

/* Checkbox Styles */
.hwc-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hwc-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 0;
}

.hwc-checkbox input[type="checkbox"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    accent-color: #3498db;
}

.hwc-checkbox-text {
    color: #495057;
    font-size: 1rem;
    font-weight: 500;
}

/* Button Styles */
.hwc-step-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    gap: 15px;
}

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

.hwc-btn-next,
.hwc-btn-calculate {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #ffffff;
}

.hwc-btn-next:hover,
.hwc-btn-calculate:hover {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.hwc-btn-prev {
    background: #6c757d;
    color: #ffffff;
}

.hwc-btn-prev:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.hwc-btn-pdf {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: #ffffff;
}

.hwc-btn-pdf:hover {
    background: linear-gradient(135deg, #229954, #1e8449);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.hwc-btn-restart {
    background: #f39c12;
    color: #ffffff;
}

.hwc-btn-restart:hover {
    background: #e67e22;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

.hwc-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Results Styles */
.hwc-results {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 30px;
    margin-top: 30px;
    border: 2px solid #e9ecef;
}

.hwc-results h2 {
    color: #2c3e50;
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 25px;
}

.hwc-results-content {
    margin-bottom: 30px;
}

.hwc-result-section {
    background: #ffffff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid #3498db;
}

.hwc-result-section h3 {
    color: #2c3e50;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.hwc-result-list {
    margin: 0;
    padding: 0;
}

.hwc-result-list dt,
.hwc-result-list dd {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
    margin: 0;
}

.hwc-result-list dt:last-child,
.hwc-result-list dd:last-child {
    border-bottom: none;
}

.hwc-result-label {
    font-weight: 600;
    color: #495057;
}

.hwc-result-value {
    font-weight: 700;
    color: #2c3e50;
}

/* Fallback for older browsers that don't support flexbox on dt/dd */
.hwc-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.hwc-result-item:last-child {
    border-bottom: none;
}

.hwc-next-steps-list {
    margin: 0;
    padding-left: 20px;
}

.hwc-next-steps-list li {
    margin-bottom: 8px;
    line-height: 1.5;
    color: #495057;
}

.hwc-next-steps-list li:last-child {
    margin-bottom: 0;
}

.hwc-results-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* Loading Styles */
.hwc-loading {
    text-align: center;
    padding: 40px 20px;
}

.hwc-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e9ecef;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.hwc-loading p {
    color: #6c757d;
    font-size: 1.1rem;
    margin: 0;
}

/* Error Styles */
.hwc-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.hwc-field-error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
}

.hwc-error-message {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 5px;
}

/* Success Styles */
.hwc-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hwc-calculator {
        padding: 15px;
        margin: 10px;
    }
    
    .hwc-header h1 {
        font-size: 2rem;
    }
    
    .hwc-step h2 {
        font-size: 1.5rem;
    }
    
    .hwc-fieldset {
        padding: 20px;
    }
    
    .hwc-step-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .hwc-btn {
        width: 100%;
        min-width: auto;
    }
    
    .hwc-results-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .hwc-results-actions .hwc-btn {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .hwc-calculator {
        padding: 10px;
        margin: 5px;
    }
    
    .hwc-header h1 {
        font-size: 1.8rem;
    }
    
    .hwc-fieldset {
        padding: 15px;
    }
    
    .hwc-select {
        padding: 10px 12px;
    }
    
    .hwc-btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}

/* Accessibility Enhancements */
.hwc-calculator:focus-within {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.hwc-select:focus,
.hwc-btn:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .hwc-calculator {
        border: 2px solid #000000;
    }
    
    .hwc-fieldset {
        border: 2px solid #000000;
    }
    
    .hwc-select {
        border: 2px solid #000000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .hwc-progress-fill,
    .hwc-btn,
    .hwc-select {
        transition: none;
    }
    
    .hwc-spinner {
        animation: none;
    }
    
    .hwc-step {
        animation: none;
    }
} 