/**
 * GBI Booking Form Styles
 * Beautiful booking request form with Aotea theme colors
 */

/* ===== Form Container ===== */
.gbi-booking-form-container {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin: 30px 0;
}

.gbi-booking-form-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.gbi-booking-form-header h2 {
    color: #1f2937;
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 10px;
}

.gbi-booking-form-header p {
    color: #6b7280;
    font-size: 14px;
    margin: 0;
}

/* ===== Form Fields ===== */
.gbi-form-group {
    margin-bottom: 20px;
}

.gbi-form-label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    font-size: 14px;
}

.gbi-form-label .required {
    color: #dc2626;
    margin-left: 3px;
}

.gbi-form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    color: #1f2937;
    transition: all 0.2s;
    box-sizing: border-box;
}

.gbi-form-control:focus {
    outline: none;
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.gbi-form-control::placeholder {
    color: #9ca3af;
}

.gbi-form-control.error {
    border-color: #dc2626;
}

.gbi-form-control.error:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

textarea.gbi-form-control {
    min-height: 100px;
    resize: vertical;
    font-family: inherit;
}

select.gbi-form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 10px center;
    background-repeat: no-repeat;
    background-size: 20px;
    padding-right: 40px;
    appearance: none;
}

/* ===== Form Row (for side-by-side fields) ===== */
.gbi-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

/* ===== Error Messages ===== */
.gbi-form-error {
    color: #dc2626;
    font-size: 13px;
    margin-top: 5px;
    display: none;
}

.gbi-form-error.show {
    display: block;
}

/* ===== Help Text ===== */
.gbi-form-help {
    font-size: 13px;
    color: #6b7280;
    margin-top: 5px;
}

/* ===== Submit Button ===== */
.gbi-submit-button {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
}

.gbi-submit-button:hover {
    background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.3);
}

.gbi-submit-button:active {
    transform: translateY(0);
}

.gbi-submit-button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.gbi-submit-button.loading {
    padding-right: 50px;
}

.gbi-submit-button .spinner {
    display: none;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: gbi-spin 0.8s linear infinite;
}

.gbi-submit-button.loading .spinner {
    display: block;
}

/* ===== Success/Error Messages ===== */
.gbi-form-message {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}

.gbi-form-message.show {
    display: block;
}

.gbi-form-message.success {
    background: #d1fae5;
    border-left: 4px solid #10b981;
    color: #065f46;
}

.gbi-form-message.error {
    background: #fee2e2;
    border-left: 4px solid #dc2626;
    color: #991b1b;
}

.gbi-form-message p {
    margin: 0;
    font-weight: 600;
}

/* ===== Selected Dates Display ===== */
.gbi-selected-dates-display {
    background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%);
    border: 2px solid #0d9488;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.gbi-dates-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.gbi-date-item {
    text-align: center;
}

.gbi-date-label {
    display: block;
    font-size: 12px;
    color: #047857;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.gbi-date-value {
    display: block;
    font-size: 18px;
    color: #1f2937;
    font-weight: 700;
}

/* ===== Info Boxes ===== */
.gbi-info-box {
    background: #f0f9ff;
    border-left: 4px solid #0284c7;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.gbi-info-box p {
    margin: 0;
    font-size: 14px;
    color: #0c4a6e;
}

.gbi-info-box.warning {
    background: #fef3c7;
    border-left-color: #f59e0b;
}

.gbi-info-box.warning p {
    color: #78350f;
}

/* ===== Referral Source (Hidden Field) ===== */
.gbi-form-group.hidden {
    display: none;
}

/* ===== Privacy Notice ===== */
.gbi-privacy-notice {
    font-size: 12px;
    color: #6b7280;
    text-align: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
}

.gbi-privacy-notice a {
    color: #0d9488;
    text-decoration: none;
}

.gbi-privacy-notice a:hover {
    text-decoration: underline;
}

/* ===== reCAPTCHA Notice ===== */
.gbi-recaptcha-notice {
    font-size: 11px;
    color: #9ca3af;
    text-align: center;
    margin-top: 10px;
    line-height: 1.5;
}

.gbi-recaptcha-notice a {
    color: #6b7280;
    text-decoration: underline;
}

.gbi-recaptcha-notice a:hover {
    color: #0d9488;
}

/* ===== Calendar Integration ===== */
.gbi-calendar-section {
    margin-bottom: 30px;
}

.gbi-calendar-section-header {
    margin-bottom: 15px;
}

.gbi-calendar-section-header h3 {
    color: #1f2937;
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .gbi-booking-form-container {
        padding: 20px;
    }

    .gbi-form-row {
        grid-template-columns: 1fr;
    }

    .gbi-dates-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .gbi-booking-form-header h2 {
        font-size: 20px;
    }

    .gbi-submit-button {
        padding: 14px 20px;
        font-size: 15px;
    }
}

/* ===== Animation for form appearance ===== */
@keyframes gbi-fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gbi-booking-form-container {
    animation: gbi-fadeIn 0.5s ease-out;
}

/* ===== Focus Visible Enhancement ===== */
.gbi-form-control:focus-visible,
.gbi-submit-button:focus-visible {
    outline: 2px solid #0d9488;
    outline-offset: 2px;
}

/* ===== Required Field Indicator ===== */
.gbi-form-label::after {
    content: '';
}

.gbi-form-label.required::after {
    content: ' *';
    color: #dc2626;
}

/* ===== Hide Directories Pro Contact Form ===== */
/* Hide the contact form on single property listings when our booking form is present */
.drts-entity-field-contact_form,
.drts-display-element-contact_form,
.drts-view-entity-contact_form,
[class*="contact_form"],
.drts-entity-field-type-wp_contact_form,
.drts-entity-contact-form,
.drts-field-contact_form {
    display: none !important;
}

/* Hide any headings that say "Contact this business" */
h2:has(+ .drts-entity-field-contact_form),
h3:has(+ .drts-entity-field-contact_form),
.drts-entity-field-label:has(+ .drts-entity-field-contact_form) {
    display: none !important;
}
