/* Credit Card Bank Search Page Styles */
/* Shared styles for all banks (KBANK, UOB, BBL, Krungsri, SCB, etc.) */
/* Inherits base styles from credit-card-style.css */
/* Version: v1.5 */

/* ========================================
   BREADCRUMB NAVIGATION
   ======================================== */
.breadcrumb {
    background: white;
    padding: 15px 30px;
    font-size: 0.9em;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
}

.breadcrumb a {
    color: #8b5cf6;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: #f472b6;
    text-decoration: underline;
}

/* ========================================
   SEARCH FORM SECTION
   ======================================== */
.search-section {
    background: white;
    padding: 40px 50px;
    margin: 0 !important;
    width: 100%;
    box-sizing: border-box;
    border-bottom: 1px solid #e5e7eb;
}

.search-container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-size: 1.5em;
    font-weight: 600;
    text-align: center;
    color: #1f2937;
    margin-bottom: 20px;
}

.search-description {
    text-align: center;
    margin-bottom: 30px;
    color: #4b5563;
    font-size: 1.1em;
    line-height: 1.8;
}

.search-form {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
    font-size: 1em;
}

.form-group select,
.form-group input {
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1em;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-group select:focus,
.form-group input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.search-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.search-btn {
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.5);
}

.clear-btn {
    background: white;
    color: #6b7280;
    padding: 12px 30px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

/* ========================================
   TYPEAHEAD AUTOCOMPLETE
   ======================================== */
.form-group {
    position: relative;
}

.typeahead-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 0 0 8px 8px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: none;
}

.typeahead-suggestions.active {
    display: block;
}

.typeahead-suggestion-item {
    padding: 12px 15px;
    cursor: pointer;
    transition: background 0.2s ease;
    color: #1f2937;
    font-size: 0.95em;
}

.typeahead-suggestion-item:hover,
.typeahead-suggestion-item.selected {
    background: #f3f4f6;
}

.typeahead-suggestion-item strong {
    color: #8b5cf6;
    font-weight: 600;
}

.typeahead-no-results {
    padding: 12px 15px;
    color: #9ca3af;
    font-size: 0.9em;
    text-align: center;
}

/* ========================================
   MAIN CONTENT LAYOUT (Filter + Results)
   ======================================== */
.lounge-content {
    display: flex;
    gap: 30px;
    padding: 40px 60px;
    background: white;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
}

/* ========================================
   FILTER SIDEBAR (Desktop/Tablet)
   ======================================== */
.filter-sidebar {
    flex: 0 0 280px;
    background: #f9fafb;
    border-radius: 12px;
    padding: 25px;
    position: sticky;
    top: 90px;
    border: 1px solid #e5e7eb;
    align-self: flex-start;
}

.filter-sidebar-header h3 {
    font-size: 1.3em;
    color: #1f2937;
    margin-bottom: 20px;
}

.filter-group {
    margin-bottom: 25px;
}

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

