/* WP Tour Booking - Professional Frontend Styles */

/* Select2 Customization */
.select2-container {
    width: 100% !important;
}

.select2-container--default .select2-selection--single {
    height: 38px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background-color: #ffffff;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 36px;
    padding-left: 12px;
    color: #374151;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
    right: 8px;
}

.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #a5b4fc;
    box-shadow: 0 0 0 3px rgba(165, 180, 252, 0.1);
}

.select2-dropdown {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 4px 8px;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #4f46e5;
    color: white;
}

/* General Styles */
.wptb-tour-list,
.wptb-user-bookings {
    max-width: 100%;
    background: #ffffff82;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin: 2rem auto;
}

/* Available Tours Title */
.wptb-tour-list h2,
.wptb-user-bookings h2,
.wptb-tour-title {
    font-size: 2rem !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    margin-bottom: 1.5rem !important;
    text-align: center !important;
    letter-spacing: -0.025em !important;
}

/* Latest Updated Section */
.wptb-tour-list p.text-sm,
.wptb-latest-updated {
    font-size: 0.875rem !important;
    color: #ffffff !important;
    margin-bottom: 1.5rem !important;
    text-align: center !important;
}

/* Filter by Date */
.wptb-tour-list .mb-6 {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.wptb-tour-list label,
.wptb-booking-date-label {
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    color: #ffffff !important;
    text-align: center !important;
    display: block !important;
}

#tour_date_filter.flatpickr-date-filter {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.875rem;
    width: 100%;
    max-width: 250px;
    background: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#tour_date_filter.flatpickr-date-filter:focus {
    border-color: #A24B9C;
    box-shadow: 0 0 0 3px rgba(162, 75, 156, 0.2);
    outline: none;
}

/* Tour Listing */
.wptb-tour-list #tour_list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    align-items: stretch; /* Ensures all grid items stretch to the same height */
}

.wptb-tour {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%; /* Ensures all cards stretch to the same height in the grid */
}

.wptb-tour:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.wptb-tour img {
    width: 100%;
    height: 300px !important;
    object-fit: cover;
    object-position: center;
    border-bottom: 4px solid #A24B9C;
}

.wptb-tour .p-6 {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.wptb-tour .mt-6 {
    margin-top: auto; /* Pushes the button container to the bottom */
}

.wptb-tour h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
}

.wptb-tour ul {
    margin-bottom: 1.5rem;
}

.wptb-tour ul li {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.6;
}

.wptb-tour ul li strong {
    color: #374151;
}

/* Book Now Button */
.wptb-book-now {
    background: #d627bd !important;
    color: #ffffff !important;
    padding: 0.75rem 1.5rem !important;
    border-radius: 8px !important;
    font-weight: 500 !important;
    font-size: 0.875rem !important;
    transition: background 0.2s ease, transform 0.1s ease !important;
    cursor: pointer !important;
    border: none !important;
    width: 100% !important;
    text-align: center !important;
}

.wptb-book-now:hover {
    background: #c11fb0 !important;
    transform: translateY(-2px) !important;
}

.wptb-book-now:active {
    transform: translateY(0);
}

/* Booking Modal */
#wptb-booking-modal {
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    transition: opacity 0.3s ease-in-out;
}

#wptb-booking-modal:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

#wptb-booking-modal.hidden {
    opacity: 0;
    visibility: hidden;
}

#wptb-booking-modal .bg-white {
    border-radius: 12px;
    padding: 2rem;
    max-width: 90%;
    width: 700px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* Spinner */
#wptb-spinner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

.wptb-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ff69b4; /* Pink color */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Confirmation Modal */
#wptb-confirmation-modal {
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    transition: opacity 0.3s ease-in-out;
}

#wptb-confirmation-modal:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

#wptb-confirmation-modal.hidden {
    opacity: 0;
    visibility: hidden;
}

#wptb-confirmation-modal .bg-white {
    border-radius: 12px;
    padding: 2rem;
    max-width: 90%;
    width: 500px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

#wptb-confirmation-modal h3 {
    font-size: 1.75rem;
    font-weight: 600;
    color: #A24B9C;
    margin-bottom: 1.5rem;
}

#wptb-confirmation-modal p {
    font-size: 1rem;
    color: #374151;
    margin-bottom: 1.5rem;
}

