/**
 * Tip Directory Styles
 *
 * Styles for [nearb_tip_directory] shortcode.
 * Based on directory.css but adapted for tips.
 */

/* Main container */
.nearb-tip-directory {
    display: flex;
    gap: 0;
    width: 100%;
    align-items: stretch;
    background: #f6f7fb;
    box-sizing: border-box;
    font-family: 'Manrope', 'Inter', sans-serif;
    min-height: 100vh;
}

/* Columns */
.nearb-tip-directory__column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.nearb-tip-directory__column--left,
.nearb-tip-directory__column--right {
    flex: 1 1 calc(50% - 16px);
    max-width: calc(50% - 16px);
}

.nearb-tip-directory__column--left {
    max-height: 100vh;
    overflow-y: auto;
    padding: 20px;
}

.nearb-tip-directory__column--right {
    position: sticky;
    top: 0;
    height: 100vh;
}

/* Map */
.nearb-tip-directory__map {
    width: 100%;
    min-height: 100%;
    height: 100%;
    overflow: hidden;
    box-shadow: 0 10px 35px rgba(0,0,0,0.08);
    background: #f4f5f9;
}

/* Search filters - unified container like directory */
.nearb-tip-directory__search {
    width: 100%;
}

.nearb-tip-directory__filters {
    display: flex;
    align-items: stretch;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(23, 34, 75, 0.12);
    border: 1px solid #edeff6;
    position: relative;
    overflow: visible;
    z-index: 10;
}

.nearb-tip-directory__filter {
    flex: 1 1 0;
    position: relative;
}

.nearb-tip-directory__filter--location {
    flex: 2 1 0;
    overflow: visible;
    z-index: 60;
}

.nearb-tip-directory__filter--distance {
    flex: 0 0 auto;
    min-width: 140px;
}

/* Separator between filters */
.nearb-tip-directory__filter:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 14px;
    bottom: 14px;
    right: 0;
    width: 1px;
    background: #eceff5;
}

/* Filter card (inside each filter) */
.nearb-tip-filter-card {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0;
    min-height: 76px;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    cursor: pointer;
    position: relative;
}

.nearb-tip-filter-card .nearb-icon {
    padding: 16px;
    box-sizing: content-box;
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nearb-tip-filter-card .nearb-icon:first-child {
    padding-left: 20px;
}

.nearb-tip-filter-card .nearb-icon:last-child {
    padding-right: 20px;
}

.nearb-tip-filter-card .nearb-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    display: block;
}

/* Location input */
.nearb-tip-directory .nearb-location-input {
    flex: 1 1 auto;
    border: none;
    font-size: 16px;
    outline: none;
    background: transparent;
    height: 100%;
    cursor: text;
    padding: 16px 0;
    color: #191923;
    font-family: inherit;
}

.nearb-tip-directory .nearb-location-input::placeholder {
    color: #9ca3af;
}

/* Geo button */
.nearb-tip-directory .nearb-geo-btn {
    border: none;
    background: transparent !important;
    cursor: pointer;
    color: #191923;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    width: auto;
    height: auto;
    box-shadow: none;
    appearance: none;
}

.nearb-tip-directory .nearb-geo-btn:focus-visible {
    outline: 2px solid #327be5;
    outline-offset: 2px;
    border-radius: 8px;
}

/* Select */
.nearb-tip-directory .nearb-select {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 16px;
    line-height: 1.5;
    padding: 0;
    appearance: none;
    cursor: pointer;
    color: #191923;
    box-sizing: border-box;
    height: 100%;
    background-image: url('../icons/chevron-down.svg');
    background-repeat: no-repeat;
    background-position: calc(100% - 20px) center;
    background-size: 20px;
    padding-right: 48px;
    font-family: inherit;
}

.nearb-tip-directory .nearb-select:focus {
    outline: none;
}

.nearb-tip-directory__filters select,
.nearb-tip-directory__filters input {
    font-family: inherit;
}

