/* ==========================================================================
   CDH Client — Frontend Styles
   ========================================================================== */

/* ---------- Shared / Utilities ---------- */

.cdh-cta-btn {
    display: inline-block;
    padding: 8px 20px;
    background: #1a7f37;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: background .2s;
    line-height: 1.4;
}
.cdh-cta-btn:hover {
    background: #15692e;
    color: #fff;
    text-decoration: none;
}
.cdh-cta-btn.cdh-cta-sm {
    padding: 5px 14px;
    font-size: 12px;
}

.cdh-section-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 16px;
}

.cdh-visit-link {
    display: inline-block;
    text-decoration: none;
}

/* Wagering badges */
.cdh-wager-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}
.cdh-wager-green  { background: #d4edda; color: #155724; }
.cdh-wager-yellow { background: #fff3cd; color: #856404; }
.cdh-wager-red    { background: #f8d7da; color: #721c24; }

.cdh-bonus-code {
    display: inline-block;
    padding: 2px 8px;
    background: #f0f0f0;
    border: 1px dashed #999;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
}

.cdh-check { color: #1a7f37; font-weight: 700; }
.cdh-cross { color: #cf222e; }

.cdh-casino-logo-sm {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 4px;
    vertical-align: middle;
}

.cdh-meta-item {
    display: inline-block;
    padding: 2px 8px;
    background: #f5f5f5;
    border-radius: 4px;
    font-size: 12px;
    margin-right: 4px;
    margin-bottom: 4px;
}

/* ---------- Bonus Table ---------- */

.cdh-bonus-table-wrap {
    overflow-x: auto;
    margin: 16px 0;
    -webkit-overflow-scrolling: touch;
}

.cdh-bonus-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.cdh-bonus-table thead {
    background: #f8f9fa;
}

.cdh-bonus-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #555;
    border-bottom: 2px solid #e0e0e0;
    white-space: nowrap;
}

.cdh-bonus-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.cdh-bonus-table tbody tr:hover {
    background: #f8fbff;
}

.cdh-bonus-table .cdh-col-casino {
    white-space: nowrap;
}

.cdh-casino-link {
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
}

.cdh-casino-name {
    font-weight: 500;
}

.cdh-bonus-table .cdh-col-cta {
    text-align: center;
}

/* ---------- Casino Card ---------- */

.cdh-casino-card {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    margin: 16px 0;
    background: #fff;
}

.cdh-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.cdh-card-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 8px;
    flex-shrink: 0;
}

.cdh-card-compact .cdh-card-logo {
    width: 48px;
    height: 48px;
}

.cdh-card-title-wrap {
    flex: 1;
}

.cdh-card-title {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 700;
}

.cdh-card-rating {
    font-size: 14px;
    color: #666;
}

.cdh-rating-value {
    font-weight: 700;
    color: #1a7f37;
    font-size: 18px;
}

/* Bonus pills */
.cdh-card-bonuses {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.cdh-bonus-pill {
    display: flex;
    flex-direction: column;
    flex: 1 1 180px;
    padding: 10px 14px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    background: #fafafa;
    min-width: 0;
}

.cdh-pill-type {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #888;
    font-weight: 600;
    margin-bottom: 2px;
}

.cdh-pill-text {
    font-size: 13px;
    font-weight: 600;
    color: #222;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Detail pills with popover */
.cdh-card-details {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.cdh-detail-pill {
    display: inline-block;
    padding: 4px 10px;
    background: #eef6ff;
    border-radius: 14px;
    font-size: 12px;
    color: #2b6cb0;
    cursor: help;
    position: relative;
}

.cdh-detail-pill .cdh-popover {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
}

.cdh-detail-pill .cdh-popover::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
}

.cdh-detail-pill.cdh-popover-active .cdh-popover {
    display: block;
}

/* Highlights */
.cdh-card-highlights {
    list-style: none;
    padding: 0;
    margin: 0 0 14px;
}

.cdh-card-highlights li {
    position: relative;
    padding: 3px 0 3px 18px;
    font-size: 13px;
    color: #444;
}

.cdh-card-highlights li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    color: #1a7f37;
    font-weight: 700;
}

/* Payment logos in card */
.cdh-card-payments {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.cdh-card-payment-logo {
    width: 36px;
    height: 24px;
    object-fit: contain;
    border: 1px solid #eee;
    border-radius: 3px;
    padding: 2px;
}

/* Card CTA */
.cdh-card-cta {
    text-align: center;
    margin-top: 10px;
}

.cdh-card-cta .cdh-cta-btn {
    width: 100%;
    max-width: 280px;
    padding: 10px 24px;
    font-size: 15px;
}

/* ---------- Casino List ---------- */

.cdh-casino-list-wrap {
    margin: 16px 0;
}

/* Controls: filter chips + sort */
.cdh-list-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.cdh-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cdh-chip {
    padding: 5px 14px;
    border: 1px solid #d0d0d0;
    border-radius: 20px;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: all .15s;
    color: #555;
}

.cdh-chip:hover {
    border-color: #1a7f37;
    color: #1a7f37;
}

.cdh-chip.cdh-chip-active {
    background: #1a7f37;
    border-color: #1a7f37;
    color: #fff;
}

.cdh-sort-wrap select {
    padding: 5px 10px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
}

/* List rows */
.cdh-casino-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cdh-casino-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    background: #fff;
    transition: box-shadow .15s;
}

.cdh-casino-row:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.cdh-casino-row.cdh-row-hidden {
    display: none;
}

.cdh-row-logo {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
}

.cdh-row-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.cdh-row-info {
    flex: 1;
    min-width: 0;
}

.cdh-row-name {
    margin: 0 0 2px;
    font-size: 15px;
    font-weight: 600;
}

.cdh-row-bonus {
    margin: 0;
    font-size: 13px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cdh-row-rating {
    flex-shrink: 0;
    text-align: center;
}

.cdh-rating-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1a7f37;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
}

.cdh-row-cta {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.cdh-row-min-dep {
    font-size: 11px;
    color: #888;
}

/* ---------- Payments Table ---------- */

.cdh-payments-table-wrap {
    overflow-x: auto;
    margin: 16px 0;
}

.cdh-payments-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.cdh-payments-table thead {
    background: #f8f9fa;
}

.cdh-payments-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #555;
    border-bottom: 2px solid #e0e0e0;
    white-space: nowrap;
}

.cdh-payments-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.cdh-payments-table tbody tr:hover {
    background: #f8fbff;
}

.cdh-pm-name {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.cdh-pm-logo {
    width: 28px;
    height: 20px;
    object-fit: contain;
}

/* ---------- Casino Grid (payment-casinos, provider-casinos) ---------- */

.cdh-casino-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.cdh-casino-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 12px;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    background: #fff;
    text-align: center;
    transition: box-shadow .15s;
}

.cdh-casino-grid-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.cdh-grid-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 6px;
}

.cdh-grid-name {
    font-size: 13px;
    font-weight: 600;
}

.cdh-grid-rating {
    font-size: 12px;
    color: #1a7f37;
    font-weight: 600;
}

.cdh-grid-games {
    font-size: 11px;
    color: #888;
}

/* ---------- Bonus Cards (provider-bonuses) ---------- */

.cdh-bonus-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.cdh-bonus-card {
    padding: 16px;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cdh-bonus-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.cdh-bonus-card-headline {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #222;
}

.cdh-bonus-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.cdh-bonus-card .cdh-cta-btn {
    margin-top: auto;
    align-self: flex-start;
}

/* ---------- Bonus Tiers (multi-tier) ---------- */

.cdh-bonus-tiers { margin-top: 10px; }
.cdh-bonus-tier { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; }
.tier-level { font-weight: 700; color: #1e40af; min-width: 60px; }
.tier-code { background: #f3f4f6; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-family: monospace; }
.tier-desc { color: #4b5563; }
.cdh-tier-count { font-size: 11px; color: #6b7280; font-weight: 400; }
.cdh-bonus-tiers-codes { display: flex; flex-wrap: wrap; gap: 4px; }
.cdh-bonus-tiers-row td { padding: 0 12px 10px; border-bottom: 1px solid #eee; background: #fafbfc; }

/* ---------- Calendar ---------- */

.cdh-calendar-wrap {
    margin: 16px 0;
}

.cdh-calendar-title {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 12px;
}

.cdh-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e0e0e0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.cdh-cal-header {
    background: #f0f0f0;
    padding: 8px 4px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #555;
}

.cdh-cal-empty {
    background: #fafafa;
    min-height: 80px;
}

.cdh-cal-day {
    background: #fff;
    min-height: 80px;
    padding: 4px 6px;
    position: relative;
}

.cdh-cal-day-num {
    font-size: 12px;
    font-weight: 600;
    color: #888;
}

.cdh-cal-today {
    background: #f0faf4;
}

.cdh-cal-today .cdh-cal-day-num {
    color: #1a7f37;
    font-weight: 700;
}

.cdh-cal-has-offer {
    border-left: 3px solid #1a7f37;
}

.cdh-cal-offer {
    margin-top: 4px;
    padding: 3px 4px;
    background: #eef6ff;
    border-radius: 4px;
    font-size: 10px;
    line-height: 1.3;
}

.cdh-cal-casino {
    font-weight: 600;
    display: block;
    color: #555;
}

.cdh-cal-offer-title {
    display: block;
    color: #222;
}

.cdh-cal-offer-value {
    display: block;
    font-weight: 700;
    color: #1a7f37;
}

.cdh-cal-offer-link {
    display: inline;
    color: #1a7f37;
    text-decoration: none;
    font-weight: 700;
}

/* ---------- Today Offers ---------- */

.cdh-today-offers {
    margin: 16px 0;
}

.cdh-today-offer {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    background: #fff;
    margin-bottom: 8px;
}

.cdh-today-offer-logo {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
}

.cdh-today-offer-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
}

.cdh-today-offer-content {
    flex: 1;
    min-width: 0;
}

.cdh-today-casino {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.cdh-today-title {
    display: block;
    font-size: 15px;
    margin: 2px 0 4px;
}

.cdh-today-desc {
    margin: 0 0 4px;
    font-size: 13px;
    color: #555;
}

.cdh-today-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.cdh-today-value {
    background: #d4edda;
    color: #155724;
    font-weight: 600;
}

.cdh-today-offer-cta {
    flex-shrink: 0;
}

/* ---------- Compare Table ---------- */

.cdh-compare-wrap {
    overflow-x: auto;
    margin: 16px 0;
}

.cdh-compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.cdh-compare-table th,
.cdh-compare-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #eee;
    text-align: center;
    vertical-align: middle;
}

.cdh-compare-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 10px;
}

.cdh-compare-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 6px;
}

.cdh-compare-label {
    text-align: left;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

.cdh-compare-value {
    font-weight: 500;
}

.cdh-compare-cta-row td {
    padding-top: 14px;
    border-bottom: none;
}

/* ---------- Simple Lists (v1) ---------- */

.cdh-bonuses-list,
.cdh-payments-list,
.cdh-providers-list,
.cdh-highlights-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cdh-bonus-item,
.cdh-payment-item,
.cdh-provider-item,
.cdh-highlight-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.cdh-bonus-item:last-child,
.cdh-payment-item:last-child,
.cdh-provider-item:last-child,
.cdh-highlight-item:last-child {
    border-bottom: none;
}

.cdh-payment-logo,
.cdh-provider-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

/* ==========================================================================
   Responsive: tables become stacked cards on mobile
   ========================================================================== */

@media (max-width: 768px) {
    /* Bonus table stacked */
    .cdh-bonus-table thead {
        display: none;
    }

    .cdh-bonus-table,
    .cdh-bonus-table tbody,
    .cdh-bonus-table tr,
    .cdh-bonus-table td {
        display: block;
    }

    .cdh-bonus-table tr {
        border: 1px solid #e8e8e8;
        border-radius: 10px;
        padding: 12px;
        margin-bottom: 10px;
        background: #fff;
    }

    .cdh-bonus-table td {
        padding: 4px 0;
        border-bottom: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .cdh-bonus-table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 12px;
        color: #888;
        margin-right: 10px;
        flex-shrink: 0;
    }

    .cdh-bonus-table td.cdh-col-cta {
        justify-content: center;
        margin-top: 8px;
    }

    .cdh-bonus-table td.cdh-col-cta::before {
        display: none;
    }

    .cdh-bonus-table .cdh-cta-btn {
        width: 100%;
    }

    /* Payments table stacked */
    .cdh-payments-table thead {
        display: none;
    }

    .cdh-payments-table,
    .cdh-payments-table tbody,
    .cdh-payments-table tr,
    .cdh-payments-table td {
        display: block;
    }

    .cdh-payments-table tr {
        border: 1px solid #e8e8e8;
        border-radius: 10px;
        padding: 12px;
        margin-bottom: 10px;
        background: #fff;
    }

    .cdh-payments-table td {
        padding: 4px 0;
        border-bottom: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .cdh-payments-table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 12px;
        color: #888;
        margin-right: 10px;
    }

    /* Compare table */
    .cdh-compare-table th,
    .cdh-compare-table td {
        padding: 6px 8px;
        font-size: 12px;
    }

    .cdh-compare-logo {
        width: 32px;
        height: 32px;
    }

    /* Casino list row */
    .cdh-casino-row {
        flex-wrap: wrap;
        position: relative;
    }

    .cdh-row-info {
        flex-basis: calc(100% - 80px);
    }

    .cdh-row-rating {
        position: absolute;
        right: 16px;
        top: 14px;
    }

    .cdh-row-cta {
        flex-basis: 100%;
    }

    .cdh-row-cta .cdh-cta-btn {
        width: 100%;
    }

    /* Casino card */
    .cdh-bonus-pill {
        flex: 1 1 100%;
    }

    /* Calendar */
    .cdh-cal-day {
        min-height: 60px;
    }

    .cdh-cal-offer {
        font-size: 9px;
    }

    .cdh-cal-header {
        font-size: 10px;
        padding: 4px 2px;
    }

    /* Grid items */
    .cdh-casino-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 8px;
    }

    /* Today offers */
    .cdh-today-offer {
        flex-wrap: wrap;
    }

    .cdh-today-offer-cta {
        flex-basis: 100%;
    }

    .cdh-today-offer-cta .cdh-cta-btn {
        width: 100%;
    }

    /* Filter controls */
    .cdh-list-controls {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ==========================================================================
   Print: hide CTAs and interactive elements
   ========================================================================== */

@media print {
    .cdh-cta-btn,
    .cdh-card-cta,
    .cdh-row-cta,
    .cdh-today-offer-cta,
    .cdh-compare-cta-row,
    .cdh-list-controls,
    .cdh-cal-offer-link {
        display: none !important;
    }
}
