/* =========================================
   SEARCH PAGE STYLES
   ========================================= */

/* =========================================
   COMPACT HERO
   ========================================= */

.search-hero {
    padding: 3.5rem 0 2.5rem;
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    position: relative;
    overflow: hidden;
}

.search-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="g" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="%233CB8E6" stroke-width="0.4" opacity="0.08"/></pattern></defs><rect width="100" height="100" fill="url(%23g)"/></svg>');
    pointer-events: none;
}

.search-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 640px;
}

.search-hero-text h1 {
    font-size: 2.4rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 0.6rem;
}

.search-hero-text h1 .highlight {
    color: #3CB8E6;
}

.search-hero-text p {
    font-size: 1rem;
    color: #64748b;
    margin: 0;
    line-height: 1.6;
}

/* =========================================
   FILTER SECTION
   ========================================= */

.search-filter-section {
    padding: 1.5rem 0;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.filter-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    align-items: end;
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.filter-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    display: flex;
    align-items: center;
    gap: 5px;
}

.filter-label i {
    font-size: 0.7rem;
    color: #3CB8E6;
}

.filter-input,
.filter-select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    color: #1e293b;
    font-size: 0.875rem;
    font-family: inherit;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
}

.filter-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: #3CB8E6;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(60, 184, 230, 0.12);
}

.filter-input::placeholder {
    color: #94a3b8;
}

/* Keyword + search button */
.search-input-container {
    display: flex;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    background: #f8fafc;
    transition: all 0.2s ease;
}

.search-input-container:focus-within {
    border-color: #3CB8E6;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(60, 184, 230, 0.12);
}

.search-input-container .filter-input {
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    flex: 1;
    min-width: 0;
}

.search-input-container .filter-input:focus {
    border: none;
    box-shadow: none;
}

.search-btn {
    background: #3CB8E6;
    border: none;
    padding: 0 14px;
    color: #ffffff;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
}

.search-btn:hover {
    background: #29a0d1;
}

/* Filter actions */
.filter-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
}

.btn-nearby {
    background: #3CB8E6;
    color: #ffffff;
    border: none;
    padding: 9px 18px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s ease;
    font-family: inherit;
    letter-spacing: 0.01em;
}

.btn-nearby:hover {
    background: #29a0d1;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(60, 184, 230, 0.3);
}

.btn-clear-filters {
    background: transparent;
    color: #94a3b8;
    border: 1px solid #e2e8f0;
    padding: 9px 16px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-clear-filters:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

/* =========================================
   MAP SECTION
   ========================================= */

.search-map-section {
    padding: 1.5rem 0 0;
    background: #f8fafc;
}

.map-wrapper {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07), 0 0 0 1px rgba(0,0,0,0.04);
}

#map {
    height: 380px !important;
    width: 100% !important;
    display: block;
}

/* =========================================
   RESULTS SECTION
   ========================================= */

.search-results-section {
    padding: 2rem 0 4rem;
    background: #f8fafc;
}

.results-toolbar {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0;
}

.results-count {
    font-size: 1rem;
    font-weight: 700;
    color: #475569;
}

.view-toggle {
    display: flex;
    gap: 4px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 4px;
}

.view-btn {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 7px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.view-btn.active,
.view-btn:hover {
    background: #3CB8E6;
    color: #ffffff;
}

/* =========================================
   BUSINESS CARDS (JS-generated)
   ========================================= */

.results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.results-grid.list-view {
    grid-template-columns: 1fr;
}

.business-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: all 0.22s ease;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.business-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(60, 184, 230, 0.12);
    border-color: rgba(60, 184, 230, 0.35);
}

.business-card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Business Header */
.business-header {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    margin-bottom: 0.875rem;
}

.business-avatar {
    width: 50px;
    height: 50px;
    min-width: 50px;
    border-radius: 13px;
    background: linear-gradient(135deg, #3CB8E6, #29a0d1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #ffffff;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(60, 184, 230, 0.2);
    overflow: hidden;
    position: relative;
}

.business-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
    background-color: #ffffff;
}

.business-info {
    flex: 1;
    min-width: 0;
}

.business-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}

