/* KudaGo Events Web View - Styles */

:root {
    --primary-color: #e91e63;
    --primary-dark: #c2185b;
    --text-color: #333;
    --text-muted: #666;
    --bg-color: #f5f5f5;
    --card-bg: #fff;
    --border-color: #ddd;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
}

/* Header */
header {
    background: var(--primary-color);
    color: white;
    padding: 1.5rem;
    text-align: center;
}

header h1 {
    font-size: 1.8rem;
    margin-bottom: 0.25rem;
}

header .subtitle {
    opacity: 0.9;
    font-size: 0.9rem;
}

/* Tabs */
.tabs {
    display: flex;
    justify-content: center;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0;
}

.tab {
    padding: 1rem 2rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-muted);
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.tab:hover {
    color: var(--primary-color);
}

.tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 500;
}

.tab-content {
    display: none;
}

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

/* Main */
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

/* Filters */
.filters {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.filter-group select,
.filter-group input[type="text"],
.filter-group input[type="number"],
.filter-group input[type="date"] {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
}

.btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.btn:hover {
    background: var(--primary-dark);
}

/* Filter buttons group - keep Apply & Reset together */
.filter-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Stats */
.stats {
    padding: 0.75rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Events Table */
.events-table-wrapper {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: visible;  /* Changed from hidden to allow image zoom */
}

.events-table {
    width: 100%;
    border-collapse: collapse;
}

.events-table th {
    background: #f8f8f8;
    padding: 0.75rem;
    text-align: left;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.events-table td {
    padding: 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid #eee;
}

.events-table tbody tr:hover {
    background: #fafafa;
}

/* Column widths */
.col-image { width: 90px; }
.col-date { width: 100px; }
.col-place { width: 180px; }
.col-title { }
.col-category { width: 120px; }
.col-age { width: 60px; text-align: center; }
.col-price { width: 100px; text-align: right; }

/* Event thumbnail with zoom */
.event-thumb-wrapper {
    position: relative;
    width: 80px;
    height: 60px;
    overflow: visible;
}

.event-thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s ease, z-index 0s;
}

.event-thumb:hover {
    transform: scale(4);
    z-index: 1000;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* Event title */
.event-title-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
}

.event-title-link:hover {
    color: var(--primary-color);
}

.event-description {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* Place styling */
.event-place-name {
    font-weight: 500;
}

.event-metro {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Date styling */
.event-date {
    color: var(--primary-color);
    font-weight: 500;
}

/* Price styling */
.event-price {
    font-weight: bold;
}

.event-price.free {
    color: #4caf50;
}

/* Category badges */
.badge {
    display: inline-block;
    background: #e0e0e0;
    color: var(--text-muted);
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    margin: 0.1rem;
}

/* Age badge */
.age-badge {
    display: inline-block;
    background: #f0f0f0;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Going with badges */
.going-with-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
}

.badge-alone {
    background: #fff3cd;
    color: #856404;
}

.badge-child {
    background: #d4edda;
    color: #155724;
}

.badge-spouse {
    background: #cce5ff;
    color: #004085;
}

/* Session override badge (orange - from chat) */
.badge-session {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffb74d;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    white-space: nowrap;
}

.btn-small {
    padding: 0.15rem 0.4rem;
    font-size: 0.75rem;
    background: transparent;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    color: #666;
}

.btn-small:hover {
    background: #f0f0f0;
    color: #333;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem 0;
}

.btn-page {
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    min-width: 40px;
}

.btn-page:hover {
    background: var(--bg-color);
}

.btn-page.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Loading & No Events */
.loading td,
.no-events td {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

/* Multi-select dropdown */
.dropdown-multi {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--card-bg);
    cursor: pointer;
    font-size: 0.9rem;
    min-width: 120px;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-toggle:hover {
    border-color: var(--primary-color);
}

.dropdown-arrow {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    max-height: 300px;
    overflow-y: auto;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: var(--shadow);
    z-index: 100;
    padding: 0.5rem 0;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-item:hover {
    background: #f5f5f5;
}

.dropdown-item input[type="checkbox"] {
    margin: 0;
}

.category-all {
    background: #f8f8f8;
}

.category-divider {
    height: 1px;
    background: #ddd;
    margin: 0.25rem 0;
}

/* Age hint */
.age-hint {
    font-size: 0.8rem;
    color: var(--primary-color);
    margin-left: 0.5rem;
}

/* Profile Tab */
.profile-section {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

.profile-section h2 {
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-size: 1.2rem;
}

.section-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Kids list */
.kids-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.kid-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.kid-badge .remove-kid {
    background: none;
    border: none;
    color: #1976d2;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0;
    opacity: 0.7;
}

.kid-badge .remove-kid:hover {
    opacity: 1;
}

.add-kid-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.add-kid-form label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.add-kid-form select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
}

.kids-hint {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #fff3e0;
    border-radius: 4px;
    color: #e65100;
    font-size: 0.85rem;
    display: none;
}

.kids-hint.show {
    display: block;
}

.no-kids {
    color: var(--text-muted);
    font-style: italic;
    padding: 0.5rem 0;
}

/* Addresses list */
.addresses-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.address-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #e8f5e9;
    color: #2e7d32;
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.address-badge .remove-address {
    background: none;
    border: none;
    color: #2e7d32;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0;
    opacity: 0.7;
}

.address-badge .remove-address:hover {
    opacity: 1;
}

.add-address-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.add-address-form label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.address-status {
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

.address-status.loading { color: #666; }
.address-status.success { color: #2e7d32; }
.address-status.error { color: #c62828; }

.no-addresses {
    color: var(--text-muted);
    font-style: italic;
    padding: 0.5rem 0;
}

/* Preferences */
.preference-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.preference-group label {
    color: var(--text-muted);
    font-size: 0.9rem;
    min-width: 100px;
}

.preference-group select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
}

.preferences-status {
    font-size: 0.85rem;
    color: #2e7d32;
    margin-left: 0.5rem;
}

/* Secondary button */
.btn-secondary {
    background: #f5f5f5;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: 1px solid #dc3545;
}

.btn-danger:hover {
    background: #c82333;
    border-color: #bd2130;
}

/* Codeword display */
.codeword-display {
    margin-left: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.codeword-display code {
    background: var(--bg-secondary);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: monospace;
}

/* Footer */
footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

footer a {
    color: var(--primary-color);
}

/* Responsive */
@media (max-width: 900px) {
    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        flex-wrap: wrap;
    }

    .events-table-wrapper {
        overflow-x: auto;
    }

    .events-table {
        min-width: 800px;
    }
}

@media (max-width: 600px) {
    .tab {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

/* =============================================================================
   Category Chips
   ============================================================================= */

.filter-group-categories {
    flex-basis: 100%;
    flex-wrap: wrap;
}

.category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.category-chip {
    padding: 0.25rem 0.6rem;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
    user-select: none;
}

.category-chip:hover {
    border-color: var(--primary-color);
    background: #fce4ec;
}

.category-chip.selected {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* =============================================================================
   3-State Category Chips (Include/Exclude/Neutral)
   ============================================================================= */

.category-chips-3state {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.category-chip-3state {
    padding: 0.35rem 0.8rem;
    border-radius: 16px;
    border: 2px solid var(--border-color);
    background: var(--card-bg);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    user-select: none;
}

.category-chip-3state:hover {
    border-color: #888;
}

.category-chip-3state.include {
    background: #c8e6c9;
    border-color: #4caf50;
    color: #2e7d32;
}

.category-chip-3state.exclude {
    background: #ffcdd2;
    border-color: #f44336;
    color: #c62828;
}

/* =============================================================================
   Company Section (С кем пойдёте)
   ============================================================================= */

.company-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.company-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.7rem;
    border-radius: 16px;
    background: #e8eaf6;
    color: #3f51b5;
    font-size: 0.85rem;
    cursor: default;
}

.company-badge.child {
    background: #fff3e0;
    color: #e65100;
}

.company-badge.spouse {
    background: #fce4ec;
    color: #c2185b;
}

.company-badge.friend {
    background: #e0f2f1;
    color: #00695c;
}

.company-badge .remove-companion {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: inherit;
    opacity: 0.6;
    padding: 0;
    margin-left: 0.2rem;
}

.company-badge .remove-companion:hover {
    opacity: 1;
}

.company-badge .companion-notes-icon {
    font-size: 0.75rem;
    opacity: 0.7;
}

.no-companions {
    color: var(--text-muted);
    font-style: italic;
}

/* Companion Form */
.add-companion-form {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 0.5rem;
}

.companion-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 0.75rem;
}

.companion-form-row:last-child {
    margin-bottom: 0;
}

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

.form-group label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.form-group-wide {
    flex: 1;
    min-width: 150px;
}

.gender-radio {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.gender-radio label {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.85rem;
    cursor: pointer;
}

/* Location Form */
.location-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

/* Preferences Textarea */
.preferences-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    margin-bottom: 0.75rem;
}

.preferences-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* =============================================================================
   Heart / Favorites
   ============================================================================= */

.col-favorite {
    width: 40px;
    text-align: center;
}

.heart-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.3rem;
    color: #ddd;
    transition: color 0.2s, transform 0.15s;
    padding: 0;
    line-height: 1;
}

.heart-btn:hover {
    transform: scale(1.2);
    color: #f48fb1;
}

.heart-btn.favorited {
    color: var(--primary-color);
}

/* Favorites tab empty state */
.favorites-empty {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.favorites-empty p {
    font-size: 1.1rem;
}

/* Favorites count badge */
.favorites-count {
    background: var(--primary-color);
    color: white;
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    margin-left: 0.3rem;
    vertical-align: middle;
}

/* =============================================================================
   Metro / Street Address Distinction
   ============================================================================= */

.address-badge.metro {
    background: #e3f2fd;
    color: #1565c0;
}

.address-badge.metro .remove-address {
    color: #1565c0;
}

.address-badge.street {
    background: #e8f5e9;
    color: #2e7d32;
}

.address-badge .address-icon {
    font-size: 0.9rem;
}

/* =============================================================================
   Distance Input
   ============================================================================= */

.distance-unit {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.distance-input {
    width: 60px;
    text-align: center;
}

/* =============================================================================
   Date & Price Inputs
   ============================================================================= */

.date-input {
    width: 95px;
    text-align: center;
}

.price-input {
    width: 70px;
    text-align: right;
}

/* =============================================================================
   Preference Group Categories
   ============================================================================= */

.preference-group-categories {
    flex-wrap: wrap;
    align-items: flex-start;
}

.preference-group-categories .category-chips {
    flex: 1;
}

/* =============================================================================
   Map Tab
   ============================================================================= */

#map-container {
    width: 100%;
    height: 500px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    background: #e0e0e0;
}

.leaflet-control-attribution {
    display: none;
}

.leaflet-top,
.leaflet-bottom,
.leaflet-control {
    z-index: 500 !important;
}

.map-info-bar {
    display: flex;
    gap: 1.5rem;
    padding: 0.5rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.map-legend {
    display: flex;
    gap: 1.5rem;
    padding: 0.75rem 0;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.legend-marker {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
}

.legend-marker.event-marker {
    background: var(--primary-color);
    border: 2px solid #c2185b;
}

.legend-marker.address-marker.metro {
    background: #1976d2;
    border: 2px solid #0d47a1;
}

.legend-marker.address-marker.street {
    background: #4caf50;
    border: 2px solid #2e7d32;
}

/* Event markers (simple pin without number) */
.event-marker {
    background: transparent;
}

.marker-pin {
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    border: 2px solid #c2185b;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Address markers */
.address-pin-wrapper div {
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Popup styling */
.event-popup {
    min-width: 200px;
}

.event-popup .popup-header {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}

.event-popup .popup-header .heart-btn {
    flex-shrink: 0;
    padding: 0;
    font-size: 1.1rem;
}

.event-popup .popup-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-color);
}

.event-popup .popup-date {
    color: var(--primary-color);
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
}

.event-popup .popup-place {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
}

.event-popup .popup-price {
    font-weight: 500;
    font-size: 0.85rem;
}

.event-popup .popup-link {
    display: inline-block;
    margin-top: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.85rem;
}

.event-popup .popup-link:hover {
    text-decoration: underline;
}

/* Radius circle */
.leaflet-interactive.radius-circle {
    fill: var(--primary-color);
    fill-opacity: 0.1;
    stroke: var(--primary-color);
    stroke-width: 2;
}

/* Dark overlay outside radius - ensure it's behind markers */
.leaflet-overlay-pane {
    z-index: 400;
}

.leaflet-marker-pane {
    z-index: 600;
}

/* Ensure popup is on top */
.leaflet-popup-pane {
    z-index: 700;
}

/* =============================================================================
   Event Detail Modal
   ============================================================================= */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.modal-content {
    position: relative;
    background: var(--bg-color);
    border-radius: 12px;
    max-width: 800px;
    max-height: 90vh;
    width: 90%;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    z-index: 10;
    line-height: 1;
    padding: 0;
    width: 36px;
    height: 36px;
}

.modal-close:hover {
    color: var(--text-color);
}

.modal-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem 3rem 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-color);
    line-height: 1.3;
}

.modal-heart {
    flex-shrink: 0;
    font-size: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-image-section {
    margin-bottom: 1.5rem;
}

.modal-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--bg-secondary);
}

.modal-info-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem 2rem;
    margin-bottom: 1.5rem;
}

.modal-info-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.modal-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-value {
    font-size: 0.95rem;
    color: var(--text-color);
}

.modal-price-row .modal-value {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.modal-description-section h3 {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-color);
    max-height: 200px;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 1.5rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
}

.btn-buy-large {
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-buy-large:hover {
    background: #c2185b;
}

/* Buy button in events table */
.btn-buy {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    margin-left: 0.5rem;
}

.btn-buy:hover {
    background: #c2185b;
}

/* Clickable event title */
.event-title-clickable {
    color: var(--text-color);
    text-decoration: none;
    cursor: pointer;
}

.event-title-clickable:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Modal responsive */
@media (max-width: 600px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .modal-info-section {
        grid-template-columns: 1fr;
    }

    .modal-header {
        padding: 1rem 2.5rem 1rem 1rem;
    }

    .modal-header h2 {
        font-size: 1.2rem;
    }
}

/* =============================================================================
   Chat Tab
   ============================================================================= */

/* Chat login prompt */
.chat-login-prompt {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    max-width: 400px;
    margin: 2rem auto;
    text-align: center;
}

.chat-login-prompt p {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

/* Auth row (horizontal form) */
.auth-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 0.5rem;
}

/* Logged in info */
.logged-in-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logged-in-info strong {
    color: var(--primary-color);
}

.auth-input {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    width: 100%;
}

.auth-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-auth {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    width: 100%;
}

.auth-hint {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.auth-error {
    color: #c62828;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Chat main interface */
.chat-main {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 220px);
    min-height: 400px;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background: #f8f8f8;
    border-radius: 8px 8px 0 0;
}

#chat-user-name {
    font-weight: 500;
    color: var(--text-color);
}

.chat-event-badge {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

#chat-logout {
    margin-left: auto;
}

.btn-small {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

/* Messages container */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Individual message */
.chat-msg {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    position: relative;
}

.chat-msg.user {
    background: var(--primary-color);
    color: white;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.chat-msg.agent {
    background: #f0f0f0;
    color: var(--text-color);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.msg-text {
    line-height: 1.5;
    white-space: pre-wrap;
}

.msg-time {
    font-size: 0.7rem;
    opacity: 0.7;
    display: block;
    margin-top: 0.3rem;
}

/* Event cards in chat */
.chat-events {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-events-more {
    text-align: center;
    font-size: 0.85rem;
    color: #666;
    padding: 0.5rem;
    font-style: italic;
}

.chat-qr {
    margin-top: 0.75rem;
    text-align: center;
}

.chat-qr img {
    max-width: 200px;
    border-radius: 8px;
    background: white;
    padding: 8px;
}

.chat-event-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    cursor: pointer;
    transition: box-shadow 0.2s;
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.chat-event-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.chat-event-num {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
    min-width: 1.2rem;
}

.chat-event-content {
    flex: 1;
}

.chat-event-title {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.chat-event-info {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.chat-event-reason {
    font-size: 0.85rem;
    color: var(--primary-color);
    margin-top: 0.35rem;
    font-style: italic;
}

/* Chat input area */
.chat-input-row {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
    background: #f8f8f8;
    border-radius: 0 0 8px 8px;
}

.chat-textarea {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
    resize: none;
    font-family: inherit;
    min-height: 40px;
}

.chat-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-send {
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 1.2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: flex-end;
}

.btn-send:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Loading indicator */
.chat-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
}

.chat-loading-dots {
    display: flex;
    gap: 0.25rem;
}

.chat-loading-dots span {
    width: 6px;
    height: 6px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: chatPulse 1.4s infinite ease-in-out;
}

.chat-loading-dots span:nth-child(1) { animation-delay: 0s; }
.chat-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.chat-loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes chatPulse {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Chat responsive */
@media (max-width: 600px) {
    .chat-main {
        height: calc(100vh - 180px);
    }

    .chat-msg {
        max-width: 90%;
    }

    .chat-auth {
        margin: 1rem;
        padding: 1.5rem;
    }
}

/* ============================================================================
   MAIN VIEW - Combined Chat + Map + Events Layout
   ============================================================================ */

/* Top Bar with Burger Menu */
.top-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    height: 50px;
    position: relative;
}

.home-btn {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: white;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.home-btn:hover {
    background: rgba(255,255,255,0.2);
}

.top-bar-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.top-bar-title:hover {
    opacity: 0.8;
}

.top-bar-auth {
    font-size: 0.9rem;
}

.top-bar-user {
    opacity: 0.9;
}

.top-bar-user-link {
    cursor: pointer;
    transition: opacity 0.2s;
}

.top-bar-user-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Main View Container */
.main-view {
    display: none;
    flex-direction: column;
    height: calc(100vh - 50px);
    overflow: hidden;
}

.main-view.active {
    display: flex;
}

/* Filter Bar (always visible, full width) */
.main-filter-bar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
}

.main-filter-content {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    align-items: center;
}

/* Main Content (Chat left + Map/Events right) */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* Left Column: Chat */
.main-chat-column {
    display: flex;
    flex-direction: column;
    width: 33%;
    min-width: 0;
    height: 100%;
    background: var(--card-bg);
    overflow: hidden;
}

.main-chat-column.collapsed {
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
}

.main-chat-column.collapsed .main-chat-inner {
    opacity: 0;
    pointer-events: none;
}

/* Panel resizer - draggable divider between chat and right column */
.panel-resizer {
    width: 8px;
    height: 100%;
    background: var(--border-color);
    cursor: col-resize;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.panel-resizer:hover,
.panel-resizer.dragging {
    background: var(--primary-color);
}

.resizer-handle {
    width: 4px;
    height: 40px;
    background: var(--text-muted);
    border-radius: 2px;
    opacity: 0.5;
}

.panel-resizer:hover .resizer-handle,
.panel-resizer.dragging .resizer-handle {
    background: white;
    opacity: 1;
}

.main-chat-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.main-chat-column.collapsed .main-chat-inner {
    display: none;
}

.main-chat-login {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

.main-chat-logged {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.main-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.main-chat-input-row {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-color);
}

.main-chat-textarea {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    resize: none;
    font-family: inherit;
    font-size: 0.9rem;
}

/* Right Column: Map + Status + Events */
.main-right-column {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
    overflow: hidden;
}

/* Map Area */
.main-map {
    background: #e0e0e0;
    position: relative;
    height: 33vh;
    min-height: 0;
    flex-shrink: 0;
    overflow: hidden;
}

/* Map/Events Resizer */
.map-events-resizer {
    height: 8px;
    background: var(--border-color);
    cursor: ns-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}

.map-events-resizer:hover {
    background: var(--primary-color);
}

.map-events-resizer::after {
    content: '';
    width: 40px;
    height: 4px;
    background: #999;
    border-radius: 2px;
}

.map-events-resizer:hover::after {
    background: white;
}

.main-map .leaflet-container {
    height: 100%;
    width: 100%;
}

/* Status Bar */
.main-status-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.main-going-with {
    display: flex;
    gap: 0.25rem;
}

/* View Mode Buttons */
.view-mode-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex: 1;
}

.view-mode-left {
    display: flex;
    gap: 0;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.view-mode-right {
    display: flex;
    gap: 0;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-left: auto;
}

.view-mode-btn {
    background: var(--card-bg);
    border: none;
    border-right: 1px solid var(--border-color);
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-color);
}

.view-mode-left .view-mode-btn:last-child,
.view-mode-right .view-mode-btn:last-child { border-right: none; }
.view-mode-btn:hover { background: var(--bg-color); }
.view-mode-btn.active { background: var(--primary-color); color: white; }

.view-mode-btn .tab-count {
    font-size: 0.75rem;
    background: rgba(0,0,0,0.15);
    padding: 0 0.35rem;
    border-radius: 8px;
    min-width: 1rem;
    text-align: center;
    margin-left: 0.2rem;
}

.view-mode-btn .tab-count:empty {
    display: none;
}

.view-mode-btn.active .tab-count {
    background: rgba(255,255,255,0.25);
}

/* View Style Toggle (list/tiles) */
.view-style-toggle {
    display: flex;
    gap: 0;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-right: 0.5rem;
}

.view-style-btn {
    background: var(--card-bg);
    border: none;
    border-right: 1px solid var(--border-color);
    padding: 0.35rem 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.view-style-btn:last-child {
    border-right: none;
}

.view-style-btn:hover {
    background: var(--bg-color);
    color: var(--text-color);
}

.view-style-btn.active {
    background: var(--primary-color);
    color: white;
}

.view-style-btn svg {
    display: block;
}

/* Events Tile Grid */
.events-tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
    align-content: start;
    box-sizing: border-box;
}

/* Responsive: larger tiles on wider screens */
@media (min-width: 600px) {
    .events-tiles-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1.25rem;
    }
}

@media (min-width: 900px) {
    .events-tiles-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

.event-tile {
    background: transparent;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Allow shrinking */
}

.event-tile:hover .event-tile-image {
    transform: scale(1.03);
}

.event-tile-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 75%; /* 4:3 aspect ratio for consistent proportions */
    border-radius: 8px;
    overflow: hidden;
    background: linear-gradient(
        90deg,
        var(--bg-secondary) 0%,
        var(--bg-tertiary, #3a3a3a) 50%,
        var(--bg-secondary) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Stop shimmer when image is loaded */
.event-tile-image-wrapper.loaded {
    animation: none;
    background: var(--bg-secondary);
}

.event-tile-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.event-tile-heart {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    pointer-events: auto;
}

/* Container for category badges - bottom right, stacked vertically */
.event-tile-badges {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.event-tile-badge {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.65rem;
    white-space: nowrap;
    backdrop-filter: blur(4px);
}

.event-tile-action {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    color: #333;
    font-size: 0.85rem;
}

.event-tile-action:hover {
    transform: scale(1.1);
}

.event-tile-action.favorited {
    background: var(--primary-color);
    color: white;
}

.event-tile-info {
    padding: 0.5rem 0.25rem;
    flex: 1;
    min-height: auto;
}

.event-tile-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-color);
}

.event-tile-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.event-tile-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.event-tile-date {
    color: var(--text-muted);
}

.event-tile-price {
    color: var(--primary-color);
    font-weight: 500;
    white-space: nowrap;
}

.event-tile-place {
    display: block;
    line-height: 1.3;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Highlight shown events in tiles */
.event-tile.event-shown-in-chat .event-tile-image-wrapper {
    box-shadow: 0 0 0 2px var(--primary-color);
}

/* Events Header */
.main-events-header {
    display: grid;
    grid-template-columns:
        var(--col-fav, 30px)
        var(--col-img, 55px)
        var(--col-date, 85px)
        var(--col-place, 120px)
        var(--col-title, 1fr)
        var(--col-cat, 100px)
        var(--col-age, 55px)
        var(--col-price, 90px);
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    padding-right: calc(1rem + 10px); /* Extra padding for scrollbar alignment */
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-muted);
    align-items: center;
}

.main-events-header .col-age {
    text-align: center;
}

.main-events-header .col-price {
    text-align: right;
}

.main-events-header > span {
    user-select: none;
}

/* Column resizer overlay - positioned absolutely over the header */
.col-resizer-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.col-resizer {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 12px;
    cursor: col-resize;
    pointer-events: auto;
    z-index: 10;
}

/* Separator line - always visible */
.col-resizer::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 4px;
    bottom: 4px;
    width: 1px;
    background: var(--border-color);
    border-radius: 1px;
    transition: background 0.15s, width 0.15s;
}

/* Highlight on hover/drag */
.col-resizer:hover::before,
.col-resizer.dragging::before {
    background: var(--primary-color);
    width: 2px;
    left: 4px;
}

/* Events Scroll Container */
.main-events-scroll {
    overflow-y: auto;
    background: var(--card-bg);
    flex: 1;
    min-height: 100px;
}

.main-events-list {
    min-height: 100%;
}

/* Event Row in Main View */
.main-event-row {
    display: grid;
    grid-template-columns:
        var(--col-fav, 30px)
        var(--col-img, 55px)
        var(--col-date, 85px)
        var(--col-place, 120px)
        var(--col-title, 1fr)
        var(--col-cat, 100px)
        var(--col-age, 55px)
        var(--col-price, 90px);
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.15s;
    align-items: center;
    font-size: 0.85rem;
}

.main-event-row .event-age {
    text-align: center;
}

.main-event-row .event-price {
    text-align: right;
}

/* Image cell wrapper to maintain grid position */
.main-event-row .event-img-cell {
    width: 50px;
    height: 35px;
    overflow: hidden;
}

.main-event-row:hover {
    background: var(--bg-color);
}

.main-event-row.highlighted {
    background: rgba(233, 30, 99, 0.1);
    animation: highlight-fade 2s ease-out;
}

@keyframes highlight-fade {
    0% { background: rgba(233, 30, 99, 0.2); }
    100% { background: transparent; }
}

.main-event-row .event-img {
    width: 50px;
    height: 35px;
    object-fit: cover;
    border-radius: 4px;
    background: var(--bg-color);
}

.main-event-row .event-title {
    font-weight: 500;
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.main-event-row .event-date,
.main-event-row .event-place,
.main-event-row .event-cat,
.main-event-row .event-age,
.main-event-row .event-price {
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.main-event-row .event-place {
    font-size: 0.8rem;
}

.main-event-row .event-cat {
    font-size: 0.75rem;
}

.main-event-row .heart-btn {
    font-size: 1rem;
}

.main-pagination {
    padding: 1rem;
    text-align: center;
}

/* ============================================================================
   SLIDING EVENT CARD
   ============================================================================ */

.event-card-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    pointer-events: none;
    z-index: 1000;
}

.event-card-overlay.active {
    pointer-events: auto;
}

.event-card-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.event-card-overlay.active .event-card-backdrop {
    opacity: 1;
}

.event-card-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 400px;
    max-width: 90vw;
    background: white;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.event-card-overlay.active .event-card-panel {
    transform: translateX(0);
}

.event-card-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s;
}

.event-card-close:hover {
    background: var(--border-color);
}

.event-card-content {
    padding: 1.5rem;
}

.event-card-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-right: 3rem;
}

.event-card-header h2 {
    font-size: 1.25rem;
    line-height: 1.3;
}

.event-card-header .heart-btn {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.event-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.event-card-info {
    margin-bottom: 1.5rem;
}

.event-card-info .info-row {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.event-card-info .label {
    font-weight: 500;
    color: var(--text-muted);
    min-width: 100px;
}

.event-card-info .price-row {
    background: rgba(233, 30, 99, 0.05);
    margin: 0 -0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
}

.event-card-description h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.event-card-description div {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.event-card-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.btn-buy {
    display: block;
    width: 100%;
    text-align: center;
    padding: 0.75rem 1rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-buy:hover {
    background: var(--primary-dark);
}

/* ============================================================================
   LOGIN MODAL
   ============================================================================ */

.login-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.login-modal-overlay.active {
    display: flex;
}

.login-modal {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    width: 90%;
    max-width: 360px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-modal h2 {
    margin: 0 0 1.5rem 0;
    text-align: center;
    color: var(--text-color);
}

.login-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.login-form .form-group {
    margin-bottom: 1rem;
}

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.login-form input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-login {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: background 0.2s;
}

.btn-login:hover {
    background: var(--primary-dark);
}

.login-error {
    color: #c00;
    font-size: 0.9rem;
    margin-top: 1rem;
    text-align: center;
}

/* =============================================================================
   AG GRID CUSTOMIZATION
   ============================================================================= */

/* Container size */
#events-grid {
    flex: 1;
    min-height: 200px;
    width: 100%;
}

#events-tiles {
    flex: 1;
    min-height: 200px;
    width: 100%;
}

/* AG Grid Dark Theme Variables */
.ag-theme-quartz-dark {
    --ag-header-background-color: var(--card-bg);
    --ag-background-color: var(--card-bg);
    --ag-odd-row-background-color: var(--card-bg);
    --ag-row-hover-color: var(--bg-color);
    --ag-header-foreground-color: var(--text-muted);
    --ag-foreground-color: var(--text-color);
    --ag-border-color: var(--border-color);
    --ag-font-family: inherit;
    --ag-font-size: 0.85rem;
    --ag-selected-row-background-color: rgba(233, 30, 99, 0.1);
    --ag-range-selection-border-color: var(--primary-color);
}

.ag-theme-quartz-dark .ag-header-cell {
    font-weight: 600;
    font-size: 0.8rem;
}

.ag-theme-quartz-dark .ag-cell {
    display: flex;
    align-items: center;
}

/* Event image in grid */
.ag-theme-quartz-dark .event-img {
    width: 50px;
    height: 35px;
    object-fit: cover;
    border-radius: 4px;
    background: var(--bg-color);
}

/* Heart button in grid */
.ag-theme-quartz-dark .heart-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-muted);
    padding: 0.25rem;
    transition: color 0.2s, transform 0.15s;
}

.ag-theme-quartz-dark .heart-btn:hover {
    color: var(--primary-color);
    transform: scale(1.2);
}

.ag-theme-quartz-dark .heart-btn.favorited {
    color: var(--primary-color);
}

/* Row cursor */
.ag-theme-quartz-dark .ag-row {
    cursor: pointer;
}

/* Highlight events shown in chat */
.ag-theme-quartz-dark .ag-row.event-shown-in-chat {
    background-color: rgba(233, 30, 99, 0.15);
}
.ag-theme-quartz-dark .ag-row.event-shown-in-chat:hover {
    background-color: rgba(233, 30, 99, 0.25);
}

/* Column resize handle highlight */
.ag-theme-quartz-dark .ag-header-cell-resize::after {
    background-color: var(--primary-color);
}

/* =============================================================================
   Flow View (Поток) - Category Groups
   ============================================================================= */

.flow-view {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Groups wrapper - shows category grid */
.flow-groups-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 1rem;
    width: 100%;
}

/* Dynamic Category Groups Grid - auto-fill based on available space */
.category-groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 180px));
    gap: 12px;
    width: 100%;
    justify-content: center;
}

.category-group-card {
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    background: linear-gradient(135deg, #2a2a3e 0%, #1a1a2e 100%);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid transparent;
}

.category-group-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.category-group-card.selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(233, 30, 99, 0.3);
}

.category-group-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.category-group-card:hover .category-group-image {
    opacity: 0.8;
}

.category-group-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    opacity: 0.3;
    color: white;
}

.category-group-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
}

.category-group-name {
    font-size: 14px;
    font-weight: 600;
    color: white;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.category-group-count {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    backdrop-filter: blur(4px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Flow Events Container - takes full height when visible */
.flow-events-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.flow-events-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--surface-color, #1e1e2e);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.flow-back-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.flow-back-btn:hover {
    background: var(--primary-hover);
}

.flow-group-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
}

.flow-events-count {
    font-size: 14px;
    color: var(--text-muted);
    margin-left: auto;
}

.flow-events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    grid-auto-rows: min-content;
    align-items: start;
    gap: 1rem;
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
}

.flow-no-events {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 14px;
}

/* Flow Event Tiles - inherits from .event-tile */
.flow-event-tile {
    background: var(--card-bg, #fff);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.flow-event-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.flow-event-tile .event-tile-image-wrapper {
    border-radius: 8px 8px 0 0;
}

.flow-event-tile:hover .event-tile-image {
    transform: scale(1.03);
}

/* Ensure flow tile info section is visible */
.flow-event-tile .event-tile-info {
    display: block !important;
    padding: 0.5rem;
    min-height: 60px;
    background: var(--card-bg, #fff);
}

.flow-event-tile .event-tile-title {
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
    color: var(--text-color, #333);
}

.flow-event-tile .event-tile-meta {
    font-size: 0.7rem;
}

.flow-event-tile .event-tile-meta-row {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.flow-event-tile .event-tile-date {
    color: var(--text-muted, #666);
}

.flow-event-tile .event-tile-price {
    color: var(--primary-color, #e91e63);
}

.flow-event-tile .event-tile-place {
    color: var(--text-muted, #666);
    font-size: 0.65rem;
    margin-top: 0.2rem;
}

.flow-event-tile .event-tile-badge {
    font-size: 0.6rem;
    padding: 0.15rem 0.4rem;
}

/* Flow Pagination */
.flow-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    margin-top: 1rem;
    grid-column: 1 / -1;
}

.flow-page-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s ease;
}

.flow-page-btn:hover:not(:disabled) {
    background: var(--primary-hover);
}

.flow-page-btn:disabled {
    background: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
}

.flow-page-info {
    font-size: 14px;
    color: var(--text-color);
}

/* Flow Loading and Error States */
.flow-events-grid .loading-spinner {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.flow-events-grid .error-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: var(--error-color, #f44336);
}

.flow-events-grid .no-events-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 14px;
}

/* Mobile responsive: smaller cards */
@media (max-width: 480px) {
    .category-groups-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 140px));
        gap: 8px;
    }

    .category-group-name {
        font-size: 11px;
    }

    .category-group-count {
        font-size: 9px;
        padding: 3px 6px;
        left: 4px;
        right: 4px;
        top: 4px;
    }

    .category-group-icon {
        width: 32px;
        height: 32px;
    }
}

/* Larger screens: bigger cards */
@media (min-width: 900px) {
    .category-groups-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 200px));
        gap: 16px;
    }

    .flow-events-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

/* =============================================================================
   Flow Mode List View
   ============================================================================= */

/* Category groups as list */
.category-groups-grid.list-view {
    grid-template-columns: 1fr;
    max-width: 800px;
}

.category-groups-grid.list-view .category-group-card {
    aspect-ratio: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    height: 80px;
    padding-right: 1rem;
}

.category-groups-grid.list-view .category-group-image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.category-groups-grid.list-view .category-group-overlay {
    width: 80px;
}

.category-groups-grid.list-view .category-group-icon {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    width: 40px;
    height: 40px;
    margin: 0 1rem;
    flex-shrink: 0;
}

.category-groups-grid.list-view .category-group-name {
    position: relative;
    bottom: auto;
    left: auto;
    font-size: 16px;
    flex: 1;
}

.category-groups-grid.list-view .category-group-count {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    background: var(--primary-color);
    padding: 6px 12px;
    border-radius: 16px;
    white-space: nowrap;
}

/* Flow events as list */
.flow-events-grid.list-view {
    grid-template-columns: 1fr;
    max-width: 800px;
    margin: 0 auto;
}

.flow-events-grid.list-view .flow-event-tile {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
}

.flow-events-grid.list-view .event-tile-image-wrapper {
    width: 120px;
    height: 80px;
    padding-top: 0;
    flex-shrink: 0;
}

.flow-events-grid.list-view .event-tile-image {
    position: relative;
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.flow-events-grid.list-view .event-tile-info {
    flex: 1;
    padding: 0;
}

.flow-events-grid.list-view .event-tile-title {
    font-size: 15px;
}

/* =============================================================================
   Filter Chips Bar (New Dialog-Based Filters)
   ============================================================================= */

.filter-chips-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 16px;
    align-items: center;
    position: relative;
}

/* Individual Filter Chip */
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    white-space: nowrap;
    position: relative;
}

.filter-chip:hover {
    border-color: var(--primary-color);
    background: rgba(233, 30, 99, 0.05);
}

.filter-chip.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(233, 30, 99, 0.2);
}

.filter-chip.has-value {
    background: rgba(233, 30, 99, 0.1);
    border-color: var(--primary-color);
}

.filter-chip.has-value .filter-chip-label {
    display: none;
}

.filter-chip:not(.has-value) .filter-chip-value {
    display: none;
}

.filter-chip-label {
    color: var(--text-muted);
    font-weight: 500;
}

.filter-chip-value {
    color: var(--text-color);
    font-weight: 500;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Reset Button */
.filter-reset-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.filter-reset-btn:hover {
    background: #ffebee;
    border-color: #f44336;
    color: #f44336;
}

.filter-reset-btn.hidden {
    display: none;
}

.filter-reset-btn .restore-icon {
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-reset-btn .restore-icon svg {
    width: 16px;
    height: 16px;
}

/* Filter action buttons (save, load) */
.filter-action-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.filter-action-btn:hover {
    background: var(--bg-color);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-action-btn.hidden {
    display: none;
}

.filter-action-btn svg {
    width: 14px;
    height: 14px;
}

/* =============================================================================
   Profile Button & Browser
   ============================================================================= */

.profile-btn {
    margin-left: auto;
    position: relative;
}

.profile-btn.has-data {
    border-color: var(--pink, #e91e8c);
    color: var(--pink, #e91e8c);
}

.profile-btn.has-data:hover {
    background: rgba(233, 30, 140, 0.1);
}

.profile-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--pink, #e91e8c);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 8px;
    padding: 0 4px;
    display: none;
}

.profile-dialog {
    right: 0;
    left: auto;
    min-width: 300px;
    max-width: 380px;
}

.profile-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.profile-dialog-header h4 {
    margin: 0;
}

.profile-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.profile-close-btn:hover {
    color: var(--text-color);
}

.profile-browser {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 4px;
}

.profile-section-group {
    margin-bottom: 12px;
}

.profile-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border-color);
}

.profile-trait-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-color);
    transition: background 0.15s;
}

.profile-trait-item:hover {
    background: var(--bg-color);
}

.profile-trait-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-trait-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.profile-trait-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 2px 4px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
}

.profile-trait-item:hover .profile-trait-delete {
    opacity: 1;
}

.profile-trait-delete:hover {
    color: #f44;
    background: rgba(255, 68, 68, 0.1);
}

.profile-affinity-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    font-size: 0.85rem;
}

.profile-affinity-label {
    min-width: 80px;
    color: var(--text-color);
}

.profile-affinity-bar {
    flex: 1;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.profile-affinity-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 3px;
    transition: width 0.3s;
}

.profile-affinity-pct {
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 32px;
    text-align: right;
}

.profile-empty {
    text-align: center;
    padding: 24px 16px;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

/* =============================================================================
   Filter Preset Modals
   ============================================================================= */

.filter-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.filter-modal-overlay.active {
    display: flex;
}

.filter-modal {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    min-width: 320px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.filter-modal-header {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-color);
}

.filter-modal-summary {
    background: var(--bg-color);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
}

.filter-summary-item {
    display: flex;
    gap: 8px;
    padding: 4px 0;
    font-size: 0.9rem;
}

.filter-summary-label {
    color: var(--text-muted);
    min-width: 80px;
    flex-shrink: 0;
}

.filter-summary-multiline {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.filter-summary-multiline div {
    font-size: 13px;
}

.filter-modal-name {
    margin-bottom: 16px;
}

.filter-modal-name label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.filter-modal-name input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
}

.filter-modal-name input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.filter-modal-name input.error {
    border-color: #d32f2f;
}

.save-name-error {
    color: #d32f2f;
    font-size: 13px;
    margin-top: 8px;
    padding: 8px 12px;
    background: #ffebee;
    border-radius: 6px;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font-size: inherit;
}

.btn-link:hover {
    color: var(--primary-dark);
}

.filter-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Presets list */
.filter-presets-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.preset-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.preset-item:hover {
    background: var(--bg-color);
}

.preset-item-content {
    flex: 1;
    min-width: 0;
}

.preset-item-name {
    font-weight: 500;
    margin-bottom: 2px;
}

.preset-item-summary {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preset-item-date {
    font-size: 11px;
    color: var(--text-muted);
    opacity: 0.7;
    margin-top: 2px;
}

.preset-item-delete {
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1rem;
    flex-shrink: 0;
    border-radius: 50%;
    transition: all 0.2s;
}

.preset-item-delete:hover {
    color: #f44336;
    background: #ffebee;
}

.no-presets {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
}

/* =============================================================================
   Filter Dialogs
   ============================================================================= */

.filter-dialog {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 2000;  /* Higher than map controls */
    margin-top: 4px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    min-width: 280px;
    max-width: 400px;
}

.filter-dialog-content {
    padding: 16px;
}

.filter-dialog h4 {
    margin: 0 0 16px 0;
    font-size: 1rem;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.filter-dialog-section {
    margin-bottom: 16px;
}

.filter-dialog-section:last-of-type {
    margin-bottom: 0;
}

.filter-dialog-section > label:first-child {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

.filter-dialog-section input[type="text"],
.filter-dialog-section input[type="number"],
.filter-dialog-section select,
.filter-dialog-section textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.filter-dialog-section input:focus,
.filter-dialog-section select:focus,
.filter-dialog-section textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Dialog actions */
.filter-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* Wide dialog for calendar */
.filter-dialog-wide {
    min-width: 500px;
}

/* Details dialog (wider and taller for presets) */
.filter-dialog-details {
    min-width: 400px;
    max-width: 450px;
}

.filter-dialog-details textarea {
    min-height: 150px;
    resize: vertical;
}

.filter-dialog-details input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text-color);
    font-size: 0.95rem;
}

/* =============================================================================
   Calendar Picker (When Dialog)
   ============================================================================= */

.calendar-container {
    margin-bottom: 12px;
}

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.calendar-nav-btn {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 12px;
    border-radius: 4px;
}

.calendar-nav-btn:hover {
    background: var(--hover-bg);
}

.calendar-month-title {
    font-weight: 600;
    font-size: 0.95rem;
    flex: 1;
    text-align: center;
}

.calendar-months {
    display: flex;
    gap: 16px;
}

.calendar-month {
    flex: 1;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.15s;
}

.calendar-day:hover:not(.empty):not(.past) {
    background: var(--hover-bg);
}

.calendar-day.empty {
    cursor: default;
}

.calendar-day.past {
    color: var(--text-muted);
    opacity: 0.4;
    cursor: not-allowed;
}

.calendar-day.today {
    font-weight: 700;
    color: var(--primary-color);
}

.calendar-day.selected {
    background: var(--primary-color);
    color: white;
}

.calendar-day.in-range {
    background: rgba(233, 30, 99, 0.2);
    border-radius: 0;
}

.calendar-day.range-start {
    border-radius: 50% 0 0 50%;
}

.calendar-day.range-end {
    border-radius: 0 50% 50% 0;
}

.calendar-day.range-start.range-end {
    border-radius: 50%;
}

.calendar-selection-display {
    text-align: center;
    padding: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 12px;
}

.time-section {
    margin-top: 8px;
}

.time-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.time-input-24h {
    width: 60px;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text-color);
    font-size: 1rem;
    text-align: center;
    font-family: monospace;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
}

/* Help icon */
.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text-muted);
    color: var(--card-bg);
    font-size: 0.7rem;
    font-weight: bold;
    cursor: help;
    margin-left: 6px;
    vertical-align: middle;
}

/* =============================================================================
   Who Dialog - Participants Table
   ============================================================================= */

.participants-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.participant-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto auto;
    gap: 8px;
    align-items: center;
    padding: 8px;
    background: var(--bg-color);
    border-radius: 8px;
}

.participant-alias {
    font-size: 0.9rem;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text-color);
    min-width: 80px;
}

.participant-age {
    width: 60px;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text-color);
    font-size: 0.85rem;
    text-align: center;
}

.participant-remove {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px 8px;
    border-radius: 4px;
}

.participant-remove:hover {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

.participant-remove:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.participant-remove:disabled:hover {
    background: transparent;
    color: var(--text-muted);
}

.participant-gender {
    width: 50px;
    padding: 6px 4px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text-color);
    font-size: 0.85rem;
    text-align: center;
}

.participant-prefs-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px 8px;
    border-radius: 6px;
    min-width: 32px;
}

.participant-prefs-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

.participant-prefs-btn.has-prefs {
    background: rgba(233, 30, 99, 0.15);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.participant-prefs {
    grid-column: 1 / -1;
    margin-top: 4px;
}

.participant-prefs textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text-color);
    font-size: 0.85rem;
    resize: vertical;
    min-height: 50px;
}

.participants-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

/* =============================================================================
   What Dialog - Category Chips (3-state)
   ============================================================================= */

.filter-categories-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.filter-category-chip {
    padding: 6px 12px;
    border-radius: 16px;
    border: 2px solid var(--border-color);
    background: var(--card-bg);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    user-select: none;
}

.filter-category-chip:hover {
    border-color: #888;
}

.filter-category-chip.include {
    background: #c8e6c9;
    border-color: #4caf50;
    color: #2e7d32;
}

.filter-category-chip.exclude {
    background: #ffcdd2;
    border-color: #f44336;
    color: #c62828;
}

/* Include/Exclude Mode Toggle */
.filter-mode-toggle {
    display: flex;
    gap: 0;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 12px;
}

.filter-mode-btn {
    flex: 1;
    padding: 10px 14px;
    border: none;
    background: var(--card-bg);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    font-weight: 500;
}

.filter-mode-btn:first-child {
    border-right: 1px solid var(--border-color);
}

.filter-mode-btn.active[data-mode="include"] {
    background: #c8e6c9;
    color: #2e7d32;
    border-color: #4caf50;
}

.filter-mode-btn.active[data-mode="exclude"] {
    background: #ffcdd2;
    color: #c62828;
    border-color: #f44336;
}

/* =============================================================================
   Who Dialog - Number Stepper & Kids List
   ============================================================================= */

.number-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.number-stepper button {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-color);
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-color);
}