#wptb-confirmation-modal button {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.2s ease, transform 0.1s ease;
}

#wptb-download-pdf {
    background: #A24B9C;
    color: #ffffff;
}

#wptb-download-pdf:hover {
    background: #8b3e87;
    transform: translateY(-2px);
}

#wptb-download-pdf:active {
    transform: translateY(0);
}

#wptb-confirmation-close {
    background: #e5e7eb;
    color: #374151;
}

#wptb-confirmation-close:hover {
    background: #d1d5db;
    transform: translateY(-2px);
}

#wptb-confirmation-close:active {
    transform: translateY(0);
}

/* Modal Form Styles */
#wptb-booking-modal .bg-white {
    background: white;
    border: 1px solid #e5e7eb;
}

#wptb-booking-modal h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f3f4f6;
}

#wptb-booking-form label,
.wptb-modal-label {
    font-weight: 600 !important;
    color: #374151 !important;
    margin-bottom: 0.5rem !important;
    display: block !important;
    font-size: 0.875rem !important;
}

#wptb-booking-form input,
#wptb-booking-form select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: white;
}

#wptb-booking-form input:focus,
#wptb-booking-form select:focus {
    outline: none;
    border-color: #d627bd;
    box-shadow: 0 0 0 3px rgba(214, 39, 189, 0.1);
}

#wptb-booking-form .grid {
    gap: 1rem;
}

/* Modal Buttons */
#wptb-booking-form .flex {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f3f4f6;
}

#wptb-booking-form .flex button {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

#wptb-modal-close {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

#wptb-modal-close:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

#wptb-booking-form button[type="submit"],
.wptb-modal-book-now {
    background: #d627bd !important;
    color: #ffffff !important;
    border: 1px solid #c11fb0 !important;
    padding: 0.75rem 1.5rem !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
}

#wptb-booking-form button[type="submit"]:hover,
.wptb-modal-book-now:hover {
    background: #c11fb0 !important;
    border-color: #b01da3 !important;
}

#wptb-booking-form button[type="submit"]:active {
    transform: translateY(1px);
}

