:root {
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(226, 232, 240, 0.82);
}

.premium-glass {    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--glass-border);
}

/* DataTables Overrides for Card Grid */
#clinic-data-table {
    border: none !important;
    width: 100% !important;
}
#clinic-data-table thead { display: none; }
#clinic-grid-body {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}
@media (min-width: 1024px) {
    #clinic-grid-body {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
.glass-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.hidden {
    display: none !important;
}

/* 
   CRITICAL: display: contents on tr and td allows the cards to be direct 
   children of the grid, preventing layout distortion during DataTables updates.
*/
#clinic-grid-body tr, 
#clinic-grid-body td {
    display: contents;
}

/* Ensure empty state row spans full width */
.dataTables_empty-wrapper {
    grid-column: 1 / -1;
    width: 100%;
}
.dataTables_wrapper .dataTables_info {
    display: none;
}
.dataTables_wrapper .dataTables_paginate {
    display: none !important;
}

.paginate-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    color: #475569;
    font-weight: 700;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}
.paginate-btn:hover {
    border-color: #93c5fd;
    color: #2563eb;
}
.paginate-btn:active {
    transform: scale(0.95);
}
.paginate-btn:disabled {
    opacity: 0.3;
    pointer-events: none;
}
.paginate-btn.active {
    border-color: #2563eb;
    background-color: #2563eb;
    color: #ffffff;
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.2), 0 4px 6px -4px rgba(59, 130, 246, 0.1);
}

/* Treatment badge filter active state */
.badge-filter-btn.active > div:last-child {
    border-color: #3b82f6 !important;
    background-color: #ffffff !important;
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.1), 0 4px 6px -4px rgba(59, 130, 246, 0.1);
    transform: scale(1.05) translateY(-2px);
}

.badge-filter-btn.active:not(:has(img)) {
    background-color: #ffffff;
    color: #3b82f6;
    border: 2px solid #3b82f6;
}

.badge-filter-btn img {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}


.leaflet-tile {
    filter: saturate(0.8) contrast(1.1) brightness(1.05);
}
.leaflet-control-attribution {
    background: rgba(255,255,255,0.7) !important;
    color: #94a3b8 !important;
    font-size: 8px !important;
}

/* Suggestions Dropdown */
#location-suggestions-container {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    z-index: 9999;
    overflow: hidden;
    display: none;
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.suggestion-item {
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid rgba(241, 245, 249, 0.5);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.suggestion-item:last-child { border-bottom: none; }

/* Robust Search Bar Layout (Framework Independent) */
/* Robust Search Bar Layout - Unified Boxed Group + Separate Button */
.cf-search-bar {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
    background: transparent;
}

@media (min-width: 992px) {
    .cf-search-bar {
        flex-direction: row;
        align-items: center;
    }
}

/* The boxed group containing the 4 dropdowns */
.cf-filters-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    background: #f0f0f0; 
    border: 2px solid #4a4a4a; 
    border-radius: 0;
    overflow: hidden;
}

@media (min-width: 768px) {
    .cf-filters-group {
        flex-direction: row;
    }
}

.cf-search-item {
    flex: 1;
    position: relative;
    border-bottom: 2px solid #4a4a4a;
    min-height: 42px; /* Streamlined height */
    background: transparent;
    transition: background 0.2s ease;
}

@media (min-width: 768px) {
    .cf-search-item {
        border-bottom: 0;
        border-right: 2px solid #4a4a4a;
    }
    .cf-search-item:last-child {
        border-right: 0;
    }
}

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

.cf-search-item select {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none !important;
    padding: 0 30px 0 12px !important; /* Vertically centred — no label offset */
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #1a202c !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    appearance: none !important;
    -webkit-appearance: none !important;
    outline: none !important;
    position: relative;
    z-index: 5;
    line-height: 1.2;
}

.cf-search-item .select-arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #8b6a95;
    font-size: 12px;
    line-height: 1;
    z-index: 10;
    user-select: none;
}

/* Search Button - Separate with rounded corners */
.cf-search-btn {
    background: #8b6a95 !important; /* Purple button */
    color: #ffffff !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 0 25px !important;
    height: 42px;
    width: 140px;       /* Fixed width — never reflows */
    flex-shrink: 0;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
    cursor: pointer;
    transition: background 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px !important;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.cf-search-btn:hover {
    background: #7a5a84 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 106, 149, 0.25);
}

@media (max-width: 991.98px) {
    .cf-search-btn {
        width: 100% !important;
    }
}

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

/* Loading state — CSS-only spinner, no DOM change, no size change */
.cf-search-btn.is-loading {
    cursor: wait !important;
    pointer-events: none;
}

.cf-search-btn.is-loading > * {
    opacity: 0; /* Hide icon and text without removing them */
}

.cf-search-btn.is-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: cf-spin 0.7s linear infinite;
}

@keyframes cf-spin {
    to { transform: rotate(360deg); }
}

/* Disabled state — shown when no filter is selected */
.cf-search-btn:disabled,
.cf-search-btn--disabled {
    background: #c9b8cf !important; /* Muted purple — clearly inactive */
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.7;
}

.cf-search-btn:disabled:hover,
.cf-search-btn--disabled:hover {
    background: #c9b8cf !important;
    transform: none !important;
    box-shadow: none !important;
}

.cf-search-icon {
    width: 14px;
    height: 14px;
    stroke-width: 3;
}

/* Skeleton Loading State */
.cf-search-item.is-loading {
    position: relative;
    overflow: hidden;
}

.cf-search-item.is-loading select,
.cf-search-item.is-loading .select-arrow {
    opacity: 0.2 !important;
}

.cf-search-item.is-loading::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: skeleton-shimmer 2.5s infinite ease-in-out;
    z-index: 1;
}

@keyframes skeleton-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Centers the helper text below */
.text-center p {
    color: #718096;
    font-size: 15px;
    line-height: 1.6;
}
