/* ==========================================
   CoasterCheck – Review Form Styles
   ========================================== */

/* ---- Full-screen Modal Overlay ---- */
.review-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: var(--cc-bg);
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
    overflow: hidden;
}

.review-modal--open {
    opacity: 1;
    pointer-events: auto;
}

/* ---- Modal Header ---- */
.review-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    background: var(--cc-surface);
    border-bottom: 1px solid var(--cc-border);
    flex-shrink: 0;
}

.review-modal__title {
    font-family: var(--font-display);
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--cc-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin: 0 var(--space-md);
    letter-spacing: -0.01em;
}

.review-modal__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--cc-surface-2);
    border: 1px solid var(--cc-border);
    color: var(--cc-muted);
    cursor: pointer;
    transition: background var(--transition-fast);
    flex-shrink: 0;
}

.review-modal__close:hover {
    background: #ede7db;
    color: var(--cc-ink);
}

/* ---- Scrollable Form Body ---- */
.review-modal__body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: var(--space-lg);
    padding-bottom: 100px;
}

/* ---- Section Cards ---- */
.form-section {
    background: var(--cc-surface);
    border: 1px solid var(--cc-border);
    border-radius: 18px;
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
    box-shadow: var(--cc-shadow-sm);
}

.form-section__header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.form-section__icon {
    color: var(--cc-accent);
    font-size: 22px;
}

.form-section__title {
    font-family: var(--font-display);
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--cc-ink);
    letter-spacing: -0.01em;
}

.form-section__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    background: var(--cc-ink);
    color: var(--cc-on-ink);
    font-size: var(--font-size-xs);
    font-weight: 700;
    flex-shrink: 0;
}

/* ---- Field Group ---- */
.form-field {
    margin-bottom: var(--space-lg);
}

.form-field:last-child {
    margin-bottom: 0;
}

.form-field__label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--cc-ink);
    margin-bottom: var(--space-sm);
}

.form-field__hint {
    font-size: var(--font-size-xs);
    color: var(--cc-muted);
    margin-top: var(--space-xs);
}

/* ---- Auto-filled stats row ---- */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: var(--space-sm);
}

.stats-row__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-sm) var(--space-xs);
    background: var(--cc-surface-2);
    border-radius: var(--radius-md);
    border: 1px solid var(--cc-border);
}

.stats-row__value {
    font-family: var(--font-display);
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--cc-accent);
    font-variant-numeric: tabular-nums;
}

.stats-row__label {
    font-size: var(--font-size-xs);
    color: var(--cc-muted);
    margin-top: 2px;
    font-weight: 500;
}

/* ---- Selectable Chip Group (Radio-like) ---- */
.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.chip-select {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 500;
    min-height: 44px;
    background: var(--cc-surface-2);
    color: var(--cc-ink);
    border: 1.5px solid var(--cc-border);
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.chip-select:hover {
    border-color: var(--cc-accent);
    background: var(--cc-accent-bg);
}

.chip-select:active {
    transform: scale(0.97);
}

.chip-select--selected {
    background: var(--cc-ink);
    color: var(--cc-on-ink);
    border-color: var(--cc-ink);
    font-weight: 700;
    box-shadow: 0 4px 10px -4px rgba(28,26,24,.25);
}

.chip-select--selected:hover {
    filter: brightness(1.1);
}

/* ---- Multi-Select Chips (Toggleable) ---- */
.chip-multi {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: var(--font-size-xs);
    font-weight: 500;
    min-height: 44px;
    background: var(--cc-surface-2);
    color: var(--cc-muted);
    border: 1.5px solid var(--cc-border);
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.chip-multi:hover {
    border-color: var(--cc-border-strong);
    color: var(--cc-ink);
}

.chip-multi--selected {
    background: var(--cc-success-bg);
    color: var(--cc-success);
    border-color: rgba(31, 122, 91, 0.3);
    font-weight: 600;
}

.chip-multi--selected:hover {
    background: rgba(31, 122, 91, 0.18);
}

/* ---- Toggle Switch ---- */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: var(--space-sm) 0;
}

.toggle-row__label {
    font-size: var(--font-size-sm);
    color: var(--cc-ink);
    font-weight: 500;
    flex: 1;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 26px;
    flex-shrink: 0;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-switch__track {
    position: absolute;
    inset: 0;
    border-radius: 13px;
    background: rgba(28, 26, 24, 0.12);
    transition: background var(--transition-fast);
}

.toggle-switch input:checked + .toggle-switch__track {
    background: var(--cc-accent);
}

.toggle-switch__thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(28,26,24,.20);
    transition: transform var(--transition-fast);
}

.toggle-switch input:checked ~ .toggle-switch__thumb {
    transform: translateX(18px);
}

/* ---- Family Friendliness Toggle Cards ---- */
.toggle-card-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--space-sm);
}

