/**
 * Creator Form Styles
 *
 * Uses Bootstrap 5 utilities extensively. Only custom CSS here is for:
 * - Unique visual effects (animations, gradients)
 * - Complex component states
 * - Styles that Bootstrap utilities can't handle
 *
 * All CSS variables come from /assets/css/custom.css
 * Text utilities: .text-white-80, .text-white-70, .text-white-50, .text-white-40
 * Background utilities: .bg-dark-40, .bg-dark-60, .bg-white-90, .bg-white-20, .bg-white-10
 * Font utilities: .fs-sm, .fs-xs
 * Max-width: .mw-500, .mw-640, .mw-700, .mw-720, .mw-760, .mw-800, .mw-900, .mw-1200
 * Border radius: .rounded-lg, .rounded-pill
 */

/* ===================================
   BODY & CONTAINER
   =================================== */

body {
    overflow-x: hidden; /* Only prevent horizontal scroll - vertical needed for sticky */
    transition: background 0.3s ease;
}

.wizard-container {
    min-height: 100vh;
    background-color: #333;
    background-image: url("../../images/asphalt-tile.jpg");
    background-repeat: repeat;
}

/* ===================================
   SHARED MOBILE NAV ON CREATOR PAGE
   ===================================
   The creator page reuses the sitewide offcanvas nav from
   template-parts/header-mobile.php (so About & all links live in one place).
   We hide that template's desktop header bar (.site-header-container) and
   its compact mobile bar (.bb-mobile-header) — the wrapper must stay in
   the DOM because Alpine's offcanvas state lives on it. The creator's own
   floating hamburger dispatches @r1v-toggle-mobile-nav.window to open it. */

body.r1v-force-mobile-nav .site-header-container { display: none !important; }
body.r1v-force-mobile-nav .bb-mobile-header-wrapper { display: block !important; }
body.r1v-force-mobile-nav .bb-mobile-header-wrapper .bb-mobile-header { display: none !important; }

/* ===================================
   CREATOR HEADER BAR (floating hamburger + Save Status)
   =================================== */

.creator-header-bar {
    position: fixed;
    top: 16px;
    left: 16px;
    right: 16px;
    z-index: 900;
    pointer-events: none; /* Let clicks pass through the bar itself */
}

.creator-header-bar > * {
    pointer-events: auto; /* But enable clicks on children */
}

.creator-menu-toggle {
    color: rgba(255, 255, 255, 0.8);
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.creator-menu-toggle:hover,
.creator-menu-toggle:focus {
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
}

/* Save Status Display */
.save-status {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    transition: opacity 0.3s ease;
}

.save-status:empty {
    display: none;
}

.save-status.saving {
    color: rgba(255, 255, 255, 0.9);
}

/* ===================================
   PROGRESS BAR
   =================================== */

.progress-bar-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 9999;
}

.progress-bar-fill {
    height: 100%;
    background: var(--rov-green);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================
   STAGE CONTAINER
   Bootstrap: d-flex flex-column justify-content-center align-items-center on .stage.active
   =================================== */

.stage {
    display: none;
    min-height: 100vh;
    padding: 80px 24px 120px;
    animation: fadeIn 0.5s ease-in-out;
}

#stage-1 {
    padding-top: 20vh;
    gap: 20vh;
}

.stage.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stage content - use .mw-720 .w-full in HTML instead if possible */
.stage-content {
    max-width: 720px;
    width: 100%;
}

/* ===================================
   QUILL EDITOR
   =================================== */

#storyContentEditor {
    /* Bootstrap: mb-4 */
    margin-bottom: 1.5rem;
}

#storyContentEditor .ql-editor {
    min-height: 18em;
    /* Match the published view-panel typography so the editor renders WYSIWYG
       — same font-size + line-height means a blank <p><br></p> creates the
       same gap in pixels as in the public view. */
    font-size: 16px;
    line-height: 1.5;
}

#storyContentEditor .ql-container {
    height: 400px;
    overflow-y: auto;
}

#storyContentEditor .ql-toolbar {
    /* Bootstrap: d-flex flex-wrap align-items-center */
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.quill-word-counter {
    /* Bootstrap: ms-auto fs-sm */
    margin-left: auto;
    font-size: 0.875rem;
    color: #dc3545;
    padding: 0 0.5rem;
}

