/* Gray, Black and White Color Scheme */
:root {
    --brand-light-green: #666666;
    --brand-light-gray: #f5f5f5;
    --brand-white: #ffffff;
    --brand-black: #000000;
    --text-primary: #333333;
    --text-secondary: #555555;
    --text-dark: #333333;
    --border-light: #ddd;
    --success-green: #666666;
    --warning-orange: #666666;
    --info-blue: #666666;
    --game-card: #ffffff;
    --game-shadow: rgba(0, 0, 0, 0.05);
}

/* Four-Color Smooth Experience */
body {
    font-family: 'Inter', sans-serif;
    background: var(--brand-white);
    color: var(--text-dark);
    min-height: 100vh;
    transition: all 0.3s ease;
}

h1, h2, h3, h4, h5, h6, .btn, .card-header {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
}

/* Gray, Black and White Bootstrap Overrides */
:root {
    --bs-primary: #f8f9fa;
    --bs-primary-rgb: 248, 249, 250;
    --bs-secondary: #f5f5f5;
    --bs-secondary-rgb: 245, 245, 245;
    --bs-success: #666666;
    --bs-dark: #333333;
    --bs-light: #f5f5f5;
    --bs-info: #f8f9fa;
    --bs-warning: #f8f9fa;
}

/* Progress Bar - Removed */

/* Map Styles */
#map {
    width: 100%;
    height: 450px;
    border-radius: 4px;
}

/* Google Places Autocomplete Styles */
.pac-container {
    background-color: #fff;
    z-index: 9999 !important;
    border-radius: 4px;
    border: 1px solid #ccc;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    margin-top: 2px;
    min-width: 300px;
    max-width: 90vw;
}

.pac-item {
    border-top: 1px solid #e6e6e6;
    cursor: pointer;
    line-height: 30px;
    padding: 10px;
    text-overflow: ellipsis;
    overflow: hidden;
}

.pac-item:hover {
    background-color: #fafafa;
}

.pac-item-selected,
.pac-item-selected:hover {
    background-color: #f0f0f0;
}

.pac-matched {
    font-weight: bold;
    color: var(--brand-green);
}

.pac-item-query {
    color: black;
    font-size: 16px;
}

/* Make sure address input doesn't get covered */
#address {
    position: relative;
    z-index: 10;
}

/* Mobile-friendly mulch map styles */
#mulchMapContainer {
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Touch-friendly button styles for mobile mulch interface */
.map-controls .btn {
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    min-height: 44px; /* iOS recommended touch target size */
    border-radius: 8px;
    transition: all 0.2s ease;
}

.map-controls .btn:active {
    transform: scale(0.98);
    background-color: rgba(130, 181, 19, 0.1);
}

/* Input and Form Styles - White Backgrounds */
.form-control, .form-select {
    background-color: white !important;
    border: 1px solid #ddd !important;
    color: #333 !important;
}

.form-control:focus, .form-select:focus {
    background-color: white !important;
    border-color: #666 !important;
    box-shadow: 0 0 0 0.2rem rgba(102, 102, 102, 0.25) !important;
}

.form-control::placeholder {
    color: #999 !important;
}

/* Card and container backgrounds */
.card {
    background-color: white !important;
}

.card-body {
    background-color: white !important;
}

/* Button Styles - White backgrounds with borders */
.btn {
    background-color: white !important;
    border-width: 2px !important;
    border-style: solid !important;
    transition: all 0.3s ease;
}

.btn-primary {
    color: #333 !important;
    border-color: #333 !important;
    background-color: white !important;
}

.btn-primary:hover {
    background-color: #f0f0f0 !important;
    border-color: #000 !important;
    color: #000 !important;
}

.btn-secondary {
    background-color: white !important;
    border: 2px solid #666 !important;
    color: #333 !important;
}

.btn-secondary:hover {
    background-color: #f0f0f0 !important;
    border-color: #333 !important;
}

.btn-success {
    background-color: white !important;
    border: 2px solid #84c441 !important;
    color: #333 !important;
}

.btn-success:hover {
    background-color: #f0f0f0 !important;
    border-color: #6ea230 !important;
}

/* Brand Alert Styles */
.alert-info {
    background-color: rgba(130, 181, 19, 0.1) !important;
    border-color: var(--brand-green) !important;
    color: var(--brand-gray) !important;
}

.alert-success {
    background-color: rgba(130, 181, 19, 0.15) !important;
    border-color: var(--brand-green) !important;
    color: var(--brand-gray) !important;
}

/* Brand Text Colors */
.text-success {
    color: var(--brand-green) !important;
}

.text-primary {
    color: var(--brand-green) !important;
}

/* Budget Tier Card Styling */
.budget-tier-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.budget-tier-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(130, 181, 19, 0.2);
}

