/**
 * Signature API Search Styles for Breakdance
 * Form styling removed - only results styling kept
 */

/* Search Criteria Summary Container */
#search-criteria-summary {
    margin-bottom: 2rem;
    width: 100%;
    text-align: center;
}

#search-criteria-summary .search-criteria-summary {
    margin-bottom: 0;
}

.search-criteria-summary h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
    text-align: center;
}

.criteria-list {
    font-size: 0.9rem;
    color: #6c757d;
    line-height: 1.4;
    text-align: center;
}

.criteria-list strong {
    color: #495057;
    font-weight: 600;
}

/* Load More Button */
.load-more-button {
    background: #f5f5f5 !important;
    margin: 2rem auto;
    display: block;
    padding: 1rem;
    border-radius: 4px;
    transition: none !important;
    pointer-events: none !important;
}

.load-more-button:hover {
    background: #f5f5f5 !important;
    pointer-events: none !important;
}

/* Re-enable pointer events on the actual button inside */
.load-more-button .bde-button__button {
    pointer-events: auto !important;
}

.load-more-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.load-more-button.loading {
    position: relative;
    color: transparent;
}

.load-more-button.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}

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

/* Fade-in animation for new results */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.breakdance-result-item {
    animation: fadeInUp 0.6s ease-out;
}

/* Stagger animation for multiple items */
.breakdance-result-item:nth-child(1) { animation-delay: 0.1s; }
.breakdance-result-item:nth-child(2) { animation-delay: 0.2s; }
.breakdance-result-item:nth-child(3) { animation-delay: 0.3s; }
.breakdance-result-item:nth-child(4) { animation-delay: 0.4s; }
.breakdance-result-item:nth-child(5) { animation-delay: 0.5s; }
.breakdance-result-item:nth-child(6) { animation-delay: 0.6s; }
.breakdance-result-item:nth-child(7) { animation-delay: 0.7s; }
.breakdance-result-item:nth-child(8) { animation-delay: 0.8s; }
.breakdance-result-item:nth-child(9) { animation-delay: 0.9s; }
.breakdance-result-item:nth-child(10) { animation-delay: 1.0s; }

/* Infinite Scroll Sentinel */
.infinite-scroll-sentinel {
    height: 20px;
    width: 100%;
    background: transparent;
}

.load-more-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Tab Interface */
.signature-search-tabs {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.search-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e1e5e9;
}

.tab-button {
    background: none;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-button:hover {
    color: #007cba;
}

.tab-button.active {
    color: #007cba;
    border-bottom-color: #007cba;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Override Breakdance Code Block styling */
.bde-code-block.search-results,
#signature-search-results.bde-code-block {
    background: transparent !important;
    border: none !important;
    font-family: inherit !important;
    font-size: inherit !important;
    line-height: inherit !important;
    white-space: normal !important;
    overflow: visible !important;
}

/* Results Grid */
.search-results,
.bde-code-block.search-results,
#signature-search-results {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
    gap: 1.5rem !important;
}

/* Responsive Grid Breakpoints */
@media (max-width: 768px) {
    .search-results,
    .bde-code-block.search-results,
    #signature-search-results {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
}

@media (min-width: 769px) and (max-width: 1200px) {
    .search-results,
    .bde-code-block.search-results,
    #signature-search-results {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.75rem !important;
    }
}

@media (min-width: 1201px) {
    .search-results,
    .bde-code-block.search-results,
    #signature-search-results {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 2rem !important;
    }
}

/* Base Offer Card */
.offer-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.offer-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.offer-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Land tour cards use flex layout */
.tour-card .offer-link {
    display: flex;
}

.offer-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
}

.offer-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Hotel-specific styles */
.hotel-card .offer-image {
    height: 220px;
}

.offer-content {
    padding: 1.5rem;
    position: relative;
}

.supplier-logo {
    position: absolute;
    top: -20px;
    right: 1rem;
    background: white;
    padding: 0.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    max-width: 80px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.supplier-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.offer-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
    line-height: 1.3;
}

.offer-title {
    font-size: 1.1rem;
    color: #007cba;
    font-weight: 600;
    margin-bottom: 1rem;
}