/* ===================================
   STORY → VIEW LINK AFFORDANCE
   Sits below the Quill editor on the story stage.
   Two states (info ↔ picker) swap in the SAME container,
   so the card height is fixed and the page never reflows.
   =================================== */

.story-link-card {
    margin-top: 0.625rem;
    margin-bottom: 1.25rem;
    border-radius: var(--rov-border-radius-md, 8px);
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0.25rem 0.625rem;
    height: 2.25rem;
    position: relative;
    display: flex;
    align-items: center;
}

body.light-theme .story-link-card {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(0, 0, 0, 0.08);
}

.story-link-info,
.story-link-picker {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.story-link-tip-icon {
    color: var(--rov-green);
    font-size: 0.8125rem;
    flex-shrink: 0;
}

.story-link-tip-text {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.2;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.story-link-tip-text strong {
    color: #fff;
    font-weight: 700;
}

body.light-theme .story-link-tip-text {
    color: rgba(0, 0, 0, 0.75);
}

body.light-theme .story-link-tip-text strong {
    color: #111827;
}

.btn-link-view {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.625rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.75);
    color: #fff;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    opacity: 0.35;
    transition: opacity 0.18s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-link-view:not(:disabled) {
    opacity: 0.85;
}

.btn-link-view:disabled {
    cursor: default;
}

.btn-link-view i {
    font-size: 0.65rem;
    flex-shrink: 0;
}

.btn-link-view:not(:disabled):hover,
.btn-link-view:not(:disabled):focus-visible {
    opacity: 1;
    background: #fff;
    color: #111827;
    border-color: #fff;
    outline: none;
}

body.light-theme .btn-link-view {
    border-color: rgba(0, 0, 0, 0.6);
    color: #111827;
}

body.light-theme .btn-link-view:not(:disabled):hover,
body.light-theme .btn-link-view:not(:disabled):focus-visible {
    background: #111827;
    color: #fff;
    border-color: #111827;
}

.story-link-picker-input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    color: #fff;
    padding: 0;
    font-size: 0.8125rem;
    outline: none;
}

.story-link-picker-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

body.light-theme .story-link-picker-input {
    color: #111827;
}

body.light-theme .story-link-picker-input::placeholder {
    color: rgba(0, 0, 0, 0.45);
}

.story-link-picker-close {
    flex-shrink: 0;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.125rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.25rem;
}

.story-link-picker-close:hover {
    color: #fff;
}

body.light-theme .story-link-picker-close {
    color: rgba(0, 0, 0, 0.55);
}

body.light-theme .story-link-picker-close:hover {
    color: #000;
}

/* Floating autocomplete dropdown anchored to the card */
.story-link-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 50;
    max-height: 240px;
    overflow-y: auto;
    background: rgba(20, 20, 22, 0.95);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--rov-border-radius-md, 8px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
    padding: 0.25rem;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.92);
}

body.light-theme .story-link-dropdown {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(0, 0, 0, 0.1);
    color: #111827;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.story-link-picker-empty {
    color: rgba(255, 255, 255, 0.55);
    font-style: italic;
    display: block;
    padding: 0.375rem 0.5rem;
}

body.light-theme .story-link-picker-empty {
    color: rgba(0, 0, 0, 0.5);
}

.story-link-picker-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    border-radius: 5px;
    cursor: pointer;
}

.story-link-picker-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

body.light-theme .story-link-picker-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.story-link-picker-badge {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.55);
    white-space: nowrap;
    flex-shrink: 0;
}

body.light-theme .story-link-picker-badge {
    color: rgba(0, 0, 0, 0.55);
}

.story-link-picker-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===================================
   CHARACTER COUNTERS
   =================================== */

.char-counter {
    /* Bootstrap: text-white-70 fs-sm text-end */
    font-size: 0.875rem;
    text-align: right;
    margin-top: -1rem;
    margin-bottom: 1.5rem;
}

.char-counter.valid {
    color: #fff;
}

.title-char-counter {
    /* Bootstrap: position-absolute end-0 top-50 translate-middle-y fs-sm fw-semibold pe-none */
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.875rem;
    font-weight: 600;
    color: #dc3545;
    pointer-events: none;
}