.toggle-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-md) var(--space-sm);
    border-radius: var(--radius-md);
    background: var(--cc-surface-2);
    border: 1.5px solid var(--cc-border);
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
    min-height: 44px;
}

.toggle-card:hover {
    border-color: var(--cc-border-strong);
}

.toggle-card__label {
    font-size: var(--font-size-xs);
    color: var(--cc-muted);
    line-height: 1.3;
    font-weight: 500;
}

.toggle-card__state {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--cc-muted);
    padding: 2px 10px;
    border-radius: var(--radius-sm);
    background: var(--cc-border);
    transition: all var(--transition-fast);
}

/* State: No */
.toggle-card--no {
    border-color: rgba(179, 54, 27, 0.35);
    background: var(--cc-danger-bg);
}

.toggle-card--no .toggle-card__state {
    background: var(--cc-danger);
    color: #ffffff;
}

.toggle-card--no .toggle-card__label {
    color: var(--cc-danger);
}

/* State: Yes */
.toggle-card--yes {
    border-color: rgba(31, 122, 91, 0.35);
    background: var(--cc-success-bg);
}

.toggle-card--yes .toggle-card__state {
    background: var(--cc-success);
    color: #ffffff;
}

.toggle-card--yes .toggle-card__label {
    color: var(--cc-success);
}

/* State: Partial */
.toggle-card--partial {
    border-color: rgba(182, 114, 42, 0.35);
    background: var(--cc-warn-bg);
}

.toggle-card--partial .toggle-card__state {
    background: var(--cc-warning);
    color: #ffffff;
}

.toggle-card--partial .toggle-card__label {
    color: var(--cc-warning);
}

/* ---- Sticky Action Bar ---- */
.review-modal__footer {
    position: sticky;
    bottom: 0;
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--cc-surface);
    border-top: 1px solid var(--cc-border);
    flex-shrink: 0;
    box-shadow: 0 -4px 16px rgba(28,26,24,.08);
}

.review-modal__footer .btn {
    flex: 1;
    padding: 14px var(--space-lg);
    font-size: var(--font-size-base);
    border-radius: var(--radius-md);
    justify-content: center;
}

/* ---- Smoothness color chips ---- */
.chip-select[data-value="-1"] { --chip-accent: var(--cc-danger); }
.chip-select[data-value="1"]  { --chip-accent: #d4731d; }
.chip-select[data-value="2"]  { --chip-accent: var(--cc-warning); }
.chip-select[data-value="3"]  { --chip-accent: #7a9a2e; }
.chip-select[data-value="4"]  { --chip-accent: var(--cc-success); }
.chip-select[data-value="5"]  { --chip-accent: var(--cc-accent-3); }

.chip-group--colored .chip-select--selected {
    background: var(--chip-accent, var(--cc-accent));
    border-color: var(--chip-accent, var(--cc-accent));
    color: #ffffff;
}

/* ---- Ride info banner at top ---- */
.review-ride-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--cc-accent-bg);
    border: 1px solid rgba(232, 93, 59, 0.18);
    border-radius: 18px;
    margin-bottom: var(--space-lg);
}

.review-ride-info__name {
    font-family: var(--font-display);
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--cc-ink);
    letter-spacing: -0.01em;
}

.review-ride-info__park {
    font-size: var(--font-size-xs);
    color: var(--cc-accent);
    margin-top: 2px;
    font-weight: 600;
}

/* iOS safe area bottom padding */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .review-modal__footer {
        padding-bottom: calc(var(--space-md) + env(safe-area-inset-bottom));
    }
}

/* ==========================================
   Review Modal — New Design (Stepper)
   ========================================== */

/* ---- Review Hero (gradient header) ---- */
.review-hero {
    position: relative;
    padding: 8px 16px 14px;
    color: #fff;
    flex-shrink: 0;
}

.review-hero__overlay {
    position: absolute;
    inset: 0;
    opacity: 0.15;
    background-image: repeating-linear-gradient(45deg, #fff 0 1.5px, transparent 1.5px 14px);
    pointer-events: none;
}

.review-hero__top {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 6px;
}

.review-hero__close {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: rgba(255,255,255,.22);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 20px;
    border: 1px solid rgba(255,255,255,.3);
}

/* ThrillMeter (SVG injected by JS) */
.thrill-meter-wrap {
    line-height: 0;
}

.review-hero__info {
    position: relative;
    margin-top: 6px;
}

.review-hero__park-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    opacity: 0.9;
    font-weight: 600;
    margin-bottom: 4px;
}

