/* Offerhopper Trip Optimizer Widget Stylesheet */
.oh-trip-widget {
    --oh-bg: #ffffff;
    --oh-bg2: #f5f5f3;
    --oh-bg3: #eeede9;
    --oh-txt: #1a1a1a;
    --oh-txt2: #666660;
    --oh-txt3: #999993;
    --oh-border: rgba(0, 0, 0, 0.12);
    --oh-border2: rgba(0, 0, 0, 0.22);
    --oh-radius: 8px;
    --oh-radius-lg: 12px;

    margin: 0 auto;
    padding: 24px 16px 32px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--oh-bg);
    color: var(--oh-txt);
}

/* Support system dark-mode for third-party embeds */
@media (prefers-color-scheme: dark) {
    .oh-trip-widget {
        --oh-bg: #1c1c1a;
        --oh-bg2: #252523;
        --oh-bg3: #2e2e2b;
        --oh-txt: #f0ede6;
        --oh-txt2: #999993;
        --oh-txt3: #666660;
        --oh-border: rgba(255, 255, 255, 0.10);
        --oh-border2: rgba(255, 255, 255, 0.22);
    }
}

/* Support parent theme override inside Offerhopper main site */
[data-theme="dark"] .oh-trip-widget {
    --oh-bg: #1c1c1a;
    --oh-bg2: #252523;
    --oh-bg3: #2e2e2b;
    --oh-txt: #f0ede6;
    --oh-txt2: #999993;
    --oh-txt3: #666660;
    --oh-border: rgba(255, 255, 255, 0.10);
    --oh-border2: rgba(255, 255, 255, 0.22);
}

/* Explicit light theme override inside Offerhopper main site to defeat prefers-color-scheme overrides */
[data-theme="light"] .oh-trip-widget {
    --oh-bg: #ffffff;
    --oh-bg2: #f5f5f3;
    --oh-bg3: #eeede9;
    --oh-txt: #1a1a1a;
    --oh-txt2: #666660;
    --oh-txt3: #999993;
    --oh-border: rgba(0, 0, 0, 0.12);
    --oh-border2: rgba(0, 0, 0, 0.22);
}

/* Verdict Card */
.oh-trip-widget .verdict-card {
    border-radius: var(--oh-radius-lg);
    padding: 16px 20px;
    margin-bottom: 14px;
    border: 0.5px solid var(--oh-border);
    background: var(--oh-bg);
}

.oh-trip-widget .verdict-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 8px;
}

.oh-trip-widget .verdict-sentence {
    font-size: 15px;
    color: var(--oh-txt);
    margin-bottom: 12px;
    line-height: 1.55;
}

.oh-trip-widget .bar-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 6px;
}

.oh-trip-widget .bar-label {
    font-size: 11px;
    color: var(--oh-txt2);
    width: 80px;
    flex-shrink: 0;
}

.oh-trip-widget .bar-track {
    flex: 1;
    height: 10px;
    background: var(--oh-bg3);
    border-radius: 5px;
    overflow: hidden;
}

.oh-trip-widget .bar-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.3s;
}

.oh-trip-widget .bar-num {
    font-size: 12px;
    font-weight: 500;
    min-width: 44px;
    text-align: right;
}

.oh-trip-widget .bar-axis {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--oh-txt3);
    margin-top: 4px;
}

/* Heatmap Grid */
.oh-trip-widget .grid-wrap {
    overflow-x: auto;
}

.oh-trip-widget table.hm {
    border-collapse: separate;
    border-spacing: 4px;
    width: 100%;
    table-layout: fixed;
}

.oh-trip-widget table.hm th {
    font-size: 11px;
    color: var(--oh-txt2);
    font-weight: 500;
    padding: 4px 2px;
    text-align: center;
}

.oh-trip-widget table.hm th.rh {
    text-align: right;
    padding-right: 8px;
    width: 52px;
    font-size: 12px;
}

.oh-trip-widget table.hm td {
    padding: 0;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.12s;
}

.oh-trip-widget table.hm td:hover {
    transform: scale(1.05);
}

.oh-trip-widget table.hm td.sel {
    outline: 2.5px solid var(--oh-txt);
    outline-offset: 1px;
    transform: scale(1.06);
}

.oh-trip-widget .cell-in {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 70px;
    border-radius: 8px;
}

.oh-trip-widget .cell-pct {
    font-size: 17px;
    font-weight: 500;
    line-height: 1;
}

.oh-trip-widget .cell-tag {
    font-size: 10px;
    margin-top: 3px;
}

.oh-trip-widget .cell-eur {
    font-size: 10px;
    margin-top: 1px;
    opacity: 0.7;
}

