/* ===================================================
   Kigyosi.hu — Megosztott stílusok
   =================================================== */

:root {
    color-scheme: light;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --bg: #f3f6fb;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #475569;
    --line: #dbe2ee;
    --brand: #2563eb;
    --brand-soft: #dbeafe;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f3f6fb;
    color: var(--text);
    padding-top: 84px;
}

/* ----- Page background ----- */

.page-background {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 1;
}

.page-background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    image-rendering: auto;
    image-rendering: -webkit-optimize-contrast;
}

/* ----- Top bar / header ----- */

.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid rgba(219, 226, 238, 0.9);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0.75rem 1.25rem;
}

.logo {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    line-height: 1.2;
    color: #0f172a;
    text-decoration: none;
}

.logo span {
    color: var(--brand);
}

.top-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.95rem;
}

.top-nav a {
    color: #334155;
    text-decoration: none;
    font-weight: 600;
}

/* ----- Layout ----- */

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 1.25rem;
    position: relative;
    z-index: 1;
}

/* ----- Panel card ----- */

.panel {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
    border-radius: 1rem;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
    padding: 1rem;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.panel.is-hidden {
    display: none;
}

/* ----- Badges / pills ----- */

.group-tag {
    display: inline-block;
    font-size: 0.72rem;
    padding: 0.22rem 0.46rem;
    border-radius: 999px;
    background: #dbeafe;
    color: #1e3a8a;
    font-weight: 700;
    white-space: nowrap;
}

.open-now-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    padding: 0.22rem 0.46rem;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-weight: 700;
    white-space: nowrap;
}

.open-now-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
    flex: 0 0 auto;
    animation: pulse-dot 1.9s ease-in-out infinite;
}

.available-now-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    padding: 0.22rem 0.46rem;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-weight: 700;
    white-space: nowrap;
}

.available-now-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background: #16a34a;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
    flex: 0 0 auto;
    animation: pulse-dot 1.9s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.82); }
}

/* ----- Category chips ----- */

.category-chip {
    font-size: 0.75rem;
    border-radius: 999px;
    padding: 0.2rem 0.48rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
}

.category-chip-icon {
    font-size: 0.82rem;
    line-height: 1;
}

/* ----- Empty state ----- */

.empty-state {
    color: var(--muted);
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 0.75rem;
    padding: 0.95rem;
}

/* ----- Leaflet popup ----- */

.leaflet-popup-content-wrapper {
    border-radius: 0.8rem;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
}

.leaflet-popup.map-popup .leaflet-popup-content {
    margin: 0;
    width: min(290px, 72vw);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.map-popup-card {
    display: block;
    text-decoration: none;
    color: inherit;
}

.map-popup-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
    border-radius: 0.72rem 0.72rem 0 0;
    border-bottom: 1px solid #e2e8f0;
}

.map-popup-body {
    padding: 0.72rem;
    display: grid;
    gap: 0.48rem;
}

.map-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.48rem;
}

.map-popup-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
    color: #0f172a;
}

.map-popup-meta {
    margin: 0;
    font-size: 0.82rem;
    color: #475569;
    line-height: 1.34;
}

.map-popup-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.map-popup-category {
    font-size: 0.72rem;
    border-radius: 999px;
    padding: 0.17rem 0.42rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.26rem;
}

.map-popup-footer {
    display: flex;
    justify-content: flex-end;
}

.map-popup-cta,
.map-popup-cta:visited,
.map-popup-cta:hover,
.map-popup-cta:focus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.68rem 1.2rem;
    border-radius: 0.75rem;
    background: #2563eb;
    color: #ffffff !important;
    border: 0;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    line-height: 1;
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.2);
}

.map-popup-cta:hover {
    background: #1d4ed8;
}

/* ----- Map pins ----- */

.category-pin-wrapper {
    background: transparent;
    border: 0;
}

.category-pin {
    --pin-color: #2563eb;
    width: 24px;
    height: 24px;
    display: block;
    border-radius: 50% 50% 50% 0;
    background: var(--pin-color);
    border: 2px solid #ffffff;
    transform: rotate(-45deg);
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.24);
    position: relative;
}

.category-pin::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #ffffff;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.category-pin.is-current {
    width: 34px;
    height: 34px;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.3);
    border-width: 3px;
}

/* ----- Searchable select (hero + header compact) ----- */

.searchable-select {
    position: relative;
    z-index: 40;
}

.search-input-wrapper {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

.search-input-inner {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}

.search-input-inner input[type="text"] {
    width: 100%;
    padding: 0.88rem 2.2rem 0.88rem 0.95rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.75rem;
    font-size: 1rem;
    background: #fff;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input-inner input[type="text"]:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--brand-soft);
}

.search-clear-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 0;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    cursor: pointer;
    color: #94a3b8;
    font-size: 0.95rem;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: background 0.15s ease, color 0.15s ease;
}

.search-clear-btn.is-visible {
    display: inline-flex;
}

.search-clear-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.search-submit-btn {
    white-space: nowrap;
    flex: 0 0 auto;
    border: 0;
    background: var(--brand);
    color: #ffffff;
    border-radius: 0.75rem;
    padding: 0.88rem 1.25rem;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.search-submit-btn:hover {
    background: #1d4ed8;
}

.search-dropdown {
    position: absolute;
    top: calc(100% + 0.45rem);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #dbe5f2;
    border-radius: 0.75rem;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.14);
    max-height: 300px;
    overflow: auto;
    z-index: 1100;
    display: none;
}

.search-dropdown.open {
    display: block;
}

.dropdown-empty {
    padding: 0.7rem 0.85rem;
    color: #64748b;
    font-size: 0.9rem;
}

.dropdown-group-title {
    font-size: 0.76rem;
    color: #64748b;
    padding: 0.62rem 0.85rem 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.dropdown-item {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 0.62rem 0.85rem;
    font-size: 0.96rem;
    color: #0f172a;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.dropdown-item:hover,
.dropdown-item.active {
    background: #eff6ff;
}

.dropdown-icon {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex: 0 0 auto;
}

.search-help {
    margin: 0.5rem 0 0;
    color: #64748b;
    font-size: 0.86rem;
}

/* ----- Header search (compact, scroll-reveal on index) ----- */

.header-search-wrap {
    flex: 1 1 auto;
    max-width: 420px;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.header-search-wrap.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
}

.header-search-wrap form {
    margin: 0;
}

/* Compact variant of searchable-select */
.searchable-select.compact .search-input-inner input[type="text"] {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.93rem;
    border-color: #dbe2ee;
    background: #f8fafc;
}

.searchable-select.compact .search-input-inner input[type="text"]:focus {
    background: #fff;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

.searchable-select.compact .search-submit-btn {
    padding: 0.5rem 0.9rem;
    font-size: 0.85rem;
    border-radius: 2rem;
}

.searchable-select.compact .search-clear-btn {
    right: 0.4rem;
}

/* ----- Responsive: shared breakpoint ----- */

@media (max-width: 840px) {
    .header {
        flex-wrap: wrap;
    }

    .header-search-wrap {
        order: 3;
        max-width: 100%;
        width: 100%;
    }

    .top-nav {
        width: auto;
    }
}

@media (max-width: 640px) {
    .header-search-wrap {
        display: none;
    }
}
