/* General Floating Button Styles */
#rcbp-wrapper {
    position: fixed;
    z-index: 9999; /* Ensure buttons are on top */
    font-family: 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
    gap: 10px; /* Space between buttons */
    padding: 15px; /* Padding from the edge of the viewport */
}

/* Positions */
#rcbp-wrapper.rcbp-bottom-right {
    bottom: 0;
    right: 0;
    align-items: flex-end;
}
#rcbp-wrapper.rcbp-bottom-left {
    bottom: 0;
    left: 0;
    align-items: flex-start;
}
#rcbp-wrapper.rcbp-top-right {
    top: 0;
    right: 0;
    align-items: flex-end;
}
#rcbp-wrapper.rcbp-top-left {
    top: 0;
    left: 0;
    align-items: flex-start;
}

.rcbp-button-group {
    display: flex;
    flex-direction: column;
    gap: 10px; /* Consistent spacing */
}

.rcbp-button {
    background-color: #6c5ce7; /* Default callback button color */
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px; /* Rounded corners */
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    cursor: pointer;
    border: none; /* Ensure no default button border */
    white-space: nowrap; /* Prevent text wrap */
}

.rcbp-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.rcbp-button i {
    font-size: 18px;
}

/* Modal Overlay */
.rcbp-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px); /* Slightly blur background */
    z-index: 1000;
}

/* General Modal Styles */
#rcbp-modal, #rcbp-location-modal, #rcbp-quote-modal { /* Added #rcbp-quote-modal */
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10001; /* Higher z-index to ensure modals are always on top of buttons */
    overflow: auto; /* Enable scrolling if content is too large */
}

.rcbp-modal-content {
    background-color: #fff;
    margin: 50px auto; /* Centered, with space from top */
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px; /* Max width for readability */
    position: relative;
    z-index: 1001; /* Above the overlay */
    transform: translateY(20px); /* Initial position for animation */
    opacity: 0; /* Initial opacity for animation */
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

/* Modal content visible state */
#rcbp-modal.rcbp-hidden .rcbp-modal-content,
#rcbp-location-modal.rcbp-hidden .rcbp-modal-content,
#rcbp-quote-modal.rcbp-hidden .rcbp-modal-content { /* Added quote modal */
    transform: translateY(20px);
    opacity: 0;
}

#rcbp-modal.rcbp-visible .rcbp-modal-content,
#rcbp-location-modal.rcbp-visible .rcbp-modal-content,
#rcbp-quote-modal.rcbp-visible .rcbp-modal-content { /* Added quote modal */
    transform: translateY(0);
    opacity: 1;
}

/* Close button */
.rcbp-modal-content #rcbp-close,
.rcbp-modal-content #rcbp-location-close,
.rcbp-modal-content #rcbp-quote-close { /* Added quote modal close */
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}

.rcbp-modal-content #rcbp-close:hover,
.rcbp-modal-content #rcbp-close:focus,
.rcbp-modal-content #rcbp-location-close:hover,
.rcbp-modal-content #rcbp-location-close:focus,
.rcbp-modal-content #rcbp-quote-close:hover, /* Added quote modal close hover */
.rcbp-modal-content #rcbp-quote-close:focus { /* Added quote modal close focus */
    color: #333;
}

.rcbp-modal-content h3 {
    text-align: center;
    color: #333;
    margin-bottom: 25px;
    font-size: 24px;
    font-weight: 700;
}

/* Form Styles */
#rcbp-form, #rcbp-quote-form { /* Added quote form */
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#rcbp-form input[type="text"],
#rcbp-form input[type="email"],
#rcbp-form textarea,
#rcbp-quote-form input[type="text"], /* Target quote form inputs */
#rcbp-quote-form input[type="email"],
#rcbp-quote-form select, /* NEW: Select/Dropdown styling */
#rcbp-quote-form textarea {
    width: calc(100% - 24px); /* Account for padding */
    padding: 12px;
    margin-bottom: 5px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    color: #333;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box; /* Ensure padding/border is included in width */
}

#rcbp-form input:focus,
#rcbp-form textarea:focus,
#rcbp-quote-form input:not([type="file"]):not([type="checkbox"]):focus,
#rcbp-quote-form select:focus, /* NEW: Select/Dropdown focus */
#rcbp-quote-form textarea:focus {
    border-color: #6c5ce7;
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
    outline: none;
}

#rcbp-form textarea,
#rcbp-quote-form textarea {
    resize: vertical;
    min-height: 100px;
}

#rcbp-form button[type="submit"],
#rcbp-quote-form button[type="submit"] { /* Added quote form button */
    background-color: #6c5ce7;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    width: 100%;
    margin-top: 10px;
}

#rcbp-form button[type="submit"]:hover,
#rcbp-quote-form button[type="submit"]:hover { /* Added quote form button hover */
    background-color: #5649bd;
    transform: translateY(-1px);
}

#rcbp-form button[type="submit"]:disabled,
#rcbp-quote-form button[type="submit"]:disabled { /* Added quote form button disabled */
    background-color: #cccccc;
    cursor: not-allowed;
    transform: none;
}

.rcbp-form-message {
    text-align: center;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 8px;
    display: none; /* Hidden by default, shown by JS */
}

.rcbp-form-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.rcbp-form-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.rcbp-modal-footer-text {
    text-align: center;
    font-size: 13px;
    color: #666;
    margin-top: 15px;
}

/* Honeypot field (hidden from users) */
.rcbp-honeypot {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    visibility: hidden !important;
    display: none !important;
}

/* reCAPTCHA styles */
.g-recaptcha {
    margin: 15px 0;
    display: flex;
    justify-content: center;
}