.budget-tier-card .display-6 {
    color: var(--brand-green) !important;
}

/* Logo Styling */
.logo-container img {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

/* Mobile-First Performance & UX Optimizations */
@media (max-width: 768px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .card {
        margin-bottom: 1rem;
        border-radius: 12px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        min-height: 48px;
        font-size: 16px;
        font-weight: 600;
        border-radius: 8px;
        padding: 12px 20px;
    }
    
    .form-control {
        min-height: 48px;
        font-size: 16px;
        border-radius: 8px;
        padding: 12px 16px;
    }
    
    .form-select {
        min-height: 48px;
        font-size: 16px;
        border-radius: 8px;
        padding: 12px 16px;
    }
    
    /* Larger touch targets for mobile */
    .budget-tier-card {
        margin-bottom: 1rem;
        min-height: 120px;
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    .budget-tier-card:active {
        transform: scale(0.98);
    }
    
    /* Mobile typography adjustments */
    h1 {
        font-size: 1.8rem !important;
        line-height: 1.3;
    }
    
    .display-5 {
        font-size: 1.8rem !important;
    }
    
    .h5 {
        font-size: 1rem !important;
    }
    
    /* Mobile map improvements */
    #map, #roofMap, #landscapeMap {
        height: 300px !important;
        border-radius: 12px;
    }
    
    /* Mobile alert styling */
    .alert {
        font-size: 14px;
        padding: 12px;
        border-radius: 8px;
    }
    
    /* Ensure guidance popups stay visible and positioned correctly on mobile */
    #landscapeGuidance, #smartTips {
        position: sticky !important;
        top: 10px !important;
        z-index: 9999 !important;
        margin-bottom: 15px !important;
        box-shadow: 0 4px 20px rgba(0,0,0,0.2) !important;
    }
    
    /* Prevent form submission getting stuck on mobile */
    .btn-primary, .btn-lg {
        width: 100% !important;
        position: relative !important;
        z-index: 100 !important;
        margin-top: 20px !important;
    }
    
    /* Mobile scroll behavior improvements */
    body {
        scroll-behavior: smooth !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    /* Ensure submit buttons are always accessible */
    #nextButtonContainer {
        position: sticky !important;
        bottom: 20px !important;
        z-index: 1000 !important;
        background: white !important;
        padding: 15px !important;
        border-top: 1px solid #dee2e6 !important;
        margin: 20px -15px -15px -15px !important;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1) !important;
    }
    
    /* Logo scaling for mobile */
    .logo-container img {
        height: 36px !important;
        margin-right: 10px !important;
    }
    
    /* Mobile form improvements */
    .row .col-md-6 {
        margin-bottom: 1rem;
    }
    
    /* Sticky footer for mobile booking */
    .mobile-booking-footer {
        position: sticky;
        bottom: 0;
        background: white;
        padding: 15px;
        border-top: 1px solid #dee2e6;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        z-index: 100;
    }
}

/* Performance improvements for all devices */
.lazy-load {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lazy-load.loaded {
    opacity: 1;
}

/* Touch improvements */
@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        transform: none;
    }
    
    .card:hover {
        transform: none;
    }
    
    .budget-tier-card:hover {
        transform: none;
    }
}

/* Improve mobile button spacing */
@media (max-width: 768px) {
    .map-controls .row {
        margin-bottom: 0.5rem;
    }
    
    .map-controls .btn {
        margin-bottom: 8px;
        font-size: 13px;
        padding: 10px 12px;
    }
    
    #mulchMapContainer {
        height: 350px !important;
        min-height: 300px !important;
    }
    
    /* Make table more mobile friendly */
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .table th, .table td {
        padding: 0.5rem 0.25rem;
        white-space: nowrap;
    }
    
    /* Stack config inputs on very small screens */
    @media (max-width: 576px) {
        .col-6 {
            margin-bottom: 10px;
        }
    }
}

/* Canvas Output */
canvas#canvasOutput {
    width: 100%;
    border-radius: 4px;
    margin: 0 auto;
    display: none;
}

/* Image Gallery */
.image-gallery img {
    height: 160px;
    object-fit: cover;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
}

.image-gallery img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.image-gallery img.selected-roof {
    border: 3px solid #3255f3;
    box-shadow: 0 0 10px rgba(50, 85, 243, 0.7);
}

.image-gallery p {
    font-size: 0.9rem;
    font-weight: 600;
}

@media (max-width: 768px) {
    .image-gallery img {
        height: 120px;
    }
    
    #map {
        height: 300px;
    }
}

/* Steps Transition */
.card {
    transition: all 0.3s ease-in-out;
}

/* Panel Styling */
.card-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Results Page */
#results .display-5 {
    font-weight: bold;
}

/* Fix for Bootstrap Icons */
.bi {
    line-height: 1;
    vertical-align: middle;
}

