/* PaylessWatts v2 - Component Styles */

/* Step Form Components */
.step {
    display: none;
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.3s ease;
}

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

.step h4 {
    color: var(--dark-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

/* Form Validation Styles */
.form-control.is-valid {
    border-color: var(--success-color);
    background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'><path fill='%2328a745' d='m2.3 6.73.94.94 4.94-4.94L7.25.81 3.24 4.82z'/></svg>");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-invalid {
    border-color: var(--danger-color);
    background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'><circle cx='6' cy='6' r='4.5'/><path d='m5.8 4.6 1.4 1.4 1.4-1.4m-2.8 0 1.4 1.4-1.4 1.4'/></svg>");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* Metric Cards */
.metric-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    text-align: center;
}

.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-family: 'Poppins', sans-serif;
}

.metric-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Solar Results Display */
.solar-results {
    margin-top: 2rem;
}

.house-display {
    background: var(--light-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
}

.house-image-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.placeholder-house {
    padding: 3rem;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    color: var(--text-muted);
}

/* Financing Options */
.financing-option {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.financing-option:hover {
    background: white;
    border-color: var(--primary-color);
}

.financing-option.recommended {
    background: rgba(255, 107, 53, 0.05);
    border-color: var(--primary-color);
}

.financing-details {
    font-size: 0.9rem;
}

.financing-details .d-flex {
    margin-bottom: 0.25rem;
}

/* Feature Cards */
.feature-card {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
    border-color: var(--primary-color);
}

.feature-card .feature-icon {
    margin-bottom: 1rem;
}

.feature-card h4 {
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--text-muted);
    line-height: 1.6;
}

/* Alert Components */
.alert {
    border: none;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-light);
}

.alert-primary {
    background: rgba(255, 107, 53, 0.1);
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
}

.alert-success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.alert-warning {
    background: rgba(255, 193, 7, 0.1);
    color: var(--warning-color);
    border-left: 4px solid var(--warning-color);
}

.alert-danger {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
    border-left: 4px solid var(--danger-color);
}

/* Toast Container */
.toast-container {
    z-index: 1090;
}

.toast {
    border-radius: 8px;
    box-shadow: var(--shadow-medium);
}

/* Card Enhancements */
.card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
}

.card-header {
    background: var(--gradient-primary);
    border: none;
    padding: 1.5rem;
}

.card-body {
    padding: 2rem;
}

/* List Group Enhancements */
.list-group-item {
    border: none;
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
}

.list-group-item:last-child {
    border-bottom: none;
}

/* Progress Bar */
.progress {
    height: 8px;
    border-radius: 4px;
    background: var(--border-color);
}

.progress-bar {
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Badge Enhancements */
.badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}

.badge.bg-primary {
    background: var(--gradient-primary) !important;
}

/* Modal Enhancements */
.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: var(--shadow-heavy);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem;
}

.modal-body {
    padding: 2rem;
}

/* Table Enhancements */
.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table th {
    background: var(--light-color);
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    padding: 1rem;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background: rgba(255, 107, 53, 0.05);
}

/* Pagination */
.pagination .page-link {
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin: 0 0.25rem;
}

.pagination .page-link:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.pagination .page-item.active .page-link {
    background: var(--gradient-primary);
    border-color: var(--primary-color);
}

/* Dropdown Enhancements */
.dropdown-menu {
    border: none;
    border-radius: 8px;
    box-shadow: var(--shadow-medium);
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: 6px;
    padding: 0.75rem 1rem;
    transition: var(--transition);
}

.dropdown-item:hover {
    background: rgba(255, 107, 53, 0.1);
    color: var(--primary-color);
}

/* Accordion */
.accordion-item {
    border: 1px solid var(--border-color);
    border-radius: 8px !important;
    margin-bottom: 0.5rem;
}

.accordion-button {
    background: white;
    border: none;
    font-weight: 500;
    padding: 1.25rem 1.5rem;
}

.accordion-button:not(.collapsed) {
    background: rgba(255, 107, 53, 0.05);
    color: var(--primary-color);
}

.accordion-body {
    padding: 1.5rem;
}

/* Tabs */
.nav-tabs {
    border-bottom: 2px solid var(--border-color);
}

.nav-tabs .nav-link {
    border: none;
    padding: 1rem 1.5rem;
    color: var(--text-muted);
    font-weight: 500;
    border-radius: 8px 8px 0 0;
}

.nav-tabs .nav-link:hover {
    color: var(--primary-color);
    background: rgba(255, 107, 53, 0.05);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    background: white;
    border-bottom: 2px solid var(--primary-color);
}

