:root {
    --search-bar-height: 67px;
}

/* =========================
   SEARCH BAR
========================= */

.search-bar {
    width: 80%;
    height: var(--search-bar-height);
    background: linear-gradient(135deg, rgba(255,255,255,0.60), rgba(255,255,255,0.40));
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border-radius: 999px;
    display: flex;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.75);
    box-shadow:
        0 4px 6px -1px rgba(0,0,0,0.03),
        0 8px 24px rgba(0,0,0,0.05),
        0 0 0 1px rgba(255,255,255,0.7) inset;
    margin: 0 auto;
    transition: box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.search-bar:focus-within {
    background: linear-gradient(135deg, rgba(255,255,255,0.70), rgba(255,255,255,0.50));
    box-shadow:
        0 4px 6px -1px rgba(0,0,0,0.03),
        0 12px 32px rgba(0,0,0,0.07),
        0 0 0 1px rgba(255,255,255,0.85) inset;
    border-color: rgba(255,255,255,0.85);
}

/* =========================
   SEARCH ITEMS
========================= */

/* .search-item {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 28px;
    border-right: 1px solid rgba(0,0,0,0.06);
    cursor: pointer;
    position: relative;
    width: 100%;
} */

.search-item {
    flex: 1 1 0;
    min-width: 0;

    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;

    padding: 0 28px;
    border-right: 1px solid rgba(0,0,0,0.06);

    cursor: pointer;
    position: relative;
}

.search-item * {
    cursor: pointer;
}

.search-item:first-child {
    border-top-left-radius: 999px;
    border-bottom-left-radius: 999px;
}

.search-item:last-of-type {
    border-right: none;
}

.search-item:focus-within label {
    color: var(--accent);
}

.search-item:hover {
    background: rgba(0,0,0,0.025);
}

.search-item:first-child:hover {
    border-top-left-radius: 999px;
    border-bottom-left-radius: 999px;
}

.search-item label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
    letter-spacing: 0.02em;
    transition: color 0.2s ease;
}

.search-item input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.95rem;
    font-weight: 500;
    color: #111;
    height: 24px;
    line-height: 24px;
    padding: 0;
}

.search-item input:focus {
    outline: none;
    box-shadow: none;
    --tw-ring-shadow: 0 0 #0000;
    --tw-ring-color: transparent;
}

.search-item input::placeholder {
    color: #999;
    font-weight: 400;
}

/* =========================
   BUTTON
========================= */

.search-btn {
    height: calc(var(--search-bar-height) - 20px);
    padding: 0 28px;
    margin: 0 10px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dim));
    color: white;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 8px 24px var(--accent-glow);
    transition: transform 0.25s cubic-bezier(.22,1,.36,1),
                box-shadow 0.25s ease;
    position: relative;
    overflow: hidden;
}

.search-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.12) 100%);
    border-radius: inherit;
    pointer-events: none;
}

.search-btn:hover {
    transform: scale(1.04);
    box-shadow: 0 12px 32px var(--accent-glow);
}

.search-btn:active {
    transform: scale(0.97);
}

.refresh-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    backdrop-filter: blur(4px);
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 6px;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.refresh-btn:hover {
    background: rgba(255,255,255,0.85);
    transform: rotate(180deg);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* =========================
   DATE RANGE PICKER (search bar)
========================= */

.search-item-date {
    position: relative;
    user-select: none;
}

.dr-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    width: 100%;
    height: 24px;
}

.dr-placeholder {
    font-size: 0.96rem;
    color: #888;
}

.dr-value {
    font-size: 0.96rem;
    font-weight: 600;
    color: #222;
    display: none;
    font-variant-numeric: tabular-nums;
}

.dr-value.visible {
    display: inline;
}

.dr-placeholder.hidden {
    display: none;
}

.dr-chevron {
    font-size: 10px;
    color: #888;
    margin-left: auto;
    transition: transform 0.25s ease;
}

.search-item-date.active .dr-chevron {
    transform: rotate(180deg);
}

.dr-dropdown {
    position: fixed;
    top: 140px;
    left: 50%;
    transform: translateX(-50%) translateY(8px) scale(0.96);
    background: var(--bg-panel);
    border-radius: 20px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.2);
    padding: 24px;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.3s cubic-bezier(.22,1,.36,1);
    width: 360px;
    color: #222;
}

.dr-dropdown.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0) scale(1);
}

