/**
 * MTH Hotel Search - Frontend Styles
 * Self-contained, theme-independent styling
 */

/* CSS Variables */
.mth-hotel-search-container {
    --mth-primary-color: #667eea;
    --mth-secondary-color: #764ba2;
    --mth-success-color: #48bb78;
    --mth-danger-color: #f56565;
    --mth-warning-color: #ed8936;
    --mth-info-color: #4299e1;
    --mth-light-gray: #f7fafc;
    --mth-dark-gray: #2d3748;
    --mth-border-color: #e2e8f0;
    --mth-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --mth-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Container */
.mth-hotel-search-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--mth-dark-gray);
    box-sizing: border-box;
    margin: 20px auto;           /* auto for horizontal centering */
    max-width: 1340px;           /* match theme's max-width (1300px + 2*20px padding) */
    padding: 0 20px;             /* side padding for mobile */
    width: 100%;                 /* ensure full width up to max */
}

.mth-hotel-search-container *,
.mth-hotel-search-container *::before,
.mth-hotel-search-container *::after {
    box-sizing: border-box;
}

/* Search Section */
.mth-search-section {
    background: white;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--mth-border-color);
}

/* Examples */
.mth-examples {
    /* No additional box styling - uses parent .mth-search-section */
}

.mth-examples h4 {
    margin: 0 0 0.5rem 0 !important;
    color: var(--mth-dark-gray);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.mth-examples h4 small {
    font-weight: normal;
    opacity: 0.7;
    font-size: 0.8rem;
}

.mth-example-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.mth-example-query {
    background: var(--mth-light-gray);
    border: none;
    border-radius: 16px;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
}

.mth-example-query:hover {
    background: var(--mth-primary-color);
    color: white;
}

/* Combined Filter Section */
.mth-filter-section {
    background: white;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--mth-border-color);
    margin-bottom: 1.5rem;
}

.mth-filter-section h4 {
    margin: 0 0 0.5rem 0 !important;
    color: var(--mth-dark-gray);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.mth-filter-section h4 small {
    font-weight: normal;
    opacity: 0.7;
    font-size: 0.8rem;
}

.mth-filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.mth-filter-tag {
    padding: 0.4rem 0.8rem;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.mth-filter-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mth-filter-tag:active {
    transform: translateY(0);
}

.mth-filter-applied {
    background: #c6f6d5;
    border-color: var(--mth-success-color);
    color: var(--mth-success-color);
}

.mth-filter-applied:hover {
    background: #9ae6b4;
    border-width: 2px;
}

.mth-filter-applied::after {
    content: ' ✕';
    opacity: 0;
    transition: opacity 0.2s;
}

.mth-filter-applied:hover::after {
    opacity: 1;
}

.mth-filter-excluded {
    background: #fed7d7;
    border-color: var(--mth-danger-color);
    color: var(--mth-danger-color);
}

.mth-filter-excluded:hover {
    background: #feb2b2;
    border-width: 2px;
}

.mth-filter-excluded::after {
    content: ' ✓';
    opacity: 0;
    transition: opacity 0.2s;
}

.mth-filter-excluded:hover::after {
    opacity: 1;
}

/* Filter Add Button */
.mth-filter-add-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px dashed var(--mth-border-color);
    background: white;
    color: #718096;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.mth-filter-add-btn:hover {
    border-color: var(--mth-primary-color);
    color: var(--mth-primary-color);
    background: #f0f4ff;
    transform: scale(1.1);
}

.mth-filter-add-btn:active {
    transform: scale(1);
}

/* Share Button */
.mth-filter-share-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px dashed var(--mth-border-color);
    background: white;
    color: #718096;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: relative;
}

.mth-filter-share-btn:hover {
    border-color: var(--mth-info-color);
    color: var(--mth-info-color);
    background: #ebf8ff;
    transform: scale(1.1);
}

.mth-filter-share-btn:active {
    transform: scale(1);
}

/* Share Tooltip */
.mth-share-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--mth-dark-gray);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 1001;
}

.mth-share-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--mth-dark-gray);
}

.mth-share-tooltip-visible {
    opacity: 1;
}

/* Filter Dropdown */
.mth-filter-tags {
    position: relative;
}