.filter-group-title {
    font-size: 1em;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e5e7eb;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-subgroup {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.filter-subgroup:last-of-type {
    margin-bottom: 10px;
}

.filter-subgroup-title {
    font-size: 0.9em;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-suboptions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.filter-option:hover {
    background: white;
}

.filter-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #8b5cf6;
    flex-shrink: 0;
}

.filter-option > span:first-of-type {
    flex: 1;
    font-size: 0.95em;
    color: #4b5563;
}

.filter-option label {
    cursor: pointer;
    flex: 1;
    font-size: 0.95em;
    color: #4b5563;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-count-badge {
    background: #e5e7eb;
    color: #6b7280;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
    flex-shrink: 0;
    margin-left: auto;
}

/* ========================================
   RESULTS SECTION
   ======================================== */
.results-section {
    flex: 1;
    min-width: 0;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 15px;
}

.results-count {
    font-size: 1.2em;
    color: #1f2937;
    font-weight: 600;
}

.results-count span {
    color: #8b5cf6;
    font-size: 1.3em;
}

.sort-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-container label {
    font-weight: 600;
    color: #1f2937;
}

.sort-container select {
    padding: 10px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1em;
    background: white;
    cursor: pointer;
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

/* ========================================
   LOADING & NO RESULTS
   ======================================== */
.loading-indicator {
    text-align: center;
    padding: 60px 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-indicator p {
    color: #6b7280;
    font-size: 1.1em;
}

.loading-message,
.no-results {
    text-align: center;
    padding: 60px 20px;
    font-size: 1.2em;
    color: #6b7280;
}

.loading-message {
    color: #8b5cf6;
}

.no-results-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.no-results h3 {
    font-size: 1.8em;
    color: #1f2937;
    margin-bottom: 10px;
}

.no-results p {
    font-size: 1.1em;
    color: #6b7280;
}

/* ========================================
   RESULTS CONTAINER
   ======================================== */
.results-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ========================================
   RESULT CARD (3-PART STRUCTURE)
   ======================================== */
.result-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.2);
}

/* Part 1: Image Section */
.result-card-part1 {
    text-align: center;
    padding: 30px 0;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.result-card-image-container {
    max-width: 350px;
    margin: 0 auto 15px;
}

.result-card-image {
    width: 100%;
    height: auto;
    border-radius: 10px;
    object-fit: contain;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.result-card-name {
    font-size: 1.4em;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 10px;
}

.result-card-welcome-offer {
    font-size: 1.3em;
    color: #8b5cf6;
    font-weight: 600;
    background: rgba(139, 92, 246, 0.1);
    padding: 13px 26px;
    border-radius: 10px;
    display: inline-block;
}

/* Part 2: Details Grid */
.result-card-part2 {
    padding: 30px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
}

.benefits-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 15px 25px;
    font-size: 0.95em;
}

.benefit-label {
    font-weight: 600;
    color: #374151;
}

.benefit-value {
    color: #1f2937;
    white-space: pre-line;
}

.benefit-value.highlight {
    color: #8b5cf6;
    font-weight: 600;
}

.benefit-value a {
    color: #8b5cf6;
    text-decoration: underline;
    margin-left: 5px;
}

.benefit-value a:hover {
    color: #6b21a8;
}

.type-badge {
    display: inline-block;
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9em;
}

/* Part 3: Button Section */
.result-card-part3 {
    padding: 30px;
    background: #f9fafb;
}

.result-card-qualification {
    margin-bottom: 20px;
}

.qualification-label-small {
    font-size: 0.85em;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.qualification-value {
    font-size: 1.1em;
    font-weight: 600;
    color: #1f2937;
    white-space: pre-line;
}

.result-card-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 0 10px;
}

.totalclick-count {
    font-size: 0.9em;
    color: #8b5cf6;
    font-weight: 500;
    text-align: center;
    margin-bottom: 0px;
}

.card-disclaimer {
    margin-top: 0px;
    font-size: 0.85em;
    color: #6b7280;
    line-height: 1.6;
    text-align: center;
}

.apply-now-btn,
.see-more-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.apply-now-btn {
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.apply-now-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.5);
}

.see-more-btn {
    background: white;
    color: #8b5cf6;
    border: 2px solid #8b5cf6;
}

.see-more-btn:hover {
    background: #f5f3ff;
}

.result-card-disclaimer {
    font-size: 0.85em;
    color: #9ca3af;
    text-align: center;
    padding: 8px 0;
}

/* ========================================
   PAGINATION
   ======================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
}

.pagination-btn {
    padding: 10px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    background: white;
    color: #374151;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
    border-color: #8b5cf6;
    color: #8b5cf6;
}

.pagination-btn.active {
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    color: white;
    border-color: transparent;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    padding: 10px 20px;
    color: #6b7280;
    font-weight: 500;
}

/* ========================================
   FILTER MOBILE (Sticky Bar + Panel)
   ======================================== */
.filter-mobile-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 70px;
    background: white;
    padding: 15px;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transform: translateY(0);
    transition: transform 0.3s ease;
    box-sizing: border-box;
}

.filter-mobile-bar.visible {
    transform: translateY(0) !important;
}

.filter-mobile-bar-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.filter-toggle-btn-mobile {
    flex: 1;
    padding: 12px 20px;
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    height: 48px;
    box-sizing: border-box;
}

.sort-select-mobile {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #8b5cf6;
    border-radius: 8px;
    font-size: 1em;
    color: #1f2937;
    background: white;
    cursor: pointer;
    font-weight: 600;
    height: 48px;
    box-sizing: border-box;
}

.filter-count {
    background: rgba(255, 255, 255, 0.3);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.9em;
}

.filter-mobile-panel {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 2000;
    overflow-y: auto;
}

.filter-mobile-panel.active {
    display: flex;
    flex-direction: column;
}

.filter-mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.filter-mobile-header h3 {
    font-size: 1.3em;
    color: #1f2937;
}

.filter-mobile-close {
    background: none;
    border: none;
    font-size: 2em;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-mobile-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.filter-mobile-footer {
    padding: 20px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.filter-mobile-apply {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .lounge-content {
        padding: 20px;
        gap: 20px;
    }

    .filter-sidebar {
        flex: 0 0 240px;
        padding: 20px;
    }

    .search-form {
        grid-template-columns: repeat(2, 1fr);
    }

    .results-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
}

/* Mobile (0px - 767px) */
@media (max-width: 767px) {
    .breadcrumb {
        padding: 10px 20px;
        font-size: 0.85em;
    }

    .search-section {
        padding: 30px 20px;
    }

    .search-form {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .search-buttons {
        flex-direction: column;
    }

    .search-btn,
    .clear-btn {
        width: 100%;
        padding: 12px 30px;
        font-size: 1em;
    }

    .lounge-content {
        flex-direction: column;
        padding: 0;
    }

    .filter-sidebar {
        display: none !important;
    }

    .filter-mobile-bar {
        display: block !important;
    }

    .results-section {
        padding: 20px;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .results-count {
        font-size: 1.1em;
    }

    .sort-container {
        width: 100%;
    }

    .sort-container select {
        flex: 1;
    }

    .results-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .result-card-part1 {
        padding: 30px 0;
    }

    .result-card-name {
        font-size: 1.1em;
        margin-bottom: 15px;
    }

    .result-card-part2 {
        padding: 20px;
    }

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

    .benefit-label {
        font-weight: 700;
    }

    .result-card-part3 {
        padding: 30px;
    }

    .result-card-actions {
        gap: 12px;
        padding: 0 15px;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 8px;
    }

    .pagination-btn {
        padding: 8px 12px;
        font-size: 0.85em;
    }

    .pagination-info {
        width: 100%;
        text-align: center;
        font-size: 0.9em;
    }
}

/* ========================================
   LARGE DESKTOP (1440px+)
   ======================================== */
@media (min-width: 1440px) {
    .search-section {
        padding: 50px 80px;
    }

    .section-title {
        font-size: 1.5em;
    }
}

/* ========================================
   EXTRA LARGE DESKTOP (1920px+, 2K, 4K)
   ======================================== */
@media (min-width: 1920px) {
    .search-section {
        padding: 60px 100px;
    }

    .section-title {
        font-size: 1.5em;
    }
}