.number-stepper button:hover {
    background: var(--border-color);
}

.number-stepper input {
    width: 50px;
    text-align: center;
    border: none;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    font-size: 1rem;
    padding: 4px;
}

.number-stepper input:focus {
    outline: none;
}

/* Kids list */
.filter-kids-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.filter-kid-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: var(--bg-color);
    border-radius: 6px;
}

.filter-kid-row input {
    width: 60px !important;
}

.filter-kid-row select {
    width: 70px !important;
}

.filter-kid-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0 4px;
    line-height: 1;
}

.filter-kid-remove:hover {
    color: #f44336;
}

/* =============================================================================
   Budget Dialog - Range & Toggles
   ============================================================================= */

.budget-range-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.budget-range-row .budget-input {
    width: 80px !important;
}

.budget-range-row span {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Dual Range Slider */
.budget-dual-slider {
    position: relative;
    height: 24px;
    margin: 8px 0;
}

.budget-dual-slider .slider-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 6px;
    transform: translateY(-50%);
    background: var(--border-color);
    border-radius: 3px;
}

.budget-dual-slider .slider-range {
    position: absolute;
    top: 50%;
    height: 6px;
    transform: translateY(-50%);
    background: var(--primary-color);
    border-radius: 3px;
}

.budget-dual-slider input[type="range"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    outline: none;
}