/* ===================================
   LOCATION CARDS
   =================================== */

#locationSearchContainer {
    margin-bottom: 1.5rem;
}

.location-card-wrapper {
    /* Bootstrap: mb-3 */
    margin-bottom: 1rem;
    transition: transform 0.2s ease;
}

/* SortableJS */
.sortable-ghost {
    opacity: 0.4;
}
.sortable-drag {
    opacity: 1;
    cursor: grabbing !important;
}
.sortable-chosen {
    cursor: grabbing;
}

.location-card {
    /* Bootstrap: bg-white rounded-lg p-3 p-md-4 */
    border-radius: var(--rov-border-radius-lg);
    padding: 1.25rem 1.5rem;
    animation: slideIn 0.3s ease;
}

.add-location-input-state {
    flex: 0 0 100%;
    width: 100%;
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
}

/* Add location buttons: 60/40 split */
#addLocationBtn {
    flex: 3;
}

#addStoryBtn {
    flex: 2;
}

/* When input is visible, remove bottom borders from buttons row */
.add-location-buttons-row.input-visible .location-card {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.location-card-header {
    /* Bootstrap: d-flex align-items-center gap-3 */
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.drag-handle {
    /* Bootstrap: text-secondary */

    font-size: 1.125rem;
    cursor: grab;
    opacity: 0.4;
    transition:
        opacity 0.2s,
        color 0.2s;
    user-select: none;
    padding: 0.25rem;
    margin: -0.25rem;
}

.drag-handle:hover {
    opacity: 1;
    color: var(--rov-green);
}

.sortable-chosen .drag-handle {
    cursor: grabbing;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.location-card-info {
    /* Column layout: title on top, details row below */
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0; /* Allow flex child to shrink below content width */
}

.location-card-name {
    /* Flex row: icon + text + badge */
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: #212529;
    min-width: 0; /* Allow shrinking in flex chain */
}

.location-card-name img {
    flex-shrink: 0; /* Icon never shrinks */
}

.location-card-name-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge-order {
    flex-shrink: 0; /* Badge never shrinks */
    margin-left: auto; /* Push badge to the right end */
}

.location-card-details {
    /* Row: meta (address/tags) + actions */
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 0.5rem;
}

.location-card-meta {
    /* Address and tags container */
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0; /* Allow shrinking */
    flex: 1;
}

.location-card-address {
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.location-card-actions {
    /* Action buttons container */
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.location-card-actions .btn {
    padding: 0.375rem 0.5rem;
    min-width: 32px;
    min-height: 32px;
}

body.light-theme .location-card {
    background: #fff;
    box-shadow: 0 .125rem .25rem rgba(0,0,0,.075);
}

/* ===================================
   ADD STOP BUTTON
   =================================== */

.btn-add-stop {
    /* Bootstrap: bg-transparent rounded-lg */
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.3);
    border-radius: var(--rov-border-radius-lg);
    padding: 0.75rem 1.25rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition:
        background 0.2s,
        border-color 0.2s,
        color 0.2s;
}

.btn-add-stop:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

/* ===================================
   STOP DETAILS
   =================================== */

.stop-details {
    /* Bootstrap: mt-3 pt-3 border-top */
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0,0,0,0.175);
}

/* ===================================
   TAG PILLS
   =================================== */

.tag-selection .visible-tags,
.tag-selection .tags-wrapper {
    /* Bootstrap: d-flex flex-wrap gap-3 mb-3 */
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.tag-pill {
    /* Bootstrap: rounded-pill */
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--rov-border-radius-pill);
    padding: 0.75rem 1.5rem;
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition:
        background 0.2s,
        transform 0.2s;
}

.tag-pill:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.tag-pill.selected {
    background: var(--rov-green);
    border-color: var(--rov-green);
    font-weight: 600;
}

body.light-theme .tag-pill {
    background: #fff;
    border-color: #dee2e6;
    color: #212529;
}

/* Tag pills inside light-background suggestion cards */
.suggestions-card .tag-pill {
    background: #fff;
    border: 2px solid #dee2e6;
    color: #212529;
}

.suggestions-card .tag-pill:hover {
    background: #f8f9fa;
    border-color: #ced4da;
}

.suggestions-card .tag-pill.selected {
    background: var(--rov-green);
    border-color: var(--rov-green);
    color: #fff;
}

/* Title suggestion pills - smaller variant of tag pills */
.suggestions-card .title-pill {
    background: #fff;
    border: 2px solid #dee2e6;
    border-radius: var(--rov-border-radius-pill);
    padding: 0.5rem 1rem;
    color: #212529;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition:
        background 0.2s,
        border-color 0.2s,
        transform 0.2s;
}

.suggestions-card .title-pill:hover {
    background: #f8f9fa;
    border-color: #ced4da;
    transform: translateY(-1px);
}

/* Title input - reduced font size to fit 80 chars */
#storyTitle {
    font-size: 1rem;
}

/* ===================================
   MEDIA UPLOAD
   =================================== */

.media-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.media-preview-item {
    /* Bootstrap: position-relative rounded overflow-hidden */
    position: relative;
    aspect-ratio: 1;
    border-radius: 0.5rem;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.95);
}

.media-preview-item img {
    /* Bootstrap: w-100 h-100 object-fit-cover */
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-remove-media {
    /* Bootstrap: position-absolute top-0 end-0 m-2 btn btn-danger rounded-circle */
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-text {
    /* Bootstrap: text-white-70 fs-sm mt-2 */
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* ===================================
   SUCCESS SCREEN (Magazine Layout)
   =================================== */

/* Override wizard dark background when success is showing */
.wizard-container.show-success {
    background-color: #fafafa !important;
    background-image: none !important;
}

/* Override default stage layout for success */
.stage-success.active {
    display: block !important;
    padding: 0;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

#successConfettiCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

.stage-success-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
}

.success-image-side {
    position: relative;
    overflow: hidden;
}

.success-image-side img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.success-published-badge {
    position: absolute;
    top: 24px;
    left: 24px;
    background: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--rov-green);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 4;
}

.success-published-badge i {
    color: var(--rov-green);
}

.success-content-side {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 56px;
    position: relative;
    z-index: 2;
}

.success-eyebrow {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--rov-green);
    margin-bottom: 1rem;
    animation: fadeIn 0.5s ease-out;
}

.success-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 600;
    color: #111;
    margin-bottom: 1rem;
    line-height: 1.15;
    animation: fadeIn 0.5s ease-out 0.1s both;
}

.success-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: #999;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
    animation: fadeIn 0.5s ease-out 0.2s both;
}

