/* ==========================================================================
   mod_ridetimes  v1.2  —  with frontend controls
   ========================================================================== */

.mod-ridetimes {
    width: 100%;
    box-sizing: border-box;
    background: var(--rt-bg, #fff);
    color: var(--rt-text, #1e293b);
    border: 1px solid var(--rt-border, #e2e8f0);
    border-radius: 10px;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

/* ---- Header ---- */
.rt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--rt-header, #1b2a4a);
    color: var(--rt-header-text, #fff);
}

.rt-header__title {
    font-weight: 700;
    font-size: 1.15em;
    letter-spacing: 0.02em;
}

.rt-header__live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.9;
}

.rt-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    display: inline-block;
    animation: rt-pulse-anim 1.6s ease-in-out infinite;
}

@keyframes rt-pulse-anim {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .35; transform: scale(.65); }
}

/* ---- Controls bar ---- */
.rt-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 24px;
    border-bottom: 1px solid var(--rt-border, #e2e8f0);
    background: var(--rt-bg, #fff);
}

.rt-controls__group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rt-controls__toggles {
    gap: 14px;
}

.rt-controls__label {
    font-size: 0.72em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.4;
    user-select: none;
}

/* Pill buttons */
.rt-pill-group {
    display: flex;
    gap: 0;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--rt-border, #e2e8f0);
}

.rt-pill {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    background: var(--rt-bg, #fff);
    color: var(--rt-text, #1e293b);
    font-family: inherit;
    font-size: 0.78em;
    font-weight: 600;
    padding: 6px 14px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    border-right: 1px solid var(--rt-border, #e2e8f0);
    line-height: 1.3;
    user-select: none;
}

.rt-pill:last-child {
    border-right: none;
}

.rt-pill:hover {
    background: rgba(0, 0, 0, 0.04);
}

.rt-pill--active {
    background: var(--rt-header, #1b2a4a);
    color: var(--rt-header-text, #fff);
}

.rt-pill--active:hover {
    background: var(--rt-header, #1b2a4a);
    opacity: 0.9;
}

/* Toggle checkboxes */
.rt-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.rt-toggle input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 34px;
    height: 20px;
    background: var(--rt-border, #e2e8f0);
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s ease;
    flex-shrink: 0;
    border: none;
    outline: none;
}

.rt-toggle input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.rt-toggle input[type="checkbox"]:checked {
    background: var(--rt-header, #1b2a4a);
}

.rt-toggle input[type="checkbox"]:checked::after {
    transform: translateX(14px);
}

.rt-toggle__label {
    font-size: 0.78em;
    font-weight: 600;
    opacity: 0.65;
    transition: opacity 0.15s ease;
}

.rt-toggle input[type="checkbox"]:checked + .rt-toggle__label {
    opacity: 1;
}

/* ---- Body ---- */
.rt-body {
    padding: 4px 0;
}

.rt-notice {
    padding: 36px 24px;
    text-align: center;
    opacity: 0.6;
}

.rt-notice p {
    margin: 0;
}

/* ---- Land headings ---- */
.rt-land-heading {
    padding: 14px 24px 8px;
    font-size: 0.74em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    opacity: 0.45;
    border-top: 1px solid var(--rt-border, #e2e8f0);
}

.rt-body > .rt-land-heading:first-child {
    border-top: none;
    padding-top: 10px;
}

/* ---- Ride row ---- */
.rt-ride {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 24px;
    border-bottom: 1px solid var(--rt-border, #e2e8f0);
    transition: background 0.15s ease;
}

.rt-ride:last-child {
    border-bottom: none;
}

.rt-ride:hover {
    background: rgba(0, 0, 0, 0.02);
}

.rt-ride--closed {
    opacity: 0.45;
}

.rt-ride__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.rt-ride__name {
    font-weight: 600;
    font-size: 0.95em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rt-ride__status {
    font-size: 0.7em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.rt-ride__status--open  { color: var(--rt-open, #16a34a); }
.rt-ride__status--closed { color: var(--rt-closed, #dc2626); }

/* ---- Wait-time badge ---- */
.rt-ride__wait {
    flex-shrink: 0;
    display: flex;
    align-items: baseline;
    gap: 3px;
    min-width: 60px;
    justify-content: flex-end;
    text-align: right;
}

.rt-ride__minutes {
    font-size: 1.4em;
    font-weight: 800;
    line-height: 1;
}

.rt-ride__label {
    font-size: 0.7em;
    font-weight: 600;
    text-transform: uppercase;
    opacity: 0.6;
}

.rt-wait--low  .rt-ride__minutes { color: var(--rt-wait-low, #16a34a); }
.rt-wait--med  .rt-ride__minutes { color: var(--rt-wait-med, #ea8c00); }
.rt-wait--high .rt-ride__minutes { color: var(--rt-wait-high, #dc2626); }
.rt-wait--closed .rt-ride__label { opacity: 0.45; }

/* ---- Closed rides divider ---- */
.rt-closed-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px 10px;
}

.rt-closed-divider__line {
    flex: 1;
    height: 1px;
    background: var(--rt-border, #e2e8f0);
}

.rt-closed-divider__text {
    font-size: 0.72em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--rt-closed, #dc2626);
    opacity: 0.7;
    white-space: nowrap;
}

/* ---- Footer ---- */
.rt-footer {
    padding: 12px 24px;
    text-align: center;
    font-size: 0.7em;
    opacity: 0.4;
    border-top: 1px solid var(--rt-border, #e2e8f0);
}

.rt-footer a {
    color: inherit;
    text-decoration: underline;
}

.rt-footer a:hover {
    opacity: 0.7;
}

/* ---- Refresh state ---- */
.rt-refreshing .rt-body {
    opacity: 0.45;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
    .rt-controls {
        padding: 10px 16px;
    }
    .rt-header,
    .rt-ride,
    .rt-land-heading,
    .rt-notice,
    .rt-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
    .rt-pill {
        padding: 5px 10px;
        font-size: 0.72em;
    }
}