.mth-filter-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    max-width: 500px;
    max-height: 400px;
    background: white;
    border: 1px solid var(--mth-border-color);
    border-radius: 12px;
    box-shadow: var(--mth-shadow-lg);
    z-index: 1000;
    overflow: hidden;
}

.mth-filter-dropdown-open {
    display: block;
}

.mth-filter-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--mth-border-color);
    background: var(--mth-light-gray);
    font-weight: 600;
    font-size: 0.9rem;
}

.mth-filter-dropdown-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #718096;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.mth-filter-dropdown-close:hover {
    background: #e2e8f0;
    color: var(--mth-dark-gray);
}

.mth-filter-dropdown-content {
    max-height: 340px;
    overflow-y: auto;
    padding: 0.5rem;
}

.mth-filter-dropdown-empty {
    padding: 1.5rem;
    text-align: center;
    color: #718096;
    font-style: italic;
}

/* Filter Category Groups */
.mth-filter-category {
    margin-bottom: 0.75rem;
}

.mth-filter-category:last-child {
    margin-bottom: 0;
}

.mth-filter-category-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.5rem;
    margin-bottom: 0.25rem;
}

.mth-filter-category-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

/* Individual Filter Items */
.mth-filter-item {
    padding: 0.375rem 0.75rem;
    border-radius: 16px;
    border: 1px solid var(--mth-border-color);
    background: white;
    color: var(--mth-dark-gray);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mth-filter-item:hover {
    border-color: var(--mth-success-color);
    background: #c6f6d5;
    color: var(--mth-success-color);
}

.mth-filter-item:active {
    transform: scale(0.95);
}

/* Mobile Responsive - Bottom Sheet */
@media (max-width: 640px) {
    .mth-filter-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        max-width: none;
        max-height: 70vh;
        border-radius: 16px 16px 0 0;
        border-bottom: none;
    }

    .mth-filter-dropdown-header {
        padding: 1rem;
    }

    .mth-filter-dropdown-content {
        max-height: calc(70vh - 60px);
        padding: 1rem;
    }

    .mth-filter-category-items {
        gap: 0.5rem;
    }

    .mth-filter-item {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

.mth-no-filters {
    color: #718096;
    font-style: italic;
    font-size: 0.9rem;
}

/* Results Heading */
.mth-results-heading {
    margin: 0 0 1.5rem 0;
    color: var(--mth-dark-gray);
    font-size: 1.5rem;
}

/* Hotel teaser card styles are provided by the theme (_hotel-teaser-multi.scss) */
/* Plugin only needs placeholder styling for images without a source */
.mth-no-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--mth-light-gray);
    color: #718096;
    font-size: 1.2rem;
}

/* Category Profile Links (plugin-specific styling) */
.mth-category-profile-link {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid var(--mth-primary-color);
    transition: all 0.2s ease;
    font-weight: 700;
}

.mth-category-profile-link:hover {
    color: var(--mth-secondary-color);
    border-bottom-color: var(--mth-secondary-color);
}

/* Load More */
.mth-load-more-container {
    text-align: center;
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--mth-light-gray);
    border-radius: 12px;
}

.mth-results-counter {
    margin-top: 1rem;
    color: #718096;
    font-size: 0.9rem;
}

/* Loading */
.mth-loading {
    text-align: center;
    padding: 3rem;
    color: #718096;
}

.mth-loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--mth-primary-color);
    border-radius: 50%;
    animation: mth-spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* No Results */
.mth-no-results {
    text-align: center;
    padding: 3rem;
    color: #718096;
}

.mth-no-results-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.mth-no-results h3 {
    margin: 0 0 0.5rem 0;
    color: var(--mth-dark-gray);
}

/* Error Message */
.mth-error-message {
    padding: 1rem;
    border-radius: 8px;
    background: #fed7d7;
    color: var(--mth-danger-color);
    border: 1px solid var(--mth-danger-color);
    margin: 1rem 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mth-search-section {
        padding: 1rem;
    }

    .mth-example-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 768px) {
    .mth-hotel-search-container {
        max-width: 1380px;       /* match theme's desktop max-width (1300px + 2*40px padding) */
        padding: 0 40px;         /* larger side padding for desktop */
    }
}