.success-meta-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #ccc;
}

.success-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    animation: fadeIn 0.5s ease-out 0.3s both;
}

.success-btn {
    padding: 1rem 1.5rem;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    display: block;
}

.success-btn-primary {
    background: #111;
    color: white;
}

.success-btn-primary:hover {
    background: #333;
    color: white;
    text-decoration: none;
}

.success-btn-secondary {
    background: transparent;
    color: #111;
    border: 1.5px solid #ddd;
}

.success-btn-secondary:hover {
    border-color: #111;
    color: #111;
    text-decoration: none;
}

.success-share {
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: fadeIn 0.5s ease-out 0.4s both;
}

.success-share-label {
    font-size: 0.8125rem;
    color: #aaa;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Override the share bar's default sizing for this context */
.success-share .rovViewPanelShareBar {
    max-width: none;
}

.success-share .rovViewPanelShareBar span {
    width: 42px !important;
    height: 42px !important;
    border-radius: 50% !important;
    background: #f0f0f0 !important;
    color: #555 !important;
    border: none !important;
    font-size: 0.875rem;
    transition: all 0.3s;
}

.success-share .rovViewPanelShareBar span:hover {
    background: #e0e0e0 !important;
    color: #111 !important;
    transform: translateY(-3px);
}

/* Fallback: no image, full-width content */
.stage-success-layout.no-image {
    grid-template-columns: 1fr;
}

.stage-success-layout.no-image .success-content-side {
    max-width: 640px;
    margin: 0 auto;
}

/* Mobile: stack vertically */
@media (max-width: 768px) {
    .stage-success-layout {
        grid-template-columns: 1fr;
    }

    .success-image-side {
        max-height: 40vh;
    }

    .success-content-side {
        padding: 2rem 1.5rem;
    }

    .success-title {
        font-size: 1.75rem;
    }
}

/* ===================================
   BREADCRUMBS NAVIGATION
   =================================== */

.breadcrumbs-nav {
    /* Bootstrap: position-fixed bottom-0 start-0 end-0 d-flex justify-content-center align-items-center gap-3 bg-dark-40 bg-blur */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    padding: 2rem 3rem 1.5rem;
    z-index: 30;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.breadcrumb-item {
    display: inline-flex;
}

.breadcrumbs-nav .breadcrumb-step {
    /* Bootstrap: fs-sm fw-semibold text-white-40 */
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    background: transparent;
    border: none;
    padding: 0;
    transition:
        color 0.2s,
        font-size 0.2s;
    cursor: pointer;
}

.breadcrumbs-nav .breadcrumb-step:hover {
    color: rgba(255, 255, 255, 0.6);
}
.breadcrumbs-nav .breadcrumb-step:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
    border-radius: 2px;
}
.breadcrumbs-nav .breadcrumb-step.active {
    color: rgba(255, 255, 255, 1);
    font-size: 1rem;
}
.breadcrumbs-nav .breadcrumb-step.completed {
    color: rgba(255, 255, 255, 0.7);
}
.breadcrumbs-nav .breadcrumb-separator {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.875rem;
}

body.light-theme .breadcrumbs-nav {
    background: rgba(255, 255, 255, 0.9);
}
body.light-theme .breadcrumbs-nav .breadcrumb-step {
    color: rgba(0, 0, 0, 0.4);
}
body.light-theme .breadcrumbs-nav .breadcrumb-step:hover {
    color: rgba(0, 0, 0, 0.6);
}
body.light-theme .breadcrumbs-nav .breadcrumb-step.active {
    color: rgba(0, 0, 0, 1);
}
body.light-theme .breadcrumbs-nav .breadcrumb-step.completed {
    color: rgba(0, 0, 0, 0.7);
}
body.light-theme .breadcrumbs-nav .breadcrumb-separator {
    color: rgba(0, 0, 0, 0.3);
}

/* ===================================
   MAP COMPONENTS
   =================================== */

.creator-map {
    /* Bootstrap: flex-grow-1 w-100 */
    flex: 1;
    width: 100%;
    min-height: 400px;
}

.map-mode-hidden {
    display: none !important;
}

/* ===================================
   ITINERARY MAP (Stage 2 - 60/40 Split)
   =================================== */

.stage-content-wide {
    max-width: 1200px;
    width: 100%;
}

.itinerary-map-container {
    min-height: 370px;
    height: 100%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--rov-border-radius-lg);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.itinerary-map {
    width: 100%;
    height: 100%;
    border-radius: var(--rov-border-radius-lg);
}

/* Desktop: Sticky map stays within its column, never floats above location cards */
@media (min-width: 992px) {
    .stage-locations.active .itinerary-map-container {
        position: sticky;
        top: 100px;
    }
}

/* Mobile: Map stacks below itinerary with fixed height */
@media (max-width: 991.98px) {
    .itinerary-map-container {
        height: 350px;
        min-height: 300px;
        margin-top: 1.5rem;
    }
}

/* Light theme */
body.light-theme .itinerary-map-container {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid #dee2e6;
}

/* ===================================
   LIGHT THEME OVERRIDES
   =================================== */

body.light-theme {
    background: #f8f9fa;
}
body.light-theme .stage-number {
    color: #6c757d;
}
body.light-theme .stage-title,
body.light-theme .stage-subtitle {
    color: #212529;
}

body.light-theme .help-text,
body.light-theme .char-counter {
    color: #6c757d;
}

body.light-theme .btn-add-stop {
    background: rgba(0, 117, 74, 0.05);
    border-color: rgba(0, 117, 74, 0.2);
    color: var(--rov-green);
}

body.light-theme .progress-bar-container {
    background: rgba(0, 0, 0, 0.05);
}

body.light-theme .btn-wizard-secondary {
    background: #f8f9fa;
    color: #212529;
}

/* ===================================
   RESPONSIVE - MOBILE FIRST OPTIMIZATIONS
   Touch targets: 44-48px | Compact padding: 12-16px
   =================================== */

@media (max-width: 768px) {
    /* Stage container - reduced padding */
    .stage {
        padding: 60px 16px 100px;
    }

    /* Wizard buttons - compact but touch-friendly (44px min) */
    .btn-wizard {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
        min-height: 44px;
    }
    .wizard-buttons {
        gap: 0.75rem;
        margin-top: 1.25rem;
    }

    /* Location cards - compact */
    .location-card {
        padding: 0.625rem 0.75rem;
    }
    .location-card-wrapper {
        margin-bottom: 0.5rem;
    }
    .location-card-header {
        gap: 0.375rem;
    }
    .location-card-name {
        font-size: 0.9375rem;
    }
    .location-card-address {
        font-size: 0.75rem;
    }
    .location-card-details {
        gap: 0.375rem;
    }
    .location-card-actions .btn {
        padding: 0.25rem 0.375rem;
        font-size: 0.75rem;
        min-height: 28px;
        min-width: 28px;
    }

    /* Add location buttons - compact */
    .add-location-buttons-row .btn {
        padding: 0.625rem 0.75rem;
        font-size: 0.875rem;
        min-height: 44px;
    }
    .add-location-input-state {
        margin-top: 0.5rem !important;
    }

    /* Breadcrumbs - compact */
    .breadcrumbs-nav {
        padding: 0.625rem 1rem;
        gap: 0.5rem;
    }
    .breadcrumb-list {
        gap: 0.375rem;
    }
    .breadcrumbs-nav .breadcrumb-step {
        font-size: 0.75rem;
        padding: 0.25rem;
        min-height: 32px;
        min-width: 32px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .breadcrumbs-nav .breadcrumb-step.active {
        font-size: 0.8125rem;
    }
    .breadcrumb-separator {
        font-size: 0.75rem;
    }
    /* Tag pills - compact */
    .tag-pill {
        padding: 0.5rem 0.875rem;
        font-size: 0.875rem;
    }
    .tag-selection .visible-tags,
    .tag-selection .tags-wrapper {
        gap: 0.5rem;
        margin-bottom: 0.5rem;
    }

    /* Suggestion cards - compact padding */
    .suggestions-card {
        padding: 1rem !important;
    }
    .suggestions-card h3 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    .suggestions-card .title-pill {
        padding: 0.375rem 0.75rem;
        font-size: 0.8125rem;
    }

    /* Map container on mobile */
    .itinerary-map-container {
        margin-top: 1rem;
    }

}

/* ===================================
   STOP DETAILS OFFCANVAS
   =================================== */

#stopDetailsModal.offcanvas {
    width: 600px;
    max-width: 90vw;
}

#stopDetailsModal .stop-wizard-step[data-step="2"] {
    max-width: none;
}