.review-hero__park-logo {
    border-radius: var(--radius-full);
    background: rgba(255,255,255,.15);
    padding: 1px;
    object-fit: contain;
}

.review-hero__ride-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 24px;
    letter-spacing: -0.015em;
    line-height: 1.1;
    margin: 0 0 6px;
}

.review-hero__stats {
    display: flex;
    gap: 12px;
    font-size: 12px;
    font-weight: 600;
    opacity: 0.9;
}

/* ---- Stepper ---- */
.review-stepper {
    display: flex;
    gap: 4px;
    padding: 10px 16px 0;
    flex-shrink: 0;
    background: var(--cc-bg);
}

.review-stepper__tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 6px;
    background: var(--cc-surface);
    color: var(--cc-ink);
    border-radius: 12px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.02em;
    position: relative;
    transition: background var(--cc-t), color var(--cc-t);
    border: 1px solid var(--cc-border);
}

.review-stepper__tab .material-symbols-rounded {
    font-size: 18px;
}

.review-stepper__tab--active {
    background: var(--cc-ink);
    color: var(--cc-on-ink);
    border-color: transparent;
}

.review-stepper__check {
    position: absolute;
    top: 4px;
    right: 6px;
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    background: var(--cc-success);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    display: grid;
    place-items: center;
    line-height: 1;
}

/* ---- Review Sections (one visible at a time) ---- */
.review-section {
    animation: cc-page-in 200ms cubic-bezier(.2,.8,.2,1) forwards;
}

.review-section[hidden] {
    display: none;
}

.form-field__hint-inline {
    font-size: 11px;
    font-weight: 500;
    color: var(--cc-muted);
    margin-left: 4px;
}

/* Update body padding for new footer height */
.review-modal__body {
    padding-bottom: 80px;
}

/* ---- New Footer ---- */
.review-modal__footer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 10px 14px calc(14px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(to top, var(--cc-bg) 60%, transparent);
    flex-shrink: 0;
}

.review-footer__back {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--cc-surface);
    color: var(--cc-ink);
    display: grid;
    place-items: center;
    box-shadow: var(--cc-shadow-sm);
    font-size: 20px;
    flex-shrink: 0;
    transition: opacity var(--cc-t);
}

.review-footer__back:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.review-footer__next,
.review-footer__save {
    flex: 1;
    height: 44px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: var(--cc-shadow-sm);
}

.review-footer__next {
    background: var(--cc-ink);
    color: var(--cc-on-ink);
}

.review-footer__save {
    background: var(--cc-accent);
    color: #fff;
}

.review-footer__save:disabled {
    background: var(--cc-border-strong);
    color: var(--cc-muted);
    cursor: not-allowed;
    box-shadow: none;
}

/* ---- Save Success Overlay ---- */
.review-success {
    position: absolute;
    inset: 0;
    z-index: 200;
    pointer-events: auto;
    display: grid;
    place-items: center;
    background: rgba(20,15,10,.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: cc-fade-in 0.2s ease-out;
}

.review-success[hidden] {
    display: none;
}

.review-success__card {
    background: var(--cc-surface);
    border-radius: 22px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    box-shadow: var(--cc-shadow-lg);
    position: relative;
    overflow: hidden;
    min-width: 200px;
}

.review-success__confetti {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.review-success__icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--cc-accent), var(--cc-accent-2));
    display: grid;
    place-items: center;
    animation: cc-pop 0.4s cubic-bezier(.2,1.4,.4,1);
    z-index: 1;
}

.review-success__icon .material-symbols-rounded {
    font-size: 36px;
    color: #fff;
}

.review-success__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 22px;
    color: var(--cc-ink);
    z-index: 1;
}

.review-success__sub {
    font-size: 13px;
    color: var(--cc-muted);
    z-index: 1;
}

.review-success__fav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: var(--radius-full);
    background: var(--cc-surface-2);
    border: 1.5px solid var(--cc-border);
    color: var(--cc-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    z-index: 1;
    transition: background var(--cc-t), color var(--cc-t), border-color var(--cc-t);
    margin-top: 4px;
}

.review-success__fav-btn--active {
    background: rgba(255,183,0,.12);
    color: #d4a017;
    border-color: rgba(255,183,0,.4);
}

.review-success__fav-btn .material-symbols-rounded {
    font-size: 18px;
    transition: font-variation-settings var(--cc-t);
}