/* Breadcrumb */
.breadcrumb {
    background: none;
    padding: 0;
    margin: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: var(--text-muted);
    font-weight: 600;
}

.breadcrumb-item.active {
    color: var(--primary-color);
}

/* Utilities */
.bg-gradient-light {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.border-radius-lg {
    border-radius: 12px !important;
}

.border-radius-xl {
    border-radius: 16px !important;
}

/* Process Steps */
.process-step {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.process-number {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    box-shadow: var(--shadow-medium);
}

/* Contact Highlights */
.contact-highlight {
    text-align: center;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.contact-highlight:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
}

.contact-highlight h5 {
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

/* Contact Items */
.contact-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

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

.contact-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 107, 53, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hours List */
.hours-list {
    font-size: 0.9rem;
}

/* Warranty Icons */
.warranty-icon {
    margin-bottom: 1rem;
}

/* Team Cards */
.team-card {
    transition: var(--transition);
}

.team-card:hover {
    transform: translateY(-5px);
}

.team-card img {
    object-fit: cover;
    border: 3px solid var(--border-color);
}

/* Service Cards with Images */
.card .object-fit-cover {
    object-fit: cover;
}

/* Badge Enhancements for About Page */
.badge.fs-6 {
    font-size: 0.875rem !important;
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

/* Enhanced Metric Cards for Results */
.metric-card {
    background: white;
    border-radius: 16px;
    padding: 2rem 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
    transition: var(--transition);
    text-align: center;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff6b35, #f7931e);
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 800;
    font-family: 'Poppins', sans-serif;
    line-height: 1.1;
    margin-bottom: 0.75rem;
    color: #2c3e50;
}

.metric-value.text-primary {
    color: #007bff !important;
}

.metric-value.text-info {
    color: #17a2b8 !important;
}

.metric-value.text-warning {
    color: #ffc107 !important;
}

.metric-value.text-success {
    color: #28a745 !important;
}

.metric-label {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    line-height: 1.3;
}

/* Responsive adjustments for metric cards */
@media (max-width: 768px) {
    .metric-card {
        padding: 1.5rem 1rem;
        min-height: 120px;
        margin-bottom: 1rem;
    }
    
    .metric-value {
        font-size: 2rem;
    }
    
    .metric-label {
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .metric-card {
        padding: 1.25rem 0.75rem;
        min-height: 100px;
    }
    
    .metric-value {
        font-size: 1.75rem;
    }
}

/* Financing Options Styling */
.financing-option {
    transition: var(--transition);
    border-radius: 12px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
}

.financing-option:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.financing-option .financing-details {
    font-size: 0.9rem;
}

.financing-option .financing-details > div {
    padding: 0.25rem 0;
    border-bottom: 1px solid #f8f9fa;
}

.financing-option .financing-details > div:last-child {
    border-bottom: none;
}

/* Enhanced financing option cards */
.financing-option h6 {
    color: #2c3e50;
    font-size: 1.1rem;
}

.financing-option .badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.65rem;
}

.financing-option .text-primary {
    color: #007bff !important;
    font-weight: 600;
}

/* Responsive adjustments for financing options */
@media (max-width: 768px) {
    .financing-option {
        margin-bottom: 1rem;
    }
    
    .financing-option .p-4 {
        padding: 1.5rem !important;
    }
}

/* Property Map Container */
#propertyMap {
    border-radius: 0 0 8px 8px;
}

/* Step 6 Specific Styling */
#step6 {
    min-height: auto;
}

#step6 .card-header {
    font-weight: 600;
    border-bottom: 2px solid rgba(255,255,255,0.2);
    padding: 1.25rem 1.5rem;
}

#step6 .card-body {
    padding: 2rem 1.5rem;
}

#step6 .list-group-item {
    padding: 1rem 1.5rem;
    border-color: #f8f9fa;
    font-size: 0.95rem;
}

#step6 .list-group-item:last-child {
    border-bottom-color: transparent;
}

/* Results section spacing */
#estimateResultsContent {
    padding: 1rem 0;
}

#estimateResultsContent .row {
    margin: 0 -15px;
}

#estimateResultsContent .row > [class*="col-"] {
    padding: 0 15px;
}

/* Better spacing for details sections */
#step6 h6.fw-bold {
    color: #2c3e50;
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    #step6 .card-body {
        padding: 1.5rem 1rem;
    }
    
    #step6 .list-group-item {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    #estimateResultsContent {
        padding: 0.5rem 0;
    }
    
    #estimateResultsContent .row {
        margin: 0 -10px;
    }
    
    #estimateResultsContent .row > [class*="col-"] {
        padding: 0 10px;
    }
}

