/**
 * Drift & Dwells Booking Widget Styles
 * Scoped styles to prevent conflicts with theme CSS
 */

/* Booking trigger button styles */
.ddw-booking-trigger {
    display: inline-block;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
    user-select: none;
    outline: none;
    position: relative;
}

.ddw-booking-trigger:focus {
    box-shadow: 0 0 0 3px rgba(129, 136, 122, 0.3);
}

/* Button style */
.ddw-booking-trigger--button {
    background-color: #ecebe6 !important;
    color: #333 !important;
    padding: 12px 24px;
    border-radius: 8px;
    border: 1px solid #ecebe6 !important;
}

.ddw-booking-trigger--button:hover {
    background-color: #e0ddd6 !important;
    border-color: #e0ddd6 !important;
    color: #333 !important;
    text-decoration: none;
}

.ddw-booking-trigger--button:active {
    background-color: #d4d1c7 !important;
    border-color: #d4d1c7 !important;
    transform: translateY(1px);
}

/* Link style */
.ddw-booking-trigger--link {
    background: transparent;
    color: #81887a;
    padding: 8px 16px;
    border: none;
    text-decoration: underline;
    text-decoration-color: #81887a;
    text-underline-offset: 3px;
}

.ddw-booking-trigger--link:hover {
    color: #6b7366;
    text-decoration-color: #6b7366;
    text-decoration: none;
}

.ddw-booking-trigger--link:active {
    color: #5a6154;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .ddw-booking-trigger--button {
        padding: 14px 28px;
        font-size: 16px;
        min-height: 48px; /* Ensure touch targets are large enough */
    }
    
    .ddw-booking-trigger--link {
        padding: 12px 20px;
        font-size: 16px;
        min-height: 44px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .ddw-booking-trigger--button {
        border-width: 2px;
    }
    
    .ddw-booking-trigger--link {
        text-decoration-thickness: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .ddw-booking-trigger {
        transition: none;
    }
    
    .ddw-booking-trigger:active {
        transform: none;
    }
}

/* Dark mode support (if theme supports it) - DISABLED for popup button */
/* @media (prefers-color-scheme: dark) {
    .ddw-booking-trigger--button {
        background-color: #9ca3af;
        border-color: #9ca3af;
    }
    
    .ddw-booking-trigger--button:hover {
        background-color: #6b7280;
        border-color: #6b7280;
    }
    
    .ddw-booking-trigger--link {
        color: #9ca3af;
        text-decoration-color: #9ca3af;
    }
    
    .ddw-booking-trigger--link:hover {
        color: #d1d5db;
        text-decoration-color: #d1d5db;
    }
} */

/* Print styles */
@media print {
    .ddw-booking-trigger {
        display: none;
    }
}

/* Accessibility improvements */
.ddw-booking-trigger[aria-disabled="true"] {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Focus visible for better keyboard navigation */
.ddw-booking-trigger:focus-visible {
    outline: 2px solid #81887a;
    outline-offset: 2px;
}

/* Ensure proper spacing in various contexts */
.ddw-booking-trigger + .ddw-booking-trigger {
    margin-left: 12px;
}

/* Block editor preview styles */
.ddw-booking-preview {
    text-align: center;
}

.ddw-booking-preview h4 {
    margin: 0 0 16px 0;
    color: #1d2327;
    font-size: 16px;
    font-weight: 600;
}

/* Inline booking form styles - Light Editorial Theme */
.ddw-booking-inline-form {
    background: rgba(255, 255, 255, 0.94) !important;
    border: 1px solid #E9EBED !important;
    border-radius: 16px !important;
    box-shadow: 0 12px 28px rgba(16, 24, 40, 0.08) !important;
    padding: 24px !important;
    margin: 20px 0 !important;
    width: 100% !important;
    max-width: none !important;
}

.ddw-booking-form {
    width: 100%;
}

.ddw-booking-fieldset {
    border: none;
    margin: 0;
    padding: 0;
}

.ddw-booking-legend {
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #1E293B !important;
    margin-bottom: 12px !important;
    padding: 0 !important;
    font-family: inherit !important;
}

.ddw-booking-form-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
}

.ddw-booking-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 140px;
}