/* Suggestions dropdown */
.nearb-tip-directory .nearb-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    list-style: none;
    margin: 0;
    padding: 0;
    background: #fff;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
    z-index: 200;
    max-height: 320px;
    overflow-y: auto;
    display: none;
    border: 1px solid #e2e6f0;
    border-top: none;
}

.nearb-tip-directory .nearb-suggestions.is-active {
    display: block;
}

.nearb-tip-directory .nearb-suggestions li {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f1f1f1;
    font-size: 14px;
    color: #383c3f;
}

.nearb-tip-directory .nearb-suggestions li:last-child {
    border-bottom: none;
}

.nearb-tip-directory .nearb-suggestions li:hover {
    background: #f8fafc;
}

/* List grid */
.nearb-tip-directory__list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* Empty state */
.nearb-tip-directory__empty {
    grid-column: 1 / -1;
    padding: 40px;
    background: #fff;
    border-radius: 16px;
    text-align: center;
    color: #6b7280;
    font-weight: 500;
}

/* ===========================================
   TIP CARD STYLES
   =========================================== */

.nearb-tip-card {
    width: 100%;
    height: 400px;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    background: #dfe3ec;
}

.nearb-tip-card__link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.nearb-tip-card__media {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 16px;
    box-sizing: border-box;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* Gradient overlay */
.nearb-tip-card__media::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(0, 0, 0, 0.3) 40%,
        rgba(0, 0, 0, 0) 100%
    );
    pointer-events: none;
}

/* Favorite button - just the heart icon, no background */
.nearb-tip-card__fav {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    background: transparent;
    border: none;
    border-radius: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    box-shadow: none;
}

.nearb-tip-card__fav:hover {
    transform: scale(1.15);
}

.nearb-tip-card__fav:focus {
    outline: none;
}

.nearb-tip-card__fav-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.nearb-tip-card__fav-icon--active {
    display: none;
}

.nearb-tip-card__fav--active .nearb-tip-card__fav-icon--inactive {
    display: none;
}

.nearb-tip-card__fav--active .nearb-tip-card__fav-icon--active {
    display: block;
}