#stopDetailsModal .step-title {
    /* Bootstrap: text-center fs-4 fw-semibold mb-4 */
    text-align: start;
    font-size: 1.75rem;
    font-weight: 600;
    color: #212529;
    margin-bottom: 2rem;
}

.breadcrumbs-nav--offcanvas {
    /* Override position from main breadcrumbs-nav */
    position: static;
    width: 100%;
    z-index: auto;
}

#stopDetailsModal .stop-step-next,
#stopDetailsModal #stopModalSave {
    /* Bootstrap: rounded-lg */
    border-radius: var(--rov-border-radius-lg);
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
}

body.light-theme #stopDetailsModal.offcanvas {
    background: #f8f9fa;
}
body.light-theme #stopDetailsModal .step-title {
    color: #212529;
}

/* ===================================
   STOP WIZARD STEPS (used in offcanvas)
   =================================== */

.stop-wizard-step {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.stop-wizard-step.active {
    display: block;
}

#stopDetailsModal #modalStopStory.ql-container {
    max-height: 50vh;
    overflow-y: auto;
}

#stopDetailsModal #modalStopStory .ql-editor {
    min-height: 240px;
    /* Match the published view-panel typography (same rule as the main story
       editor) so per-stop story rendering is also WYSIWYG. */
    font-size: 16px;
    line-height: 1.5;
}

