/* Chat Form CSS - Revamped Optimal UI */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Make the container fit perfectly in its parent (the modal) */
.chat-container {
    width: 100%;
    height: 100%;
    background: #111111; /* Slightly lighter than pure black for better depth */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    border-radius: 12px; /* Match modal border radius */
}

/* --- Header Section --- */
.chat-header {
    padding: 15px 20px;
    background: linear-gradient(to right, #1a1a1a, #222222);
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    flex-shrink: 0;
    z-index: 20;
}

.chat-title {
    color: white;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-title i {
    color: #ff590e;
}

.chat-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #aaa;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: scale(1.05);
}

/* --- Progress Bar (Moved to Top) --- */
.progress-bar-container {
    background: #1a1a1a;
    padding: 0;
    height: 4px;
    width: 100%;
    flex-shrink: 0;
    position: relative;
}

.progress-bar {
    width: 100%;
    height: 100%;
    background: #333;
    border-radius: 0;
    overflow: hidden;
    margin: 0;
    border: none;
    box-shadow: none;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff590e, #ff8a50);
    border-radius: 0 2px 2px 0;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(255, 89, 14, 0.6);
    position: relative;
}

/* Step Indicator Text (Optional overlay or below header) */
.step-indicator {
    font-size: 12px;
    color: #888;
    margin-left: auto;
    margin-right: 15px;
}

/* --- Messages Area --- */
.messages-container {
    flex: 1;
    background: #111111;
    position: relative;
    width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.messages-scroll-wrapper {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    scroll-behavior: smooth;
    /* Custom Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #333 #111;
}

.messages-scroll-wrapper::-webkit-scrollbar {
    width: 6px;
}

.messages-scroll-wrapper::-webkit-scrollbar-track {
    background: #111;
}

.messages-scroll-wrapper::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

.messages {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    padding-bottom: 20px;
}

/* Message Bubbles */
.message {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    width: 100%;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.ai-message {
    justify-content: flex-start;
}

.user-message {
    justify-content: flex-end;
}

.ai-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #ff590e, #ff8a50);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(255, 89, 14, 0.2);
    margin-bottom: 4px;
}

.ai-avatar i {
    color: white;
    font-size: 16px;
}

.message-bubble {
    max-width: 80%;
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.ai-message .message-bubble {
    background: #2a2a2a;
    color: #e0e0e0;
    border-bottom-left-radius: 4px;
}

.user-message .message-bubble {
    background: linear-gradient(135deg, #ff590e, #e64a0a);
    color: white;
    border-bottom-right-radius: 4px;
}

/* --- User Input Options --- */
.response-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
    width: 100%;
    margin-top: 5px;
}

.response-buttons.grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    max-width: 400px;
}

.response-btn {
    background: rgba(255, 89, 14, 0.1);
    color: #ff8a50;
    border: 1px solid #ff590e;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
}

.response-btn:hover {
    background: #ff590e;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 89, 14, 0.3);
}

.response-btn:active {
    transform: translateY(0);
}

/* Form Inputs */
.form-container {
    background: #1f1f1f;
    border-radius: 15px;
    padding: 20px;
    width: 100%;
    max-width: 400px;
    border: 1px solid #333;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #aaa;
    font-size: 13px;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    background: #111;
    border: 1px solid #444;
    border-radius: 8px;
    color: white;
    font-size: 15px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #ff590e;
}

/* Submit Button */
.submit-btn {
    background: linear-gradient(135deg, #ff590e, #e64a0a);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s;
}

.submit-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Typing Indicator */
.typing-indicator {
    background: #2a2a2a;
    padding: 12px 18px;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    display: inline-block;
    margin-bottom: 10px;
}

.typing-dots {
    display: flex;
    gap: 5px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: #888;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* --- Quote Summary Card Styles --- */
.custom-quote-card {
    background: #1f1f1f;
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid #333;
    width: 100%;
    max-width: 450px;
    margin-top: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.quote-header-new {
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
    padding: 20px;
    border-bottom: 1px solid #333;
    text-align: center;
}

.quote-header-new h2 {
    margin: 0;
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.quote-breakdown-new {
    padding: 20px;
    background: #1f1f1f;
}

.breakdown-item-new {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #333;
}

.breakdown-item-new:last-child {
    border-bottom: none;
}

.item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.item-icon {
    width: 32px;
    height: 32px;
    background: rgba(255, 89, 14, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ff590e;
}

.item-icon i, .item-icon svg {
    font-size: 14px;
    width: 16px;
    height: 16px;
}

.breakdown-item-new span {
    color: #e0e0e0;
    font-size: 15px;
}

.item-price {
    font-weight: 600;
    color: #fff;
    font-size: 15px;
}

.total-investment {
    background: #252525;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #333;
}

.total-investment h3 {
    color: #aaa;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
}

.total-price {
    color: #ff590e;
    font-size: 28px;
    font-weight: 700;
}

.trust-factors-row {
    display: flex;
    justify-content: space-between;
    padding: 15px 20px;
    background: #1a1a1a;
    border-top: 1px solid #333;
    gap: 10px;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.trust-icon {
    color: #4caf50;
}

.trust-icon svg, .trust-icon i {
    width: 18px;
    height: 18px;
}

.trust-text {
    display: flex;
    flex-direction: column;
}

.trust-main {
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.trust-sub {
    color: #888;
    font-size: 10px;
}

.book-appointment-new {
    width: 100%;
    background: linear-gradient(135deg, #ff590e, #e64a0a);
    color: white;
    border: none;
    padding: 18px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.book-appointment-new:hover {
    background: linear-gradient(135deg, #ff7030, #ff590e);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 89, 14, 0.4);
}

.satisfaction-guarantee {
    background: #151515;
    color: #aaa;
    text-align: center;
    padding: 10px;
    font-size: 12px;
    border-top: 1px solid #333;
}

.feature-list {
    background: #151515;
    color: #888;
    text-align: center;
    padding: 5px 10px 15px;
    font-size: 11px;
}

/* --- Back Button Styles --- */
.back-button-container {
    width: 100%;
    display: flex;
    justify-content: flex-end;
}

.back-btn {
    background: transparent;
    color: #ff590e;
    border: 1px solid #ff590e;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.back-btn:hover {
    background: rgba(255, 89, 14, 0.1);
    transform: translateX(-2px);
}

.back-btn i {
    font-size: 12px;
}

/* --- Google Places Autocomplete Fix --- */
.pac-container {
    z-index: 99999 !important; /* Ensure it appears above the modal */
    background-color: #1f1f1f;
    border: 1px solid #333;
    font-family: inherit;
    border-radius: 8px;
    margin-top: 5px;
}

.pac-item {
    border-top: 1px solid #333;
    color: #e0e0e0;
    padding: 10px;
    cursor: pointer;
}

.pac-item:hover {
    background-color: #2a2a2a;
}

.pac-item-query {
    color: #fff;
    font-size: 14px;
}

.pac-icon {
    filter: invert(1); /* Make icon visible on dark background */
    opacity: 0.7;
}

/* Quote Message Container */
.quote-message-new {
    width: 100%;
    max-width: 450px;
    margin: 10px auto 0;
    animation: fadeIn 0.3s forwards, slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .chat-header {
        padding: 12px 15px;
        height: 50px;
    }
    
    .chat-title {
        font-size: 16px;
    }
    
    .messages-scroll-wrapper {
        padding: 15px;
    }
    
    .message-bubble {
        max-width: 85%;
        font-size: 14px;
        padding: 12px 15px;
    }
    
    .response-buttons.grid-layout {
        grid-template-columns: 1fr;
    }
    
    .custom-quote-card {
        border-radius: 12px;
    }
    
    .total-price {
        font-size: 24px;
    }
    
    .trust-factors-row {
        padding: 12px;
        gap: 5px;
    }
    
    .trust-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .trust-text {
        align-items: center;
    }
    
    .trust-main {
        font-size: 10px;
    }
}