.budget-dual-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 2px solid white;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.budget-dual-slider input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 2px solid white;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.budget-slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0;
}

.budget-type-toggle {
    display: flex;
    gap: 0;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.budget-type-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: var(--card-bg);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.budget-type-btn:first-child {
    border-right: 1px solid var(--border-color);
}

.budget-type-btn.active {
    background: var(--primary-color);
    color: white;
}

/* =============================================================================
   Where Dialog - Transport Options
   ============================================================================= */

.filter-transport-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.filter-transport-options label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    cursor: pointer;
}

.filter-transport-options input[type="checkbox"] {
    width: auto !important;
}

/* Distance row */
.filter-distance-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-distance-row input {
    width: 80px !important;
}

.filter-distance-row .unit {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Address status */
.address-status {
    display: inline-block;
    margin-left: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.address-status.address-found {
    color: #4caf50;
    font-weight: 500;
}

.address-status.address-error {
    color: #f44336;
}

/* =============================================================================
   Filter Chips Mobile Responsive
   ============================================================================= */

@media (max-width: 600px) {
    .filter-chips-bar {
        padding: 8px;
        gap: 6px;
    }

    .filter-chip {
        padding: 5px 10px;
        font-size: 0.8rem;
    }

    .filter-dialog {
        left: 8px;
        right: 8px;
        max-width: none;
    }

    .filter-category-chip {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
}