/* Enhanced Service Level Cards */
.service-level-card {
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.service-level-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(130, 181, 19, 0.15);
}

.service-level-card.border-success {
    border-color: var(--brand-green) !important;
    box-shadow: 0 0 15px rgba(130, 181, 19, 0.3);
}

/* Section Navigation Modal */
.list-group-item:hover {
    background-color: rgba(130, 181, 19, 0.1);
    transform: translateX(5px);
    transition: all 0.2s ease;
}


/* Booking Confirmation Styling */
#bookingConfirmation .display-1 {
    font-size: 4rem;
    animation: checkmark 0.6s ease-in-out;
}

@keyframes checkmark {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* Early Contact Fields Animation */
#earlyContactFields {
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced Summary Page Styling */
#finalSummary .card-body {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

/* Ensure project summary text is always visible */
#finalSummary .card-body,
#finalSummary .card-body *,
#finalSummary span,
#finalSummary strong,
#finalSummary p,
#finalSummary h5,
#finalSummary h6,
#finalSummary small {
    color: #495057 !important;
    background-color: transparent !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Ensure price displays are always visible */
#finalSummary .display-6 {
    color: var(--brand-green) !important;
    font-weight: bold !important;
}

/* Make sure all text content in cards is readable */
#finalSummary .card {
    background-color: #ffffff !important;
}

#finalSummary .card-body {
    color: #495057 !important;
}

/* Rocket Button Styling */
.btn-light[title="Edit Sections"] {
    background: linear-gradient(45deg, #FFD700, #FFA500);
    border: none;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-light[title="Edit Sections"]:hover {
    transform: scale(1.05) rotate(10deg);
    box-shadow: 0 5px 15px rgba(255, 165, 0, 0.4);
}

/* Service Summary Visibility Fix */
.alert-light {
    background-color: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    color: #495057 !important;
    position: relative;
    z-index: 1;
}

.alert-light strong,
.alert-light span {
    color: #495057 !important;
}

/* Clean Four-Color Cards */
.card {
    background-color: var(--brand-white) !important;
    border: 1px solid var(--border-light);
    box-shadow: 0 2px 8px var(--game-shadow);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Continue Button Hover Effect */
.continue-btn:hover {
    background-color: #f8f9fa !important;
    color: var(--text-dark) !important;
}

/* Global Text Visibility Fix - Force all text to be dark */
.card-body, .card-body *, .alert, .alert *, .form-label, .form-check-label, small, .text-muted {
    color: var(--text-dark) !important;
}

.btn, .btn * {
    color: var(--text-dark) !important;
}

/* Specific overrides for headers */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-dark) !important;
}

/* Override Bootstrap text utilities */
.text-muted {
    color: var(--text-secondary) !important;
}

.alert {
    background-color: var(--game-card) !important;
    border: 2px solid var(--border-light);
    color: var(--text-primary) !important;
    border-radius: 8px;
    transition: all 0.3s ease;
}

/* Gaming text colors */
.text-muted {
    color: var(--text-secondary) !important;
}

/* Convert white text to black */
.text-white, .card-header .text-white, h2.text-white {
    color: var(--text-primary) !important;
}

/* Convert navy blue to light gray */
.text-info, .btn-info {
    color: var(--text-secondary) !important;
    background-color: #e9ecef !important;
    border-color: var(--text-secondary) !important;
}

/* Progress bars and detection status styling */
#homeDetectionStatus, #detectionComplete {
    background-color: #ffffff !important;
    border: 2px solid var(--brand-green);
    color: #495057 !important;
}

#homeDetectionStatus .spinner-border,
#detectionComplete .text-success {
    color: var(--brand-green) !important;
}

/* Four-Color Enhanced home detection alert */
#step3 .alert-success {
    background: var(--brand-white) !important;
    border: 3px solid var(--brand-light-green) !important;
    color: var(--text-dark) !important;
    font-weight: 600;
}

#step3 .alert-success strong {
    color: var(--text-dark) !important;
    font-size: 1.2rem;
}

/* Contextual Guidance System Styling */
.guidance-pulse {
    animation: guidancePulse 1.5s infinite;
}

@keyframes guidancePulse {
    0%, 100% { 
        box-shadow: 0 6px 20px rgba(40, 167, 69, 0.25); 
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 8px 30px rgba(40, 167, 69, 0.4);
        transform: scale(1.02);
    }
}

/* Four-Color button highlighting for guidance */
.guidance-highlight-success {
    background-color: var(--brand-light-green) !important;
    border-color: var(--brand-light-green) !important;
    color: var(--text-dark) !important;
    transform: scale(1.05);
    animation: buttonPulse 2s infinite;
}

.guidance-highlight-primary {
    background-color: var(--brand-light-green) !important;
    border-color: var(--brand-light-green) !important;
    color: var(--text-dark) !important;
    transform: scale(1.05);
    animation: buttonPulse 2s infinite;
}