.ddw-booking-field--submit {
    flex: 0 0 auto;
    min-width: 160px;
}

.ddw-booking-label {
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #64748B !important;
    margin-bottom: 4px !important;
}

.ddw-booking-input,
.ddw-booking-select {
    padding: 12px 16px !important;
    border: 1px solid #E9EBED !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    transition: all 0.2s ease !important;
    background: #F7F7F5 !important;
    color: #111827 !important;
    width: 100% !important;
    font-family: inherit !important;
    height: 48px !important;
    box-sizing: border-box !important;
}

.ddw-booking-input:focus,
.ddw-booking-select:focus {
    outline: 1px solid #81887A !important;
    border-color: #81887A !important;
    box-shadow: 0 0 0 3px rgba(129, 136, 122, 0.25) !important;
}

.ddw-booking-input:hover,
.ddw-booking-select:hover {
    box-shadow: 0 2px 6px rgba(16, 24, 40, 0.04) !important;
}


.ddw-booking-submit {
    background: #81887A !important;
    color: #FFFFFF !important;
    border: none !important;
    padding: 12px 24px !important;
    border-radius: 24px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    height: 48px !important;
    justify-content: center !important;
    width: 100% !important;
    font-family: inherit !important;
}

.ddw-booking-submit:hover {
    background: #6F766B !important;
}

.ddw-booking-submit:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(129, 136, 122, 0.3);
}

.ddw-booking-submit-arrow {
    font-size: 16px;
    line-height: 1;
}

/* Error states for inline form */
.ddw-booking-input.error,
.ddw-booking-select.error {
    border-color: #B42318;
}

.ddw-booking-error-message {
    color: #B42318;
    font-size: 12px;
    margin-top: 4px;
    line-height: 1.4;
}

/* Responsive inline form */
@media (max-width: 768px) {
    .ddw-booking-inline-form {
        padding: 16px;
        margin: 16px 0;
        border-radius: 12px;
    }
    
    .ddw-booking-form-grid {
        flex-direction: column;
        gap: 16px;
    }
    
    .ddw-booking-field {
        flex: none;
        min-width: auto;
    }
    
    .ddw-booking-field--submit {
        flex: none;
        min-width: auto;
    }
    
    .ddw-booking-legend {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .ddw-booking-submit {
        justify-content: center;
        height: 44px;
        padding: 12px 24px;
        font-size: 16px;
    }
    
    .ddw-booking-input,
    .ddw-booking-select {
        padding: 12px 16px;
        font-size: 16px;
        height: 44px;
    }
    
    .ddw-booking-label {
        font-size: 13px;
    }
}

/* High contrast mode support for inline forms */
@media (prefers-contrast: high) {
    .ddw-booking-inline-form {
        border-width: 2px;
    }
    
    .ddw-booking-input,
    .ddw-booking-select {
        border-width: 2px;
    }
}

/* Dark mode support for inline forms - DISABLED for Light Editorial Theme */
/* @media (prefers-color-scheme: dark) {
    .ddw-booking-inline-form {
        background: #1f2937;
        border-color: #374151;
    }
    
    .ddw-booking-legend {
        color: #f9fafb;
    }
    
    .ddw-booking-label {
        color: #d1d5db;
    }
    
    .ddw-booking-input,
    .ddw-booking-select {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .ddw-booking-input:focus,
    .ddw-booking-select:focus {
        border-color: #9ca3af;
        box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.1);
    }
} */

/* WordPress admin styles */
.wp-admin .ddw-booking-trigger {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.wp-admin .ddw-booking-inline-form {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}