.stop-wizard-step .step-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* ===================================
   OFFCANVAS RESPONSIVE
   =================================== */

@media (max-width: 768px) {
    #stopDetailsModal.offcanvas {
        width: 100%;
    }
    .breadcrumbs-nav--offcanvas {
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }
}

/* ===================================
   MAP LOCATION PICKER OFFCANVAS
   =================================== */

#mapLocationPickerModal.offcanvas {
    width: 600px;
    max-width: 90vw;
}

.admin-bar .map-modal-search-container {
    top: 32px !important;
}

@media screen and (max-width: 782px) {
    .admin-bar .map-modal-search-container {
        top: 46px !important;
    }
}

#mapModalSearchInput:focus {
    outline: none;
    border-color: var(--rov-green);
    box-shadow: 0 0 0 0.25rem rgba(0, 117, 74, 0.25);
}


/* Places Autocomplete Dropdown */
.places-autocomplete-item:last-child {
    border-bottom: none !important;
}
.places-autocomplete-item:hover {
    background-color: #f8f9fa !important;
}

/* ===================================
   MEDIA WIDGET IN OFFCANVAS
   =================================== */

#stopDetailsModal #rovMediaGridContainer[data-in-offcanvas="true"] {
    padding: 0 !important;
    margin: 0 !important;
}