.dr-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.dr-nav {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--accent);
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.dr-nav:hover {
    background: rgba(0,0,0,0.06);
}

.dr-month-label {
    font-size: 16px;
    font-weight: 700;
    color: #222;
}

.dr-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
}

.dr-weekday {
    font-size: 12px;
    font-weight: 600;
    color: #888;
    padding: 8px 0;
    text-transform: uppercase;
}

.dr-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.dr-day:hover {
    background: rgba(0,0,0,0.06);
}

.dr-day.other-month {
    color: #ccc;
}

.dr-day.today {
    font-weight: 700;
    color: var(--accent);
}

.dr-day.in-range {
    background: rgba(59,111,212,0.10);
    border-radius: 0;
}

.dr-day.range-start {
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
}

.dr-day.range-end {
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
}

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

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

.dr-cal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.dr-clear,
.dr-close {
    padding: 8px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.2s ease;
}

.dr-clear {
    background: transparent;
    color: #888;
}

.dr-clear:hover {
    background: rgba(0,0,0,0.06);
    color: #d11a2a;
}

.dr-close {
    background: var(--accent);
    color: #fff;
}

.dr-close:hover {
    opacity: 0.85;
}

/* =========================
   EXPLORE-PAGE OVERRIDES
========================= */

#floating-search {
    position: sticky;
    top: 5px;
    width: 100%;
    padding: 0 2rem;
    margin-bottom: 2rem;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    z-index: 900;
}

#floating-search {
    transition: margin-left 0.4s cubic-bezier(.22,1,.36,1);
}
#floating-search .search-bar {
    transition: transform 0.4s cubic-bezier(.22,1,.36,1),
                width 0.4s cubic-bezier(.22,1,.36,1);   
}

.nav-links {
    transition: transform 0.4s cubic-bezier(.22,1,.36,1);
}

#navbar.merged .nav-links {
    transform: translateY(-300%);
}

#floating-search.merged {
    margin-left: 60px;
}

#floating-search.merged .search-bar {
    transform: scale(85%, 85%);
}

@media (max-width: 1550px) {

    #floating-search.merged {
        margin-left: 60px;
    }

    #floating-search.merged .search-bar {
        width: 70%;
    }
}

/* ===== RESPONSIVE SEARCHBAR ===== */
@media (max-width: 1280px) {
    #floating-search {
        width: min(900px, 94%);
        top: 60px;
    }
    .search-item {
        padding: 0 18px;
    }
    .search-btn {
        padding: 0 20px;
        font-size: 0.9rem;
    }
    .search-btn span {
        display: none;
    }
    .dr-dropdown {
        width: 320px;
    }
}

@media (max-width: 768px) {
    #floating-search {
        position: static;
        transform: none;
        width: 100%;
        opacity: 1;
        pointer-events: auto;
        padding: 12px;
        margin-top: 80px;
    }
    .search-bar {
        height: auto;
        flex-wrap: wrap;
        border-radius: 20px;
        padding: 8px;
        gap: 6px;
    }
    .search-item {
        flex: 1 1 45%;
        padding: 10px 14px;
        border-right: none;
        border-bottom: 1px solid rgba(0,0,0,0.06);
        min-width: 0;
    }
    .search-item:first-child {
        border-radius: 0;
    }
    .search-item:last-of-type {
        border-bottom: none;
    }
    .search-item label {
        font-size: 0.7rem;
        margin-bottom: 4px;
    }
    .search-item input {
        font-size: 0.85rem;
    }
    .search-btn {
        height: 44px;
        padding: 0 18px;
        flex: 1;
        font-size: 0.85rem;
        margin: 4px;
    }
    .search-btn span {
        display: inline;
    }
    .refresh-btn {
        width: 44px;
        height: 44px;
    }
    .dr-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        transform: translateY(100%);
        width: 100%;
        border-radius: 20px 20px 0 0;
        padding: 20px;
        max-height: 80vh;
        overflow-y: auto;
    }
    .dr-dropdown.active {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .search-item {
        flex: 1 1 100%;
        padding: 8px 12px;
    }
    .search-item:not(:last-of-type) {
        border-bottom: 1px solid rgba(0,0,0,0.06);
    }
    .search-btn {
        padding: 0 14px;
        font-size: 0.8rem;
        height: 40px;
    }
    .dr-dropdown {
        padding: 16px;
    }
}