#recaptcha-error, #recaptcha-quote-error { /* Added quote error ID */
    text-align: center;
    margin-top: -10px;
    margin-bottom: 10px;
    font-size: 14px;
}


/* Body class to prevent scrolling when modal is open */
body.rcbp-modal-open {
    overflow: hidden;
    padding-right: var(--scrollbar-width); /* Compensate for scrollbar to prevent layout shift */
}

/* NEW: Quote Form Specific Styles */
.rcbp-service-selection-group {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    background-color: #f9f9f9;
}

.rcbp-service-selection-group label strong {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-size: 15px;
}

/* Checkbox list wrapper for layout consistency */
.rcbp-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.rcbp-service-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
    font-size: 15px;
}

.rcbp-service-option input[type="checkbox"] {
    /* Use default styling, maybe a custom size */
    width: auto !important;
    margin: 0;
    padding: 0;
    box-shadow: none;
    border: 1px solid #ccc;
    cursor: pointer;
}
.rcbp-service-option input[type="checkbox"]:checked {
    border-color: #6c5ce7;
}

.rcbp-service-option label {
    margin: 0;
    cursor: pointer;
}

/* File Upload Group */
.rcbp-file-upload-group {
    position: relative;
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.rcbp-file-upload-group:hover {
    border-color: #6c5ce7;
}

.rcbp-file-upload-group i {
    font-size: 20px;
    color: #6c5ce7;
    margin-right: 5px;
}

.rcbp-file-upload-group label {
    display: block;
    margin: 0;
    font-weight: 600;
    color: #555;
    cursor: pointer;
}

.rcbp-file-input {
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* UPDATED: File Name Display with Status Feedback */
.rcbp-file-name-display {
    text-align: center;
    font-size: 14px;
    color: #444; /* Default color */
    margin-top: -10px;
    margin-bottom: 10px;
    font-weight: 500;
    display: none; /* Hidden by default, shown by JS */
    padding: 5px;
    border-radius: 4px;
}

/* Inherit success/error styling for file display */
.rcbp-file-name-display.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.rcbp-file-name-display.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}


/* Location Modal Specific Styles */
.rcbp-location-content {
    max-width: 700px; /* Wider for maps */
}

.rcbp-location-tabs {
    display: flex;
    flex-wrap: wrap; /* Allow tabs to wrap on smaller screens */
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center; /* Center tabs */
}

.rcbp-tab-button {
    background-color: #f0f0f0;
    color: #555;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.2s ease;
    white-space: nowrap; /* Prevent tab text from wrapping */
}

.rcbp-tab-button:hover {
    background-color: #e0e0e0;
    color: #333;
}

.rcbp-tab-button.rcbp-tab-active {
    background-color: #6c5ce7;
    color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.rcbp-tab-button.rcbp-tab-active:hover {
    background-color: #5649bd;
}

.rcbp-tab-pane {
    display: none; /* Hidden by default, shown by JS */
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    background-color: #f9f9f9;
    animation: fadeIn 0.4s ease-out; /* Smooth transition for content */
}

.rcbp-tab-pane-active {
    display: block;
}

.rcbp-tab-pane h4 {
    color: #6c5ce7;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
}

.rcbp-branch-address, .rcbp-branch-phone {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 15px;
    color: #444;
}

.rcbp-branch-address i, .rcbp-branch-phone i {
    color: #6c5ce7;
    font-size: 18px;
}

.rcbp-branch-phone a {
    color: #0073aa; /* Link color for phone number */
    text-decoration: none;
    transition: color 0.2s ease;
}
.rcbp-branch-phone a:hover {
    color: #005c8d;
    text-decoration: underline;
}

.rcbp-map-container {
    margin-top: 20px;
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden; /* Ensures iframe corners are rounded */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.rcbp-map-container iframe {
    display: block; /* Remove extra space below iframe */
}

.rcbp-map-directions {
    text-align: center;
    margin-top: 15px;
}

.rcbp-directions-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #28a745;
    color: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.rcbp-directions-link:hover {
    background-color: #218838;
    transform: translateY(-1px);
}

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

/* Responsive Adjustments */
@media (max-width: 768px) {
    .rcbp-modal-content {
        width: 95%;
        margin: 20px auto;
        padding: 20px;
    }

    .rcbp-modal-content h3 {
        font-size: 20px;
    }

    /* Adjust the general input size for smaller screens now that intl-tel-input is removed */
    #rcbp-form input[type="text"],
    #rcbp-form input[type="email"],
    #rcbp-form textarea,
    #rcbp-quote-form input[type="text"],
    #rcbp-quote-form input[type="email"],
    #rcbp-quote-form select,
    #rcbp-quote-form textarea {
        font-size: 15px;
        padding: 10px;
    }

    /* Ensure the wrapper doesn't block other elements and has appropriate spacing */
    #rcbp-wrapper {
        padding: 10px; /* Reduce padding on small screens */
    }

    /* Adjust button group direction for mobile if needed, or keep as column */
    .rcbp-button-group {
        flex-direction: column; /* Ensure vertical stack */
    }

    #rcbp-form button[type="submit"],
    #rcbp-quote-form button[type="submit"] {
        font-size: 16px;
        padding: 10px 20px;
    }

    .rcbp-button {
        padding: 10px 15px;
        font-size: 15px;
        gap: 8px;
    }

    .rcbp-button i {
        font-size: 16px;
    }

    .rcbp-location-tabs {
        flex-direction: column; /* Stack tabs vertically on small screens */
        align-items: stretch; /* Stretch tabs to full width */
    }

    .rcbp-tab-button {
        width: 100%;
        text-align: center;
    }
}