#stopDetailsModal #rovMediaGridContainer[data-in-offcanvas="true"] h3 {
    /* Bootstrap: mb-3 fs-6 */
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

#stopDetailsModal #modalMediaUploadArea {
    width: 100%;
}

/* In the narrow location-editor offcanvas the shared .upload-card
   (media-grid.css: width:100% aspect-ratio:1) collapses to a ~101px
   square in the repeat(3,1fr) grid — far too small for FilePond's
   drop label, which overflows/garbles. Span the dropzone full width
   and give it a readable height (FilePond's own min-height lives on
   .filepond--root, which is display:contents and thus inert). Scoped
   to the offcanvas dropzone only — main media stage + media thumbs
   (.media-card) are unaffected. */
#stopDetailsModal #modalMediaUploadArea .upload-card {
    grid-column: 1 / -1;
    aspect-ratio: auto;
    min-height: 160px;
}

/* ===================================
   ASSOCIATED STORIES (View Collections)
   =================================== */

.collection-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--rov-green);
    color: white;
    border-radius: 50%;
    font-size: 0.65rem;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.collection-indicator:hover {
    transform: scale(1.1);
}

#associatedStoriesCard .associate-btn {
    cursor: pointer;
    transition: all 0.2s ease;
}

#associatedStoriesCard .associate-btn:hover {
    background: var(--rov-green);
    color: white;
    border-color: var(--rov-green);
}

/* ===================================
   STORY PICKER
   =================================== */

#storyPickerOffcanvas {
    z-index: 1060;
}

#storyPickerList {
    display: flex;
    flex-direction: column;
}

/* Story picker card layout */
.story-picker-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #dee2e6;
    transition: background-color 0.15s ease;
}

.story-picker-card:hover {
    background-color: #f8f9fa;
}

/* Carousel/thumbnail container */
.story-picker-carousel {
    width: 80px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 0.375rem;
    overflow: hidden;
    background-color: #e9ecef;
}

.story-picker-carousel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-picker-carousel .r1v-carousel {
    width: 100%;
    height: 100%;
}

.story-picker-carousel .r1v-carousel-prev,
.story-picker-carousel .r1v-carousel-next {
    display: none;
}

/* Info section (title + location) */
.story-picker-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.story-picker-title,
.story-picker-location {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.story-picker-title {
    font-weight: 500;
    color: #212529;
}

.story-picker-location {
    font-size: 0.875rem;
    color: #6c757d;
}

/* Action buttons */
.story-picker-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.story-picker-actions .btn {
    font-size: 0.8125rem;
    padding: 0.25rem 0.5rem;
}

/* Search input styling */
#storyPickerSearch {
    border-radius: 0.375rem;
}

#storyPickerSearch:focus {
    border-color: var(--rov-green);
    box-shadow: 0 0 0 0.2rem rgba(var(--rov-green-rgb), 0.25);
}

/* ===================================
   REFERENCED LOCATION CARDS
   =================================== */