.guidance-highlight-secondary {
    background-color: var(--brand-light-gray) !important;
    border-color: var(--brand-light-gray) !important;
    color: var(--text-dark) !important;
    transform: scale(1.05);
    animation: buttonPulse 2s infinite;
}

@keyframes buttonPulse {
    0%, 100% { box-shadow: 0 4px 12px rgba(var(--bs-primary-rgb), 0.4); }
    50% { box-shadow: 0 6px 20px rgba(var(--bs-primary-rgb), 0.7); }
}

/* Smart tips styling - white background */
#smartTips {
    animation: slideInFromTop 0.5s ease-out;
    background-color: white !important;
    border: 2px solid #333 !important;
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced landscape guidance alerts */
#landscapeGuidance {
    animation: slideInFromLeft 0.4s ease-out;
    border-radius: 12px !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

#landscapeGuidance::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 3s infinite;
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Drawing area color coding */
.landscape-area-good {
    fill-opacity: 0.3 !important;
    stroke-opacity: 0.9 !important;
}

.landscape-area-small {
    fill: #ffc107 !important;
    fill-opacity: 0.25 !important;
    stroke: #ffc107 !important;
    animation: warningPulse 2s infinite;
}

@keyframes warningPulse {
    0%, 100% { fill-opacity: 0.25; }
    50% { fill-opacity: 0.4; }
}

/* Ensure no white elements overlap service details */
.card-body .alert-light {
    background-color: rgba(248, 249, 250, 0.95) !important;
    backdrop-filter: blur(5px);
}

/* Mobile Enhancements for New Features */
@media (max-width: 768px) {
    .service-level-card {
        margin-bottom: 1rem;
        min-height: 200px;
    }
    
    #bookingConfirmation .display-1 {
        font-size: 2.5rem;
    }
    
    .btn-light[title="Edit Sections"] {
        font-size: 0.8rem;
        padding: 0.375rem 0.75rem;
    }
    
    /* Stack pricing cards on mobile */
    .col-md-4 {
        margin-bottom: 1rem;
    }
    
    /* Mobile screenshot optimizations */
    .card {
        /* Ensure cards are visible in screenshots */
        position: relative;
        transform: translateZ(0);
        backface-visibility: hidden;
    }
    
    /* Optimize form sections for mobile screenshots */
    #step3CustomerInfo {
        /* Ensure customer info is clearly captured */
        background: #ffffff;
        border-radius: 8px;
        padding: 15px;
        margin-bottom: 20px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    #step3ServiceQuote {
        /* Ensure service quote is clearly captured */
        background: #f8f9fa;
        border-radius: 8px;
        padding: 15px;
        margin-bottom: 20px;
        border: 1px solid #e9ecef;
    }
    
    /* Mobile-specific input styling for screenshots */
    input[type="text"], 
    input[type="email"], 
    input[type="tel"], 
    select, 
    textarea {
        /* Ensure form values are visible in screenshots */
        color: #333333 !important;
        background-color: #ffffff !important;
        border: 1px solid #ced4da !important;
        -webkit-appearance: none;
        appearance: none;
    }
    
    input[type="checkbox"]:checked + label {
        /* Ensure checked services are visible in screenshots */
        color: #28a745 !important;
        font-weight: 600;
    }
    
    /* Optimize maps for mobile screenshots */
    #map, #landscapeMap {
        /* Optimize map for mobile screenshots */
        position: relative;
        z-index: 1;
        transform: translateZ(0);
        will-change: transform;
    }
    
    .gm-style {
        /* Ensure Google Maps renders properly in screenshots */
        position: relative !important;
        transform: translateZ(0) !important;
        will-change: transform !important;
    }
    
    .gm-style > div {
        /* Fix map tile rendering in mobile screenshots */
        position: relative !important;
    }
    
    /* Prevent fixed elements from interfering with screenshots */
    .pac-container {
        position: absolute !important;
        z-index: 999 !important;
    }
    
}


/* Override all button styles - white background with borders */
button, .btn, input[type="button"], input[type="submit"], 
.btn-primary, .btn-secondary, .btn-success, .btn-danger, 
.btn-warning, .btn-info, .btn-dark, .btn-light {
    background-color: white !important;
    border: 2px solid #333 !important;
    color: #333 !important;
}

button:hover, .btn:hover, input[type="button"]:hover, 
input[type="submit"]:hover, .btn-primary:hover, 
.btn-secondary:hover, .btn-success:hover, .btn-danger:hover,
.btn-warning:hover, .btn-info:hover, .btn-dark:hover, .btn-light:hover {
    background-color: #f0f0f0 !important;
    border-color: #000 !important;
    color: #000 !important;
}