.offer-details {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.offer-details li {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    font-size: 0.9rem;
    color: #666;
}

.offer-details span {
    font-weight: 600;
    color: #333;
}

.offer-id {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #007cba;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Type-specific card styling */
.cruise-card {
    border-left: 4px solid #007cba;
}

.hotel-card {
    border-left: 4px solid #28a745;
}

.tour-card {
    border-left: 4px solid #ffc107;
}

/* Loading States */
.loader {
    text-align: center;
    padding: 2rem;
    font-size: 1.2rem;
    color: #666;
}

.loader::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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

/* Error and No Results States */
.error-message,
.no-results {
    text-align: center;
    padding: 2rem;
    font-size: 1.1rem;
    color: #666;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 1rem 0;
}

.error-message {
    color: #dc3545;
    background: #f8d7da;
}

/* Responsive Design */
@media (max-width: 768px) {
    .search-tabs {
        flex-direction: column;
    }
    
    .tab-button {
        border-bottom: none;
        border-right: 3px solid transparent;
    }
    
    .tab-button.active {
        border-bottom: none;
        border-right-color: #007cba;
    }
    
    .signature-search-container {
        padding: 1rem;
    }
    
    /* Grid responsive styles handled above */
    
    .offer-content {
        padding: 1rem;
    }
    
    .supplier-logo {
        position: static;
        margin-bottom: 1rem;
        max-width: 100px;
    }
}

@media (max-width: 480px) {
    .signature-search-tabs,
    .signature-search-container {
        padding: 0.5rem;
    }
    
    .search-header h2 {
        font-size: 2rem;
    }
    
    .offer-image {
        height: 180px;
    }
    
    .hotel-card .offer-image {
        height: 200px;
    }
}

/* Animation for tab switching */
.tab-content {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Enhanced hover effects for different card types */
.cruise-card:hover {
    border-left-color: #005a87;
}

.hotel-card:hover {
    border-left-color: #1e7e34;
}

.tour-card:hover {
    border-left-color: #e0a800;
}

/* Focus states for accessibility */
.tab-button:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .search-tabs,
    .offer-id {
        display: none;
    }
    
    .offer-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* Loading Overlay for Forms */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 8px;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 0.5rem;
}

.loading-text {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

/* Signature Loading Overlay - Covers the form area */
.signature-loading-overlay {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    animation: fadeInOverlay 0.3s ease-out;
}

/* Initial loading overlay - hidden by default, shown for multi-tab forms */
#initial-loading-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

/* Show initial loading overlay for multi-tab forms */
.signature-search-container[data-multi-tab="true"] #initial-loading-overlay,
.signature-search-container:has(input[id^="auto-search-"]) #initial-loading-overlay {
    display: flex;
    opacity: 1;
}

.signature-loading-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 20px;
}

.signature-loading-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #e3e3e3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.signature-loading-text {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    letter-spacing: 0.5px;
}

@keyframes fadeInOverlay {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Signature Loading Message - Prominent loading indicator */
.signature-loading-message {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
    text-align: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    animation: fadeInUp 0.5s ease-out;
}

.signature-loading-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.signature-loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.signature-loading-text {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Small spinner for redirect loading indicator */
.loading-spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 8px;
}

/* Redirect page loading indicator */
.redirect-loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin: 10px 0;
    font-size: 14px;
    color: #6c757d;
}

.redirect-loading-indicator span {
    margin-left: 8px;
}

/* Enhanced Loading States */
.field-group {
    position: relative;
}

.field-group select.loading {
    opacity: 0.7;
    background: #f5f5f5;
    cursor: not-allowed;
}

.field-group select.loading::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.search-button.loading {
    opacity: 0.7;
    cursor: not-allowed;
    position: relative;
}

.search-button.loading::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Essential functional styles for forms */

/* Skeleton Loading Animation */
@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

/* Simple Loading Indicator */
.signature-loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    margin: 0 auto;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1.5rem;
}

.loading-text {
    color: #666;
    font-size: 1.1rem;
    font-weight: 500;
}

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


/* Duration filter styles removed */

/* Package Inclusions - Default list styling */
.signature-package-inclusions-shortcode ul {
    padding-left: 1.5rem;
    margin-left: 0;
}

.signature-package-inclusions-shortcode li {
    margin-bottom: 0.5rem;
}