/* Referenced cards have subtle visual distinction without color */
.itinerary-card-referenced .location-card {
    opacity: 0.9;
}

.itinerary-card-referenced:hover .location-card {
    opacity: 1;
}

/* ===================================
   CREATOR INTRO DRAFTS GRID
   Bootstrap 5 handles most layout via classes.
   Only custom styles that Bootstrap can't handle.
   =================================== */

/* Thumbnail aspect ratio */
.draft-thumbnail {
    aspect-ratio: 16 / 9;
}

/* Title line clamp */
.draft-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Delete button - 36x36 touch target */
.draft-delete-btn {
    width: 36px;
    height: 36px;
}

.draft-delete-btn:hover {
    color: #dc3545;
}

/* Drafts list */
.creator-drafts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.creator-draft-card {
    position: relative;
}


.creator-draft-row {
    display: flex;
    align-items: stretch;
    text-decoration: none;
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 14px;
    position: relative;
    transition: background 0.18s ease;
}

.creator-draft-row:hover {
    background: rgba(255, 255, 255, 0.06);
}

/* Thumbnail — tall left image */
.draft-row-thumbnail {
    width: 220px;
    min-height: 180px;
    background: rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
    border-top-left-radius: 14px;
    border-bottom-left-radius: 14px;
    overflow: hidden;
}

/* Body */
.draft-row-body {
    flex: 1;
    min-width: 0;
    padding: 20px 22px 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.draft-row-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 7px;
}

.draft-status-badge {
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 2px 8px;
    border-radius: 4px;
}

.draft-status-badge.not-started {
    background: rgba(0, 117, 74, 0.25);
    color: #4cde9e;
}

.draft-status-badge.in-progress {
    background: rgba(0, 117, 74, 0.25);
    color: #4cde9e;
}

.draft-status-badge.complete {
    background: var(--rov-yellow);
    color: #111;
}

.draft-row-time {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.6);
}

.draft-row-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: #fff;
}

.draft-row-excerpt {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.75);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
    margin: 0;
}

/* Actions column */
.draft-row-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    flex-shrink: 0;
    align-self: center;
}

/* Action buttons */
.draft-btn-continue,
.draft-btn-publish {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1.3rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s;
    white-space: nowrap;
    background: var(--rov-green);
    border: 1px solid var(--rov-green);
    color: #fff;
}

.draft-btn-continue:hover,
.draft-btn-publish:hover {
    opacity: 0.88;
    color: #fff;
}

.draft-menu-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.15s;
}

.draft-menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.8);
    color: #fff;
}

.draft-actions {
    position: relative;
}

/* Progress bar as bottom border */
.draft-progress-track-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.12);
}

.draft-progress-fill-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--rov-green);
    transition: width 0.3s ease;
}

@media (max-width: 576px) {
    .creator-draft-row {
        flex-direction: column;
    }

    .draft-row-thumbnail {
        width: 100%;
        min-height: 160px;
        border-radius: 14px 14px 0 0;
    }

    .draft-row-body {
        padding: 14px 16px 12px;
    }

    .draft-row-excerpt {
        white-space: normal;
    }

    .draft-row-actions {
        justify-content: flex-end;
        padding: 12px 16px 16px;
    }
}

/* Loading state for deferred scripts */
body.creator-loading {
    cursor: wait;
}

body.creator-loading .btn-wizard-primary,
body.creator-loading .creator-draft-card {
    pointer-events: none;
}

body.creator-loading .btn-wizard-primary span {
    display: none;
}

body.creator-loading .btn-wizard-primary::after {
    content: "";
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-left: 8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: creator-spin 0.8s linear infinite;
}

@keyframes creator-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Story & Media button progress indicator */
.js-edit-stop {
    position: relative;
    overflow: hidden;
    z-index: 0;
}

.js-edit-stop::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background-color: rgba(0, 0, 0, 0.08);
    transition: width 0.4s ease;
    z-index: -1;
    border-radius: inherit;
}

.js-edit-stop[data-progress="1"]::before {
    width: calc(100% / 3);
}

.js-edit-stop[data-progress="2"]::before {
    width: calc(200% / 3);
}

.js-edit-stop[data-progress="3"]::before {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.12);
}