/* User Bookings - Modern Card Design */
.wptb-user-bookings {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

.wptb-user-bookings .bg-gradient-to-br {
    background: linear-gradient(135deg, #faf5ff 0%, #ffffff 50%, #fdf2f8 100%);
}

.wptb-user-bookings .bg-gradient-to-r {
    background: linear-gradient(90deg, #A24B9C 0%, #ec4899 100%);
}

.wptb-user-bookings .shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.wptb-user-bookings .shadow-xl {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.wptb-user-bookings .rounded-2xl {
    border-radius: 1rem;
}

.wptb-user-bookings .rounded-xl {
    border-radius: 0.75rem;
}

.wptb-user-bookings .rounded-full {
    border-radius: 9999px;
}

.wptb-user-bookings .transition-colors {
    transition-property: background-color, border-color, color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.wptb-user-bookings .transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.wptb-user-bookings .duration-200 {
    transition-duration: 200ms;
}

.wptb-user-bookings .hover\:shadow-lg:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.wptb-user-bookings .hover\:from-purple-700:hover {
    background: linear-gradient(90deg, #7c3aed 0%, #be185d 100%);
}

.wptb-user-bookings .hover\:to-pink-700:hover {
    background: linear-gradient(90deg, #7c3aed 0%, #be185d 100%);
}

.wptb-user-bookings .focus\:ring-2:focus {
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.5);
}

.wptb-user-bookings .focus\:ring-purple-500:focus {
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.5);
}

.wptb-user-bookings .focus\:ring-offset-2:focus {
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px rgba(168, 85, 247, 0.5);
}

.wptb-user-bookings .animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Status badges */
.wptb-user-bookings .bg-green-100 {
    background-color: #dcfce7;
}

.wptb-user-bookings .text-green-800 {
    color: #166534;
}

.wptb-user-bookings .bg-orange-100 {
    background-color: #fed7aa;
}

.wptb-user-bookings .text-orange-800 {
    color: #9a3412;
}

.wptb-user-bookings .bg-red-100 {
    background-color: #fee2e2;
}

.wptb-user-bookings .text-red-800 {
    color: #991b1b;
}

.wptb-user-bookings .bg-gray-100 {
    background-color: #f3f4f6;
}

.wptb-user-bookings .text-gray-800 {
    color: #1f2937;
}

/* Icon colors */
.wptb-user-bookings .text-blue-600 {
    color: #2563eb;
}

.wptb-user-bookings .text-green-600 {
    color: #16a34a;
}

.wptb-user-bookings .text-purple-600 {
    color: #9333ea;
}

.wptb-user-bookings .text-gray-400 {
    color: #9ca3af;
}

.wptb-user-bookings .text-gray-500 {
    color: #6b7280;
}

.wptb-user-bookings .text-gray-600 {
    color: #4b5563;
}

.wptb-user-bookings .text-gray-900 {
    color: #111827;
}

/* Background colors */
.wptb-user-bookings .bg-blue-100 {
    background-color: #dbeafe;
}

.wptb-user-bookings .bg-green-100 {
    background-color: #dcfce7;
}

.wptb-user-bookings .bg-purple-100 {
    background-color: #f3e8ff;
}

.wptb-user-bookings .bg-blue-50 {
    background-color: #eff6ff;
}

.wptb-user-bookings .bg-green-50 {
    background-color: #f0fdf4;
}

.wptb-user-bookings .bg-gray-50 {
    background-color: #f9fafb;
}

.wptb-user-bookings .bg-gray-100 {
    background-color: #f3f4f6;
}

/* Text colors for badges */
.wptb-user-bookings .text-blue-700 {
    color: #1d4ed8;
}

.wptb-user-bookings .text-green-700 {
    color: #15803d;
}

.wptb-user-bookings .text-purple-600 {
    color: #9333ea;
}

/* Hover effects */
.wptb-user-bookings .hover\:bg-gray-50:hover {
    background-color: #f9fafb;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .wptb-user-bookings .grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .wptb-user-bookings .md\:grid-cols-3 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
    
    .wptb-user-bookings .md\:grid-cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .wptb-user-bookings .lg\:flex-row {
        flex-direction: column;
    }
    
    .wptb-user-bookings .lg\:items-center {
        align-items: flex-start;
    }
    
    .wptb-user-bookings .lg\:justify-between {
        justify-content: flex-start;
    }
    
    .wptb-user-bookings .lg\:mt-0 {
        margin-top: 1rem;
    }
    
    .wptb-user-bookings .lg\:ml-6 {
        margin-left: 0;
    }
}

/* Flatpickr Calendar */
.flatpickr-calendar {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    padding: 1rem;
}

.flatpickr-day {
    color: #374151;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: #A24B9C;
    border-color: #A24B9C;
    color: #ffffff;
    font-weight: 500;
}

.flatpickr-day:hover {
    background: #f3e8ff;
    border-color: #f3e8ff;
    color: #A24B9C;
}

.flatpickr-day.today {
    border-color: #A24B9C;
    color: #A24B9C;
    font-weight: 600;
}

.flatpickr-monthDropdown-months,
.flatpickr-year {
    color: #1f2937;
    font-weight: 500;
}

.flatpickr-current-month .flatpickr-monthDropdown-months:hover,
.flatpickr-current-month .numInputWrapper:hover {
    background: #f3e8ff;
    color: #A24B9C;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wptb-tour-list,
    .wptb-user-bookings {
        padding: 1.5rem;
    }

    .wptb-tour-list h2,
    .wptb-user-bookings h2 {
        font-size: 1.75rem;
    }

    .wptb-tour-list #tour_list {
        grid-template-columns: 1fr;
    }

    #tour_date_filter.flatpickr-date-filter {
        max-width: 100%;
    }

    .wptb-user-bookings th,
    .wptb-user-bookings td {
        padding: 0.75rem;
        font-size: 0.75rem;
    }

    #wptb-booking-modal .bg-white,
    #wptb-confirmation-modal .bg-white {
        padding: 1.5rem;
        max-width: 95%;
        width: 90%;
    }

    #wptb-booking-form .flex,
    #wptb-confirmation-modal .flex {
        flex-direction: column;
        gap: 1rem;
    }

    #wptb-booking-form .flex button,
    #wptb-confirmation-modal button {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .wptb-user-bookings table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}