.business-info h3 {
    color: #0f172a;
    font-size: 0.975rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.business-rating-compact {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.78rem;
    font-weight: 700;
    background: #fffbeb;
    color: #92400e;
    padding: 2px 7px;
    border-radius: 6px;
    border: 1px solid #fde68a;
    white-space: nowrap;
    flex-shrink: 0;
}

.business-rating-compact i {
    color: #f59e0b;
    font-size: 0.72rem;
}

.business-meta {
    margin-bottom: 0.3rem;
}

.business-category-badge {
    display: inline-block;
    background: rgba(60, 184, 230, 0.08);
    color: #3CB8E6;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid rgba(60, 184, 230, 0.15);
}

.business-location {
    color: #64748b;
    font-size: 0.8rem;
    display: flex;
    align-items: flex-start;
    gap: 4px;
    line-height: 1.4;
}

.business-location i {
    color: #94a3b8;
    margin-top: 0.15rem;
    flex-shrink: 0;
    font-size: 0.75rem;
}

.business-description {
    color: #64748b;
    font-size: 0.85rem;
    line-height: 1.55;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

/* Card Footer */
.business-footer {
    padding: 0.875rem 1.25rem;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    display: flex;
    gap: 0.625rem;
}

.business-btn {
    padding: 7px 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #475569;
    font-weight: 600;
    font-size: 0.8rem;
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.2s ease;
    cursor: pointer;
    font-family: inherit;
}

.business-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #1e293b;
}

/* Primary action button */
.business-btn.btn-primary {
    background: #3CB8E6;
    border-color: #3CB8E6;
    color: #ffffff;
}

.business-btn.btn-primary:hover {
    background: #29a0d1;
    border-color: #29a0d1;
}

/* Favorite button */
.business-btn.btn-favorite {
    color: #94a3b8;
    font-size: 1.1rem;
    padding: 7px 10px;
    flex: 0 0 auto; /* Ne nyúljon meg */
}

.business-btn.btn-favorite:hover {
    color: #ef4444;
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.business-btn.btn-favorite.active,
.business-btn.btn-favorite .fas.fa-heart {
    color: #ef4444;
}

.business-btn.btn-favorite.active {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

/* =========================================
   STATE CARDS (Loading, Empty, Error)
   ========================================= */

.loading-state,
.no-results,
.error-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #f1f5f9;
}

.loading-state i,
.no-results i,
.error-state i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
    color: #cbd5e1;
}

.loading-state i {
    color: #3CB8E6;
    animation: spin 1s linear infinite;
}

.error-state i {
    color: #fca5a5;
}

.loading-state p,
.no-results p,
.error-state p {
    font-size: 0.925rem;
    color: #94a3b8;
    margin: 0 0 1.25rem;
}

.no-results h3,
.error-state h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 0.4rem;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* =========================================
   PAGINATION
   ========================================= */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-top: 2rem;
}

.pagination-btn,
.page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-family: inherit;
}

.pagination-btn:hover,
.page-btn:hover {
    border-color: #3CB8E6;
    color: #3CB8E6;
    background: rgba(60, 184, 230, 0.05);
}

.pagination-btn.active,
.page-btn.active {
    background: #3CB8E6;
    border-color: #3CB8E6;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(60, 184, 230, 0.25);
}

.pagination-btn:disabled,
.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* =========================================
   HELPERS
   ========================================= */

.text-muted { color: #94a3b8 !important; }
.fst-italic  { font-style: italic !important; }

/* =========================================
   RESPONSIVE
   ========================================= */

@media (max-width: 1200px) {
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 991px) {
    .search-filter-section {
        position: static;
        top: auto;
    }

    .filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-field-keyword {
        grid-column: 1 / -1;
    }
}

@media (max-width: 767px) {
    .search-hero {
        padding: 2.5rem 0 1.75rem;
    }

    .search-hero-text h1 {
        font-size: 1.9rem;
    }

    .filter-card {
        padding: 1rem;
    }

    .filter-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .filter-field-keyword {
        grid-column: auto;
    }

    .filter-actions {
        flex-wrap: wrap;
    }

    .btn-nearby {
        flex: 1;
        justify-content: center;
    }

    #map {
        height: 280px !important;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .results-toolbar {
        flex-direction: row;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .filter-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .btn-nearby,
    .btn-clear-filters {
        width: 100%;
        justify-content: center;
    }

    .business-footer {
        flex-direction: row;
    }

    .pagination {
        flex-wrap: wrap;
    }
}
