/* ============================================================
   Whery — Travel Notebooks Styles (Trips & Favorites)
   ============================================================ */

/* ── Star Button ───────────────────────────────────────────── */
.site-star-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.4);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
    z-index: 10;
}

.site-star-btn:hover {
    transform: scale(1.1);
    background: rgba(0, 0, 0, 0.6);
}

.site-star-btn.saved {
    color: #f59e0b;
    /* Golden star */
}

/* ── Star Button - Outlined State ─────────────────────────────── */
.site-star-btn.not-saved {
    color: rgba(255, 255, 255, 0.4);
}

.site-star-btn.not-saved:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
}

/* ── Trip Modal ────────────────────────────────────────────── */
#trip-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 15, 30, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10000;
    /* Highest priority, above everything including the guide view */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

#trip-modal-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.trip-modal {
    background: var(--bg-card, #16213e);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    width: 100%;
    max-width: 400px;
    padding: 1.5rem 2rem 2rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    position: relative;
    animation: authSlideUp 0.28s cubic-bezier(0.33, 1, 0.68, 1) both;
}

.trip-list {
    max-height: 250px;
    overflow-y: auto;
    margin: 1.5rem 0;
    padding-right: 0.5rem;
}

.trip-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
}

.trip-list-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.trip-list-item:active {
    transform: scale(0.98);
}

.trip-list-item.selected {
    background: rgba(0, 82, 204, 0.2);
    border: 1px solid var(--accent, #0052cc);
}

.trip-create-box {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
    margin-top: 1rem;
}

.trip-modal input[type="text"] {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.3);
    /* Much more visible border */
    border-radius: 9px;
    color: #fff;
    font-size: 1rem;
    transition: all 0.2s ease;
    margin-top: 0.4rem;
}

.trip-modal input[type="text"]:focus {
    outline: none;
    border-color: #fff;
    /* White border on focus for max contrast */
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.trip-modal input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* ── General Buttons ───────────────────────────────────────── */
.btn-primary {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--accent, #0052cc);
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #003fa3;
}

.btn-primary:disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* ── Dashboard (My Trips) ──────────────────────────────────── */
.my-trips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.trip-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.trip-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.trip-delete-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(220, 38, 38, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
    font-size: 1rem;
    opacity: 0;
}

.trip-card:hover .trip-delete-btn {
    opacity: 1;
}

.trip-delete-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.trip-card-img {
    width: 100%;
    height: 140px;
    background: #2a3b5c;
    object-fit: cover;
}

.trip-card-content {
    padding: 1rem;
}

.trip-card-title {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.trip-card-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.trip-empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-secondary);
}

/* ── Trip Details View ─────────────────────────────────────── */
.trip-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
}

.trip-header h2 {
    margin-bottom: 0.2rem;
}

.trip-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ── Leaflet Map Customization ────────────────────────────── */
.trip-map-container {
    background: #111b2d;
    overflow: hidden;
}

.custom-trip-popup .leaflet-popup-content-wrapper {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.custom-trip-popup .leaflet-popup-content {
    margin: 0.75rem;
    line-height: 1.4;
}

.custom-trip-popup .leaflet-popup-tip {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

.leaflet-container {
    font-family: 'Outfit', sans-serif !important;
}

.leaflet-bar a {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.leaflet-bar a:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.leaflet-control-attribution {
    background: rgba(10, 15, 30, 0.6) !important;
    backdrop-filter: blur(4px);
    color: rgba(255, 255, 255, 0.4) !important;
}

.leaflet-control-attribution a {
    color: var(--accent) !important;
}

/* ── Residence & Map Controls ─────────────────────────────── */
.map-toolbar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.btn-map-control {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-map-control:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-map-control.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(0, 82, 204, 0.3);
}

.residence-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #fff;
    border-radius: 50%;
    border: 3px solid var(--accent);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    font-size: 1.2rem;
}

/* ── Colored Marker Pins ───────────────────────────────────── */
.custom-pin {
    display: flex;
    align-items: center;
    justify-content: center;
}

.pin-container {
    width: 30px;
    height: 30px;
    background: #fff;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    border: 2px solid #fff;
}

.pin-inner {
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    transform: rotate(45deg);
}

.custom-pin:hover .pin-container {
    transform: rotate(-45deg) scale(1.1);
}

/* ── Animations ─────────────────────────────────────────── */
@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.preview-marker {
    z-index: 1000 !important;
}