/* Content overlay */
.nearb-tip-card__content {
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Title */
.nearb-tip-card__title {
    margin: 0;
    color: #FFF;
    font-family: "PP Hatton", 'Manrope', 'Inter', serif;
    font-size: 22px;
    font-style: normal;
    font-weight: 500;
    line-height: 125%;
    letter-spacing: 0.3px;
}

/* Author */
.nearb-tip-card__author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nearb-tip-card__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.nearb-tip-card__author-name {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
}

/* ===========================================
   TOAST NOTIFICATIONS
   =========================================== */

.nearb-toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.nearb-toast {
    background: #191923;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: nearb-toast-in 0.3s ease-out;
    pointer-events: auto;
}

.nearb-toast--success {
    background: #059669;
}

.nearb-toast--error {
    background: #dc2626;
}

.nearb-toast.is-hiding {
    animation: nearb-toast-out 0.2s ease-in forwards;
}

@keyframes nearb-toast-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes nearb-toast-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* ===========================================
   MOBILE STYLES
   =========================================== */

.nearb-tip-directory .nearb-mobile-fab {
    position: fixed;
    bottom: 100px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    border: none !important;
    background: #000 !important;
    color: #fff !important;
    padding: 14px 28px;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 400 !important;
    cursor: pointer;
    box-shadow: 0 15px 30px rgba(0,0,0,0.25);
    display: none;
    z-index: 400;
    font-family: 'Manrope', 'Inter', sans-serif;
    appearance: none;
}

.nearb-tip-directory .nearb-mobile-fab-content {
    display: inline-flex;
    gap: 12px;
    align-items: center;
}

.nearb-tip-directory .nearb-mobile-fab-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nearb-tip-directory .nearb-mobile-fab-icon::before {
    content: '';
    display: block;
    width: 24px;
    height: 24px;
    background-repeat: no-repeat;
    background-size: contain;
}

.nearb-tip-directory .nearb-mobile-fab[data-state="list"] .nearb-mobile-fab-icon::before {
    background-image: url('../icons/map-pin.svg');
}

.nearb-tip-directory .nearb-mobile-fab[data-state="map"] .nearb-mobile-fab-icon::before {
    background-image: url('../icons/fi_list.svg');
}

.nearb-tip-directory .nearb-mobile-fab-label {
    font-size: 16px;
    letter-spacing: 0.3px;
    font-weight: 400 !important;
}

.nearb-mobile-map-header {
    display: none;
    align-items: center;
    justify-content: flex-start;
    padding: 16px 20px;
    background: transparent;
    border-bottom: none;
}

.nearb-mobile-back {
    border: none !important;
    background: transparent !important;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600 !important;
    color: #191923 !important;
    cursor: pointer;
    padding: 0 !important;
}

.nearb-mobile-back-icon {
    width: 14px;
    height: 14px;
    border-left: 2px solid #191923;
    border-bottom: 2px solid #191923;
    transform: rotate(45deg);
    display: inline-block;
    margin-right: 2px;
}

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

@media (max-width: 1024px) {
    .nearb-tip-directory {
        flex-direction: column;
        padding: 24px 16px;
        min-height: auto;
    }

    .nearb-tip-directory__column--left,
    .nearb-tip-directory__column--right {
        max-width: 100%;
        width: 100%;
        flex-basis: 100%;
        max-height: none;
        overflow: visible;
    }

    .nearb-tip-directory__column--right {
        position: relative;
        width: 100%;
        height: auto;
        display: none;
    }

    .nearb-tip-directory__map {
        min-height: 70vh;
        height: auto;
    }

    .nearb-tip-directory__filters {
        flex-direction: column;
        padding: 20px;
        gap: 12px;
    }

    .nearb-tip-directory__filter:not(:last-child)::after {
        display: none;
    }

    .nearb-tip-filter-card {
        border: 1px solid #e2e6f0;
        border-radius: 12px;
        min-height: 64px;
        padding: 0 14px;
        gap: 12px;
    }

    .nearb-tip-filter-card .nearb-icon {
        padding: 0;
    }

    .nearb-tip-filter-card .nearb-icon:first-child,
    .nearb-tip-filter-card .nearb-icon:last-child {
        padding: 0;
    }

    .nearb-tip-directory__column--right .nearb-mobile-map-header {
        display: none;
    }

    .nearb-tip-directory .nearb-mobile-fab {
        display: inline-flex;
    }

    /* Show map state - like directory */
    .nearb-tip-directory--show-map .nearb-tip-directory__column--right {
        display: flex;
        flex-direction: column;
    }

    .nearb-tip-directory--show-map .nearb-tip-directory__column--left {
        display: none;
    }

    .nearb-tip-directory--show-map .nearb-mobile-map-header {
        display: flex;
    }

    .nearb-tip-directory__list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .nearb-tip-directory__column--left {
        padding: 12px;
    }

    .nearb-tip-card {
        height: 350px;
    }

    .nearb-tip-card__title {
        font-size: 18px;
    }
}

@media (min-width: 1025px) {
    .nearb-tip-directory .nearb-mobile-fab,
    .nearb-tip-directory .nearb-mobile-map-header,
    .nearb-tip-directory .nearb-mobile-back {
        display: none !important;
    }
}

/* ===========================================
   MAP POPUP OVERRIDES
   =========================================== */

.nearb-tip-popup .leaflet-popup-content-wrapper {
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 20px 30px rgba(0,0,0,0.15);
    overflow: hidden;
}

.nearb-tip-popup .leaflet-popup-content {
    margin: 0;
    width: 280px !important;
}

.nearb-tip-popup .leaflet-popup-close-button {
    display: none !important;
}

.nearb-tip-popup .nearb-tip-card {
    height: 320px;
    border-radius: 0;
}

.nearb-tip-popup .nearb-tip-card__title {
    font-size: 18px;
}
