/* view CSS */
.tribe-all-views .view-tabs {
    display: flex;
    margin-right: 10%;
}

.tribe-all-views .tab-button {
    border: 1px solid #D1D5DB;
    cursor: pointer;
    margin-right: 15px;
    color: #535353;
    font-size: 22px;
    border-radius:12px
}

.tribe-all-views .tab-button.active {
    background: #2D69CD;
    color: white;
    border-radius: 12px;
    padding: 10px;
}

.tribe-all-views .tab-button:hover {
    background: #2D69CD;
    color: white;
    border-radius: 12px;
    padding: 10px;
}

.tribe-all-views .view-pane {
    display: none;
}

.tribe-all-views .view-pane.active {
    display: block;
}

/* Sidebar container */
.filter-sidebar {
    position: fixed;
    top: 100px;
    left: -400px;
    width: 400px;
    max-height: 100vh;
    background: #fff;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.15);
    transition: left 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
    /* allow vertical scroll */
    overflow-x: hidden;
    /* no horizontal scroll */
    pointer-events: auto;
    border-radius: 0px 16px 16px 0px;

    /* Hide scrollbar */
    -ms-overflow-style: none;
    /* IE/Edge */
    scrollbar-width: none;
    /* Firefox */
}

.filter-sidebar::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari/Opera */
}

/* When active */
.filter-sidebar.active {
    left: 0;
    height: -webkit-fill-available;
}


/* Overlay */
body.filter-open::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
}

/* Header */
.filter-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.filter-header h4 {
    margin: 0;
    font-size: 20px;
    font-weight: bold;
    color: #004890;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: rgb(163, 163, 163) !important;
}

.close-btn:hover {
    background: none;
}

/* Filter groups */
.filter-group {
    margin-bottom: 20px;
}

.filter-group label {
    font-weight: 600;
    display: block;
    margin-bottom: 6px;
    color: #333;
}

.filter-group select,
.filter-group input[type="checkbox"] {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    position: relative;
    z-index: 1001;
}

