/* =====================================================
   EasyHealths Carousel Pro - Frontend + Dashboard
   High specificity to override Listeo theme styles
   ===================================================== */

/* ---------- Loading ---------- */
.eh-slot-wrapper .eh-loading {
    text-align: center;
    padding: 40px 16px;
    color: #64748b;
}
.eh-slot-wrapper .eh-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e2e8f0;
    border-top-color: #0ea5e9;
    border-radius: 50%;
    animation: ehspin 0.7s linear infinite;
    margin: 0 auto 10px;
}
@keyframes ehspin {
    to { transform: rotate(360deg); }
}

/* ---------- Tabs ---------- */
.eh-clinics-carousel .eh-tabs {
    display: flex !important;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}
.eh-clinics-carousel .eh-tabs::-webkit-scrollbar { display: none; }
.eh-clinics-carousel .eh-tab {
    flex: 0 0 auto;
    background: none;
    border: none;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
}
.eh-clinics-carousel .eh-tab.active {
    color: #0f172a;
    font-weight: 600;
}
.eh-clinics-carousel .eh-tab.active::after {
    content: '';
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: -1px;
    height: 2px;
    background: #0ea5e9;
    border-radius: 2px 2px 0 0;
}

/* ---------- Track & Cards ---------- */
.eh-clinics-carousel .eh-track-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding: 6px 2px 14px;
}
.eh-clinics-carousel .eh-track-wrap::-webkit-scrollbar { display: none; }
.eh-clinics-carousel .eh-track {
    display: flex !important;
    gap: 14px;
    min-width: min-content;
}
.eh-clinics-carousel .eh-card {
    flex: 0 0 auto;
    width: 158px;
    background: #fff;
    border-radius: 16px;
    padding: 16px 12px 14px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.04);
    scroll-snap-align: start;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none !important;
    color: inherit !important;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}
.eh-clinics-carousel .eh-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.eh-clinics-carousel .eh-logo {
    width: 80px;
    height: 80px;
    border-radius: 14px;
    overflow: hidden;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    border: 1px solid #f1f5f9;
}
.eh-clinics-carousel .eh-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
}
.eh-clinics-carousel .eh-ph { font-size: 28px; }
.eh-clinics-carousel .eh-name {
    font-size: 13px;
    font-weight: 600;
    color: #0f766e;
    line-height: 1.3;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 34px;
}
.eh-clinics-carousel .eh-dist {
    font-size: 12px;
    color: #64748b;
}
.eh-clinics-carousel .eh-view-all {
    margin-top: 4px;
    padding-left: 4px;
}
.eh-clinics-carousel .eh-view-all a {
    font-size: 14px;
    font-weight: 600;
    color: #0f766e;
    text-decoration: none;
}
.eh-clinics-carousel .eh-empty {
    text-align: center;
    color: #94a3b8;
    padding: 30px 16px;
    width: 100%;
}

/* =====================================================
   OWNER DASHBOARD - Modern Grid Design
   ===================================================== */
.eh-dashboard {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px 40px;
    color: #0f172a;
    box-sizing: border-box;
}
.eh-dashboard *,
.eh-dashboard *::before,
.eh-dashboard *::after {
    box-sizing: border-box;
}

/* Header */
.eh-dashboard .eh-dash-top {
    display: flex !important;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 28px;
}
.eh-dashboard .eh-dash-title {
    font-size: 26px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin: 0 0 4px !important;
    line-height: 1.2 !important;
}
.eh-dashboard .eh-dash-sub {
    color: #64748b !important;
    margin: 0 !important;
    font-size: 14px !important;
}
.eh-dashboard .eh-plan-box {
    display: flex !important;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.eh-dashboard .eh-badge {
    display: inline-flex !important;
    align-items: center;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}
.eh-dashboard .eh-badge.success {
    background: #dcfce7 !important;
    color: #166534 !important;
}
.eh-dashboard .eh-badge.danger {
    background: #fee2e2 !important;
    color: #991b1b !important;
}
.eh-dashboard .eh-expiry {
    font-size: 13px;
    color: #64748b;
}
.eh-dashboard .eh-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none !important;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}
.eh-dashboard .eh-btn.primary {
    background: #0ea5e9 !important;
    color: #fff !important;
}
.eh-dashboard .eh-btn.primary:hover {
    background: #0284c7 !important;
}

