/**
 * STEP 4 MOBILE REDESIGN
 * Complete redesign of Step 4 (form/options) for mobile
 * Inspired by Step 3 (roof selection) clean design
 * Version: 1.0.0
 */

/* =============================================
   APPLY ONLY TO MOBILE - STEP 4 ONLY
   ============================================= */
@media (max-width: 768px) {

    /* =============================================
       RESET ALL PADDINGS AND MARGINS
       ============================================= */
    .step-4-content,
    .step-4-content *,
    .step-4-active .preventivatore-container,
    .step-4-active .preventivatore-card {
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* Remove all container constraints */
    .step-4-content .container,
    .step-4-content .container-fluid {
        max-width: 100% !important;
        width: 100% !important;
    }

    /* Remove row gaps */
    .step-4-content .row {
        margin: 0 !important;
        gap: 0 !important;
    }

    /* Remove column padding */
    .step-4-content [class*="col-"] {
        padding: 0 !important;
    }

    /* =============================================
       HERO CARD - FULL WIDTH REDESIGN
       ============================================= */
    .step-4-content .savings-hero-card {
        background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 1.5rem 1rem !important;
        box-shadow: none !important;
        border: none !important;
    }

    .step-4-content .hero-card-inner,
    .step-4-content .hero-background-horizontal {
        background: transparent !important;
        padding: 0 !important;
    }

    /* Stack columns vertically on mobile */
    .step-4-content .savings-hero-card .row {
        flex-direction: column !important;
    }

    .step-4-content .savings-hero-card [class*="col-"] {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        padding: 0.75rem 0 !important;
    }

    /* Hero text styling */
    .step-4-content .hero-label,
    .step-4-content .hero-subtitle,
    .step-4-content .metric-label {
        color: rgba(255, 255, 255, 0.9) !important;
        font-size: 0.875rem !important;
    }

    .step-4-content .hero-primary-value,
    .step-4-content .metric-value {
        color: white !important;
        font-weight: 700 !important;
    }

    .step-4-content .hero-primary-value {
        font-size: 2rem !important;
    }

    /* =============================================
       OPTION CARDS - CLEAN FULL WIDTH
       ============================================= */
    .step-4-content .option-card {
        border-radius: 0 !important;
        margin: 0 0 1px 0 !important;
        padding: 1.25rem 1rem !important;
        background: white !important;
        border: none !important;
        border-bottom: 1px solid #e5e7eb !important;
        box-shadow: none !important;
    }

    .step-4-content .option-card:first-of-type {
        border-top: 1px solid #e5e7eb !important;
    }

    .step-4-content .option-card:last-of-type {
        border-bottom: none !important;
    }

    /* Option card hover effect */
    .step-4-content .option-card:active {
        background: #f9fafb !important;
    }

    /* =============================================
       SECTION HEADERS - CLEAN DESIGN
       ============================================= */
    .step-4-content .section-header,
    .step-4-content .d-flex.align-items-center.mb-3 {
        padding: 1rem !important;
        background: #f8fafc !important;
        margin: 0 !important;
        border-bottom: 1px solid #e5e7eb !important;
    }

    .step-4-content .section-title,
    .step-4-content h6 {
        font-size: 0.95rem !important;
        font-weight: 600 !important;
        margin: 0 !important;
    }

    /* =============================================
       FORM ELEMENTS - CONSISTENT SPACING
       ============================================= */
    .step-4-content input,
    .step-4-content select,
    .step-4-content textarea,
    .step-4-content button:not(.form-check-input) {
        padding: 0.75rem 1rem !important;
        border-radius: 8px !important;
    }

    .step-4-content .btn {
        margin: 1rem !important;
        width: calc(100% - 2rem) !important;
    }

    /* =============================================
       SUMMARY SECTIONS - CLEAN CARDS
       ============================================= */
    .step-4-content .summary-card,
    .step-4-content .financing-card {
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 1.25rem 1rem !important;
        border-bottom: 1px solid #e5e7eb !important;
    }

    /* =============================================
       PANEL MAP CONTAINER - FULL WIDTH
       ============================================= */
    .step-4-content .panel-map-container {
        margin: 0 !important;
        padding: 0 !important;
    }

    .step-4-content #panel-overlay-map {
        border-radius: 0 !important;
        width: 100% !important;
    }

    /* =============================================
       SOLAR CONFIGURATOR - CLEAN LAYOUT
       ============================================= */
    .step-4-content .solar-configurator-full {
        padding: 0 !important;
        margin: 0 !important;
    }

    .step-4-content #analysis-results-section,
    .step-4-content #analysis-results-content {
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
    }

    /* =============================================
       DIVIDERS - CLEAN SEPARATION
       ============================================= */
    .step-4-content .mb-4,
    .step-4-content .mb-3 {
        margin-bottom: 0 !important;
    }

    /* Add spacing only where needed */
    .step-4-content .savings-hero-card {
        margin-bottom: 0 !important;
    }

    /* =============================================
       CHARTS AND GRAPHS - RESPONSIVE
       ============================================= */
    .step-4-content canvas,
    .step-4-content .chart-container {
        padding: 1rem !important;
    }

    /* =============================================
       ACCORDIONS - CLEAN DESIGN
       ============================================= */
    .step-4-content .accordion-item {
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
    }

    .step-4-content .accordion-button {
        padding: 1rem !important;
    }

    /* =============================================
       BADGES AND TAGS - PROPER SPACING
       ============================================= */
    .step-4-content .badge {
        margin: 0.25rem !important;
    }

    /* =============================================
       RESTORE NECESSARY INTERNAL PADDING
       ============================================= */
    .step-4-content .d-flex,
    .step-4-content .flex {
        gap: 0.75rem !important;
    }

    .step-4-content p {
        padding: 0 !important;
        margin: 0.5rem 0 !important;
    }

    .step-4-content small {
        padding: 0 !important;
    }

    /* Icons - restore spacing */
    .step-4-content i {
        margin-right: 0.5rem !important;
    }

    /* =============================================
       TYPOGRAPHY - MOBILE OPTIMIZED
       ============================================= */
    .step-4-content h1 { font-size: 1.75rem !important; }
    .step-4-content h2 { font-size: 1.5rem !important; }
    .step-4-content h3 { font-size: 1.25rem !important; }
    .step-4-content h4 { font-size: 1.1rem !important; }
    .step-4-content h5 { font-size: 1rem !important; }
    .step-4-content h6 { font-size: 0.95rem !important; }

    /* =============================================
       DARK MODE SUPPORT
       ============================================= */
    @media (prefers-color-scheme: dark) {
        .step-4-content .option-card {
            background: #1f2937 !important;
            border-color: #374151 !important;
        }

        .step-4-content .section-header {
            background: #111827 !important;
            border-color: #374151 !important;
        }

        .step-4-content .option-title,
        .step-4-content .section-title {
            color: #f9fafb !important;
        }
    }
}

/* =============================================
   TABLET SPECIFIC ADJUSTMENTS
   ============================================= */
@media (min-width: 769px) and (max-width: 1024px) {
    .step-4-content .option-card {
        padding: 1.5rem !important;
    }

    .step-4-content .savings-hero-card {
        padding: 2rem 1.5rem !important;
    }
}