/* Results Animation */
@keyframes resultsFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#estimateResultsContent {
    animation: resultsFadeIn 0.6s ease-out;
}

/* Loading State for Generate Button */
#generateEstimateBtn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

#generateEstimateBtn .fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Appointment Modal Styling */
#appointmentModal .modal-content {
    border-radius: 16px;
    overflow: hidden;
}

#appointmentModal .modal-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    padding: 1.5rem 2rem;
}

#appointmentModal .modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

#appointmentModal .modal-body {
    padding: 2rem;
}

#appointmentModal .bg-light {
    background-color: #f8f9fa !important;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

#appointmentModal .form-label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

#appointmentModal .form-control,
#appointmentModal .form-select {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

#appointmentModal .form-control:focus,
#appointmentModal .form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

#appointmentModal .form-check-input:checked {
    background-color: #007bff;
    border-color: #007bff;
}

#appointmentModal .form-check-label {
    margin-left: 0.5rem;
}

#appointmentModal .form-check-label strong {
    color: #2c3e50;
}

#appointmentModal .invalid-feedback {
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

#appointmentModal .btn {
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

#appointmentModal .btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
}

#appointmentModal .btn-primary:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

#appointmentModal .btn-outline-secondary {
    border: 2px solid #6c757d;
    color: #6c757d;
}

#appointmentModal .btn-outline-secondary:hover {
    background-color: #6c757d;
    transform: translateY(-1px);
}

/* Business hours styling */
#appointmentModal .bg-light h6 {
    color: #007bff;
    font-weight: 700;
    margin-bottom: 1rem;
}

#appointmentModal .bg-light small {
    line-height: 1.6;
    color: #495057;
}

/* What to expect section */
#appointmentModal .list-unstyled li {
    padding: 0.25rem 0;
    color: #495057;
}

#appointmentModal .text-success {
    color: #28a745 !important;
}

/* Responsive adjustments for appointment modal */
@media (max-width: 768px) {
    #appointmentModal .modal-body {
        padding: 1.5rem;
    }
    
    #appointmentModal .modal-header {
        padding: 1.25rem 1.5rem;
    }
    
    #appointmentModal .modal-title {
        font-size: 1.1rem;
    }
}

/* Success alert styling */
.alert-success {
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}

.alert-success .fas {
    color: #28a745;
}

/* Hero Background Gradient */
.bg-gradient-light {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    position: relative;
}

.bg-gradient-light::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="%23e0e0e0" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)" /></svg>');
    opacity: 0.3;
    z-index: 1;
}

.bg-gradient-light > .container {
    position: relative;
    z-index: 2;
}

/* Social Links */
.social-links a {
    transition: var(--transition);
}

.social-links a:hover {
    transform: translateY(-2px);
    color: var(--primary-color) !important;
}

/* Image Hover Effects */
.img-fluid {
    transition: var(--transition);
}

.card:hover .img-fluid {
    transform: scale(1.05);
}

/* Form Enhancements */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(255, 107, 53, 0.15);
}

/* Homepage Address Input Enhancements */
#addressInput {
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

#addressInput:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(255, 107, 53, 0.15);
}

#addressInput.is-valid {
    border-color: var(--success-color);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='m2.3 6.73.72.72L8 2.17l-.72-.72L3.01 5.72l-1.53-1.53-.72.72z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

#analyzeBtn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#analyzeBtn.btn-primary {
    background: var(--gradient-primary);
    border: none;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

#analyzeBtn.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

/* Contact Form Specific */
#contactForm .form-control,
#contactForm .form-select {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

#contactForm .form-label {
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

/* Loading States for Forms */
.form-loading {
    position: relative;
    opacity: 0.7;
    pointer-events: none;
}

.form-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 10;
}

/* Success States */
.form-success {
    background: rgba(40, 167, 69, 0.05);
    border: 2px solid var(--success-color);
    border-radius: 8px;
    padding: 1rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .metric-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .metric-value {
        font-size: 1.5rem;
    }
    
    .feature-card {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .step h4 {
        font-size: 1.25rem;
    }
    
    .contact-highlight {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .process-number {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .badge.fs-6 {
        font-size: 0.75rem !important;
        padding: 0.375rem 0.75rem;
        margin-bottom: 0.5rem;
        display: inline-block;
    }
}