/* ===== Metrics Grid ===== */
.eh-dashboard .eh-metrics {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 16px !important;
    margin-bottom: 28px !important;
}
@media (max-width: 900px) {
    .eh-dashboard .eh-metrics {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}
@media (max-width: 600px) {
    .eh-dashboard .eh-metrics {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
.eh-dashboard .eh-metric-card {
    background: #ffffff !important;
    border-radius: 16px !important;
    padding: 18px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06) !important;
    border: 1px solid #f1f5f9 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 14px !important;
    margin: 0 !important;
}
.eh-dashboard .eh-metric-icon {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    border-radius: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 20px !important;
    flex-shrink: 0 !important;
}
.eh-dashboard .eh-metric-icon.views  { background: #e0f2fe !important; }
.eh-dashboard .eh-metric-icon.clicks { background: #fce7f3 !important; }
.eh-dashboard .eh-metric-icon.ctr    { background: #d1fae5 !important; }
.eh-dashboard .eh-metric-icon.funds  { background: #fef3c7 !important; }
.eh-dashboard .eh-metric-icon.active { background: #ede9fe !important; }
.eh-dashboard .eh-metric-body {
    display: flex !important;
    flex-direction: column !important;
}
.eh-dashboard .eh-metric-value {
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    line-height: 1.2 !important;
    margin: 0 !important;
}
.eh-dashboard .eh-metric-label {
    font-size: 12px !important;
    color: #64748b !important;
    margin-top: 2px !important;
    line-height: 1.3 !important;
}

/* Alert */
.eh-dashboard .eh-alert {
    padding: 14px 18px !important;
    border-radius: 12px !important;
    margin-bottom: 24px !important;
    font-size: 14px !important;
}
.eh-dashboard .eh-alert.warning {
    background: #fff7ed !important;
    border: 1px solid #fed7aa !important;
    color: #9a3412 !important;
}

/* Section cards */
.eh-dashboard .eh-section {
    background: #ffffff !important;
    border-radius: 16px !important;
    padding: 22px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06) !important;
    border: 1px solid #f1f5f9 !important;
    margin-bottom: 24px !important;
}
.eh-dashboard .eh-section-head {
    margin-bottom: 16px !important;
}
.eh-dashboard .eh-section-head h2 {
    font-size: 18px !important;
    font-weight: 700 !important;
    margin: 0 !important;
    color: #0f172a !important;
}

/* Table */
.eh-dashboard .eh-table-wrap {
    overflow-x: auto;
}
.eh-dashboard .eh-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 14px !important;
}
.eh-dashboard .eh-table th {
    text-align: left !important;
    padding: 10px 12px !important;
    color: #64748b !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.03em !important;
    border-bottom: 1px solid #e2e8f0 !important;
    background: transparent !important;
}
.eh-dashboard .eh-table td {
    padding: 12px !important;
    border-bottom: 1px solid #f1f5f9 !important;
    color: #334155 !important;
}
.eh-dashboard .eh-status {
    display: inline-block !important;
    padding: 3px 10px !important;
    border-radius: 20px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: capitalize !important;
}
.eh-dashboard .eh-status.active { background: #dcfce7 !important; color: #166534 !important; }
.eh-dashboard .eh-status.pending_payment { background: #fef3c7 !important; color: #92400e !important; }
.eh-dashboard .eh-status.expired { background: #fee2e2 !important; color: #991b1b !important; }
.eh-dashboard .eh-empty-state {
    text-align: center;
    color: #94a3b8;
    padding: 30px;
}

/* Create Form */
.eh-dashboard .eh-form-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
}
@media (max-width: 600px) {
    .eh-dashboard .eh-form-grid {
        grid-template-columns: 1fr !important;
    }
}
.eh-dashboard .eh-field {
    margin: 0 !important;
}
.eh-dashboard .eh-field.full {
    grid-column: 1 / -1 !important;
}
.eh-dashboard .eh-field label {
    display: block !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #334155 !important;
    margin-bottom: 6px !important;
}
.eh-dashboard .eh-field input,
.eh-dashboard .eh-field select {
    width: 100% !important;
    padding: 10px 12px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    background: #fff !important;
    color: #0f172a !important;
    height: auto !important;
    line-height: 1.4 !important;
}
.eh-dashboard .eh-field input:focus,
.eh-dashboard .eh-field select:focus {
    outline: none !important;
    border-color: #0ea5e9 !important;
    box-shadow: 0 0 0 3px rgba(14,165,233,0.15) !important;
}
.eh-dashboard .eh-form-msg {
    margin-left: 12px;
    font-weight: 500;
    font-size: 14px;
}

/* Listing suggestions */
.eh-dashboard .eh-listing-suggestions {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
    gap: 10px !important;
    margin-top: 8px;
    max-height: 220px;
    overflow-y: auto;
    padding: 4px;
}
.eh-dashboard .eh-listing-chip {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    font-size: 13px;
}
.eh-dashboard .eh-listing-chip:hover,
.eh-dashboard .eh-listing-chip.selected {
    border-color: #0ea5e9;
    background: #f0f9ff;
}
.eh-dashboard .eh-listing-chip input {
    width: auto !important;
    margin: 0 !important;
}
.eh-dashboard .eh-listing-chip img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
}
.eh-dashboard .eh-price-preview {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px;
    color: #0369a1;
    margin-top: 8px;
}

@media (max-width: 480px) {
    .eh-clinics-carousel .eh-card { width: 140px; }
    .eh-clinics-carousel .eh-logo { width: 70px; height: 70px; }
}

/* Region selector ABOVE tabs (works on any wrapper: slot or single carousel) */
.eh-region-top {
    display: flex !important;
    justify-content: flex-start;
    margin-bottom: 14px;
    position: relative;
    z-index: 5;
}
.eh-region-top.eh-region-hidden {
    display: none !important;
}
.eh-region-combo {
    position: relative;
    min-width: 200px;
    max-width: 280px;
    width: 100%;
}
.eh-region-input {
    padding: 8px 32px 8px 12px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    font-size: 13px !important;
    background: #fff !important;
    width: 100%;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
    cursor: pointer;
}
.eh-region-input:focus {
    outline: none !important;
    border-color: #0ea5e9 !important;
    box-shadow: 0 0 0 3px rgba(14,165,233,0.15) !important;
}
.eh-region-caret {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    font-size: 11px;
}
.eh-region-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 220px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 20;
}
.eh-region-combo.open .eh-region-dropdown {
    display: block;
}
.eh-region-option {
    padding: 9px 14px;
    font-size: 13px;
    color: #334155;
    cursor: pointer;
}
.eh-region-option:hover {
    background: #f0f9ff;
}
.eh-region-option.is-selected {
    background: #e0f2fe;
    font-weight: 600;
    color: #0369a1;
}

/* Dashboard extras */
.eh-dashboard .eh-funds-row { }
.eh-dashboard .eh-funds-btns {
    display: flex !important;
    flex-wrap: wrap;
    gap: 10px;
}
.eh-dashboard .eh-funds-btns .eh-btn {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border: 1px solid #e2e8f0 !important;
}
.eh-dashboard .eh-funds-btns .eh-btn:hover {
    background: #e0f2fe !important;
    border-color: #0ea5e9 !important;
}
.eh-dashboard .eh-btn-sm {
    display: inline-flex !important;
    padding: 5px 12px !important;
    border-radius: 8px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    border: 1px solid #e2e8f0 !important;
    background: #f8fafc !important;
    color: #334155 !important;
    cursor: pointer;
}
.eh-dashboard .eh-btn-sm:hover {
    background: #e0f2fe !important;
    border-color: #0ea5e9 !important;
}
.eh-dashboard .eh-status.paused {
    background: #fef3c7 !important;
    color: #92400e !important;
}
.eh-dashboard .eh-actions {
    white-space: nowrap;
}

.eh-dashboard .eh-fund-link {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border: 1px solid #e2e8f0 !important;
    text-decoration: none !important;
}
.eh-dashboard .eh-fund-link:hover {
    background: #e0f2fe !important;
    border-color: #0ea5e9 !important;
}

/* Tab filter: must beat display:flex !important on .eh-card */
.eh-clinics-carousel .eh-card.is-hidden,
.eh-clinics-carousel a.eh-card.is-hidden,
.eh-clinics-carousel div.eh-card.is-hidden {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

.eh-clinics-carousel .eh-subtitle {
    font-size: 11px !important;
    line-height: 1.35 !important;
    color: #64748b !important;
    text-align: center !important;
    margin-top: 4px !important;
    padding: 0 4px !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden !important;
    max-width: 100%;
    font-weight: 500 !important;
}