/* Legend & Embed Notes */
.oh-trip-widget .legend-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    font-size: 11px;
    color: var(--oh-txt2);
}

.oh-trip-widget .leg-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

.oh-trip-widget .embed-note {
    margin-top: 20px;
    font-size: 11px;
    color: var(--oh-txt3);
    text-align: center;
}

/* Custom Range Sliders & Badges matching main site style */
.oh-trip-widget .form-label.tiny {
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    color: var(--oh-txt2) !important;
}

.oh-trip-widget .tiny.text-muted {
    font-size: 11px !important;
    color: var(--oh-txt3) !important;
}

.oh-trip-widget .badge {
    background: var(--oh-bg2);
    color: #27ae60;
    border: 1px solid var(--oh-border);
    font-size: 12px !important;
    font-weight: 700 !important;
    padding: 4px 8px !important;
    border-radius: 6px !important;
}

.oh-trip-widget .badge.dim {
    opacity: 0.5;
}

.oh-trip-widget .custom-range {
    height: 10px;
    background: linear-gradient(to bottom, #dae1e7, #e2e8f0);
    border-radius: 12px;
    outline: none;
    appearance: none;
    margin-top: 10px;
    margin-bottom: 15px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.1);
    width: 100%;
}

.oh-trip-widget .custom-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #27ae60;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.oh-trip-widget .custom-range::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    background: #2ecc71;
    box-shadow: 0 4px 10px rgba(39, 174, 96, 0.3);
}

.oh-trip-widget .custom-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border: 3px solid white;
    border-radius: 50%;
    background: #27ae60;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.oh-trip-widget .custom-range::-moz-range-thumb:hover {
    background: #2ecc71;
}

/* Dark mode overrides for custom-range */
@media (prefers-color-scheme: dark) {
    .oh-trip-widget .custom-range {
        background: linear-gradient(to bottom, #2a2f38, #1a1e24);
        border-color: rgba(255, 255, 255, 0.1);
        box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
    }

    .oh-trip-widget .custom-range::-webkit-slider-thumb {
        border-color: #1a1e24;
    }

    .oh-trip-widget .custom-range::-moz-range-thumb {
        border-color: #1a1e24;
    }
}

[data-theme="dark"] .oh-trip-widget .custom-range {
    background: linear-gradient(to bottom, #2a2f38, #1a1e24);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .oh-trip-widget .custom-range::-webkit-slider-thumb {
    border-color: #1a1e24;
}

[data-theme="dark"] .oh-trip-widget .custom-range::-moz-range-thumb {
    border-color: #1a1e24;
}

[data-theme="light"] .oh-trip-widget .custom-range {
    background: linear-gradient(to bottom, #dae1e7, #e2e8f0);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.5);
}

[data-theme="light"] .oh-trip-widget .custom-range::-webkit-slider-thumb {
    border-color: white;
}

[data-theme="light"] .oh-trip-widget .custom-range::-moz-range-thumb {
    border-color: white;
}

/* Responsive Mobile Layout Adjustments */
@media (max-width: 576px) {
    .oh-trip-widget {
        padding: 12px 8px !important;
    }

    .oh-trip-widget .card-body {
        padding: 12px !important;
    }

    .oh-trip-widget .oh-widget-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 12px;
        margin-bottom: 16px;
    }

    .oh-trip-widget .oh-widget-header h3 {
        font-size: 1.3rem;
    }

    .oh-trip-widget .oh-widget-header .btn-group {
        width: 100%;
        display: flex;
    }

    .oh-trip-widget .oh-widget-header .btn-group .btn {
        flex: 1;
        padding-top: 8px;
        padding-bottom: 8px;
        font-size: 0.85rem;
    }

    .oh-trip-widget .custom-range {
        margin-top: 6px;
        margin-bottom: 10px;
    }

    .oh-trip-widget .verdict-card {
        padding: 12px 14px !important;
        margin-bottom: 12px;
    }

    .oh-trip-widget .verdict-sentence {
        font-size: 14px;
        margin-bottom: 8px;
    }

    /* Heatmap Grid Adjustments for mobile view */
    .oh-trip-widget .cell-in {
        height: 56px;
    }

    .oh-trip-widget .cell-pct {
        font-size: 13px;
    }

    .oh-trip-widget .cell-tag {
        font-size: 8px;
        margin-top: 1px;
    }

    .oh-trip-widget .cell-eur {
        font-size: 7px;
        margin-top: 0px;
    }

    .oh-trip-widget table.hm th {
        font-size: 9px;
    }

    .oh-trip-widget table.hm th.rh {
        font-size: 10px;
        padding-right: 4px;
        width: 38px;
    }

    .oh-trip-widget .legend-row {
        justify-content: center;
        gap: 8px;
        margin-top: 10px;
    }
}