/* Footer */
.filter-footer {
    margin-top: auto;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.btn {
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.btn.reset {
    background: #f5f5f5;
    border: 1px solid #ccc;
}

.btn.apply {
    background: #004890;
    color: #fff;
    border: none;
}

.filter-toggle-btn {
    border-radius: 0px 16px 16px 0px;
    color: rgb(128, 128, 128);
    border: 1px solid rgb(128, 128, 128);
    box-shadow: rgba(0, 0, 0, 0.15) 2px 0px 10px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: fixed;
    left: 0;
    height: -webkit-fill-available;
    padding-top: 40px;
}

.filter-toggle-btn:hover {
    background: transparent;
    color: black;
    cursor: pointer;
}

.filter-toggle-btn:active {
    background: transparent;
    color: black;
    cursor: pointer;
}

.icon {
    margin-bottom: 1em;
    font-size: larger;
}

.input-label {
    color: rgb(128, 128, 128);
}

.form-input {
    border: 1px solid rgb(128, 128, 128);
    border-radius: 6px;
    padding: 5px;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.filter-label {
    font-size: 14px;
    font-weight: 500;
    color: #444;
}

/* Toggle switch */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.switch input {
    display: none;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 30px;
    transition: 0.3s;
}

.slider::before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.switch input:checked+.slider {
    background-color: #004890;
}

.switch input:checked+.slider::before {
    transform: translateX(18px);
}

/* Options below */
.options {
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    /* disabled by default */
    opacity: 0.5;
}

.option {
    flex: 1;
    margin: 0 2px;
    padding: 6px 0;
    border: none;
    border-radius: 6px;
    background: #f5f5f5;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.option.active {
    background: #004890;
    color: #fff;
}

.option:hover {
    background: #ddd;
}

/* Enable options when toggle ON */
#status-toggle:checked~.options,
#delivery-toggle:checked~.options,
#hrd-toggle:checked~.options,
#cpe-toggle:checked~.options {
    pointer-events: auto;
    opacity: 1;
}

.date-range {
    border: 1px solid lightgray !important;
    border-radius: 6px;
    color: #666;
}

.filter-submit {
    border-radius: 12px;
    background-color: #004890;
    color: white;
    border: none;
}

.filter-submit:hover {
    background-color: #003366;
    color: white;
}

.filter-submit:active {
    background-color: #002244;
    color: white;
}

#tribe-events-pg-template {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
}

/* Hide the mobile-only topbar by default (desktop first); will show in the mobile media query */
.mobile-topbar{display:none !important}
.desktop-header{display:flex}
/* keep existing desktop styles as-is; add mobile adjustments below */
.filter-toggle-btn{display:inline-flex;position:fixed;left:0;top:26rem;z-index:10 !important;background:#fff;border-radius:8px;padding:10px;border:1px solid #e1e1e1;box-shadow:0 2px 6px rgba(0,0,0,.08)}
.filter-sidebar{transition:transform .25s ease,opacity .2s ease;}

/* Basic affordances to ensure views behave when JS is not present */
.view-pane{display:block}
.view-pane.active{display:block}

/* Desktop: preserve original wide margins */
.view-content{margin-left:100px;margin-right:100px}

/* Mobile rules */
@media (max-width: 768px){
    .filter-toggle-btn{display:inline-flex}
    .filter-sidebar{position:fixed;top:0;left:0;height:100vh;width:320px;max-width:92vw;background:#fff;z-index:1200;overflow:auto;padding:1rem 1rem;box-shadow:2px 0 12px rgba(0,0,0,.15);transform:translateX(-110%);opacity:0}
    .filter-sidebar.open{transform:translateX(0);opacity:1}
    .tribe-all-views h2{margin-left:0;font-size:28px}
    /* View tabs: span full width and wrap */
    .view-tabs{width:100%;display:flex;gap:.25rem;justify-content:flex-end}
    .view-tabs .tab-button{padding:.5rem .6rem}
    /* Make content stretch edge-to-edge on mobile */
    .view-content{margin: 0px !important}
    /* Ensure calendar/list/photo panes flow naturally */
    .view-pane{display:none}
    .view-pane.active{display:block}
    /* Make footer buttons and controls fit */
    .filter-footer{padding-bottom:2rem}
    /* Mobile topbar (compact) */
    .desktop-header{display:none !important}
    .mobile-topbar{display:flex !important;padding:8px 12px;background:transparent;align-items:center;justify-content:space-between;gap:8px}
    .mobile-left{display:flex;align-items:center;gap:.35rem}
    .mobile-filter-btn{display:inline-flex;align-items:center;gap:.35rem;border:0;background:transparent;color:#666;font-weight:600;padding:6px 8px;border-radius:8px}
    .mobile-filter-btn i{font-size:18px}
    .mobile-filter-text{display:inline-block;margin-left:6px}
    .mobile-filter-count{background:#1f66d8;color:#fff;padding:6px 8px;border-radius:999px;font-weight:700;font-size:14px;min-width:36px;text-align:center}
    .mobile-clear{display:inline-flex;align-items:center;padding:0 6px;margin-left:6px}
    .mobile-divider{height:28px;width:1px;background:rgba(0,0,0,0.08);margin-left:8px;margin-right:8px}

    /* View buttons */
    .mobile-views{display:flex;align-items:center;gap:.5rem}
    .mobile-view-btn{width:56px;height:56px;border-radius:12px;border:0;background:transparent;color:#fff;display:flex;align-items:center;justify-content:center;font-size:20px}
    .mobile-view-btn.active{background:#2f66d7;box-shadow:0 4px 14px rgba(47,102,215,.22);width:56px;height:56px;border-radius:16px}
    .mobile-small-view-btn{width:44px;height:44px;border-radius:8px;border:1px solid rgba(0,0,0,.08);background:#fff;display:flex;align-items:center;justify-content:center;font-size:16px;color:#666}

    /* hide the earlier floating filter button that appears at top-left — we now use the compact one */
    .filter-toggle-btn{display:none}
}