/*
  © 2025 Eden Memory. All rights reserved.
  Order & Setup Page Styles
*/

/* === MODULE IMPORTS === */
@import 'modules/variables.css';
@import 'modules/reset.css';
@import 'modules/typography.css';
@import 'modules/buttons.css';
@import 'modules/forms.css';
@import 'modules/cards.css';
@import 'modules/layout.css';
@import 'modules/utilities.css';
@import 'modules/ui-common.css';

/* ========================================
   FLOATING TICKET BANNER (Returning Client)
   ======================================== */
.floating-ticket-banner {
    position: fixed;
    top: 24px;
    left: 24px;
    right: 24px;
    max-width: 600px;
    margin: 0 auto;
    z-index: 2000;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border-light);
    animation: slideInDown 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}


.floating-ticket-banner .banner-content {
    flex: 1;
    min-width: 0;
}

.floating-ticket-banner .banner-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.floating-ticket-banner .banner-orders {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.floating-ticket-banner .ticket-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--gray-50);
    padding: 4px 10px;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid var(--border-light);
}

.floating-ticket-banner .ticket-link:hover {
    background: var(--color-black);
    color: var(--color-white);
    border-color: var(--color-black);
    transform: translateY(-1px);
}

.floating-ticket-banner .btn-close-banner {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--gray-400);
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-ticket-banner .btn-close-banner:hover {
    color: var(--text-primary);
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .floating-ticket-banner {
        top: 12px;
        left: 12px;
        right: 12px;
    }
}

/* ========================================
   BROWSER COMPATIBILITY WARNING
   ======================================== */
.browser-compat-banner {
    background: var(--bg-surface);
    border: 1px solid var(--warning-color);
    border-left: 4px solid var(--warning-color);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 24px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    animation: slideInDown 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.browser-compat-icon {
    flex-shrink: 0;
    color: var(--warning-color);
    margin-top: 2px;
}

.browser-compat-body {
    flex: 1;
    min-width: 0;
}

.browser-compat-title {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.browser-compat-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 8px;
    line-height: 1.5;
}

.browser-compat-browsers {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px;
}

.browser-compat-ios {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 8px;
    font-style: italic;
}

.browser-compat-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
}

/* ========================================
   HEADER LIGHT MODE
   ======================================== */
.header-light .nav-links a,
.header-light .lang-current {
    color: #000;
}

.header-light .nav-links a:hover {
    text-shadow: none;
    opacity: 0.7;
}

.header-light .nav-swiper .swiper-slide.active-nav-link a {
    color: #000;
    opacity: 1;
    text-shadow: none;
}

.header-light .nav-swiper a {
    color: #333;
}

.header-light .lang-options .lang-btn {
    color: #333;
    text-shadow: none;
}

.header-light .lang-options .lang-btn.active {
    color: #000;
}

header .desktop-nav {
    justify-content: space-between;
}

/* ========================================
   MODE SWITCHER
   ======================================== */
.mode-switcher-container {
    --switcher-padding: 6px;
    --slider-radius: 35px;
    --container-radius: calc(var(--slider-radius) + var(--switcher-padding));

    display: flex;
    gap: 0;
    justify-content: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    background: var(--gray-100);
    padding: var(--switcher-padding);
    border-radius: var(--container-radius);
    position: relative;
    z-index: 1;
    box-sizing: border-box;
}

.mode-slider {
    position: absolute;
    background: var(--color-white);
    border-radius: var(--slider-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    z-index: 0;
    pointer-events: none;
    top: 0;
    left: 0;
    opacity: 0;
    /* transition will start only when 'ready' is added */
}

.mode-slider.ready {
    opacity: 1;
    transition: left 0.3s cubic-bezier(0.23, 1, 0.32, 1),
        top 0.3s cubic-bezier(0.23, 1, 0.32, 1),
        width 0.3s cubic-bezier(0.23, 1, 0.32, 1),
        height 0.3s cubic-bezier(0.23, 1, 0.32, 1),
        opacity 0.2s ease;
}

.mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 24px;
    border: none;
    border-radius: var(--slider-radius);
    background: transparent;
    cursor: pointer;
    transition: color 0.3s ease;
    flex: 1;
    min-width: 140px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    font-family: var(--font-main);
    position: relative;
    z-index: 1;
    box-sizing: border-box;
}

.mode-btn:hover {
    color: var(--text-primary);
}

.mode-btn.active {
    color: var(--color-black);
}

.mode-switcher-container .mode-btn[data-mode="link"] {
    color: var(--text-secondary);
}

.mode-switcher-container .mode-btn[data-mode="link"]:hover {
    color: var(--text-primary);
}

.mode-switcher-container .mode-btn[data-mode="link"].active {
    color: var(--color-black);
}

.mode-btn .mode-desc {
    display: block;
    font-size: 12px;
    font-weight: 500;
    margin-top: 4px;
    opacity: 0.6;
    line-height: 1.2;
}

/* Mobile Mode Switcher */
@media (max-width: 768px) {
    .mode-switcher-container {
        --switcher-padding: 4px;
        --slider-radius: 35px;
        --container-radius: calc(var(--slider-radius) + var(--switcher-padding));
        flex-direction: column;
        gap: 0 !important;
        align-items: stretch;
        padding: var(--switcher-padding) !important;
        border-radius: var(--container-radius) !important;
    }

    .mode-btn {
        width: 100%;
        min-width: 0;
        padding: 16px 24px;
        border-radius: var(--slider-radius) !important;
    }

    .mode-slider {
        border-radius: var(--slider-radius) !important;
    }
}

@media (max-width: 767px) {
    .mode-switcher-container {
        --switcher-padding: 4px;
        --slider-radius: 40px;
        --container-radius: calc(var(--slider-radius) + var(--switcher-padding));
        flex-direction: column;
        align-items: stretch;
        gap: 0 !important;
        padding: var(--switcher-padding) !important;
        border-radius: var(--container-radius) !important;
        margin-bottom: 16px !important;
    }

    .mode-btn {
        width: 100%;
        max-width: 100%;
        min-width: unset;
        padding: 20px 24px;
        border-radius: var(--slider-radius) !important;
    }

    .mode-slider {
        border-radius: var(--slider-radius) !important;
    }

    .mode-btn .mode-desc {
        font-size: 12px;
    }
}

/* Tablet Mode Switcher */
@media (min-width: 768px) and (max-width: 1024px) {
    .mode-switcher-container {
        gap: 15px;
    }

    .mode-btn {
        min-width: 200px;
        padding: 20px 25px;
    }
}

/* ========================================
   STYLE OPTIONS (Radio Cards)
   ======================================== */
.style-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 600px) {
    .style-options {
        grid-template-columns: 1fr;
    }
}

/* Horizontal style options */
.style-options-horizontal {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.style-options-horizontal .style-option-card {
    width: 100%;
}

.style-options-horizontal .style-card-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    text-align: left;
    padding: 20px 24px;
    gap: 20px;
    aspect-ratio: unset;
}

.style-options-horizontal .style-option-icon {
    width: 56px;
    height: 56px;
    min-width: 56px;
    margin-bottom: 0;
    border-radius: 16px;
}

.style-options-horizontal .style-option-icon svg {
    width: 26px;
    height: 26px;
}

.style-options-horizontal .style-text-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.style-options-horizontal .style-title {
    font-size: 17px;
    margin-bottom: 4px;
}

.style-options-horizontal .style-desc {
    font-size: 13px;
    max-width: none;
}

.style-options-horizontal .style-option-card input[type="radio"]:checked+.style-card-content::after {
    top: 50%;
    transform: translateY(-50%);
    right: 20px;
}

/* Style Option Card */
.style-option-card {
    display: block;
    cursor: pointer;
    position: relative;
}

.style-option-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.style-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 24px;
    border: 2px solid #f2f2f7;
    border-radius: 28px;
    background: #fff;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    position: relative;
    overflow: hidden;
}

.style-option-icon {
    width: 72px;
    height: 72px;
    margin-bottom: 24px;
    color: #86868b;
    background: #f5f5f7;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s ease;
}

.style-option-icon svg {
    width: 32px;
    height: 32px;
}

.style-option-card:hover .style-card-content {
    border-color: #d2d2d7;
    background: #fff;
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.05);
}

.style-option-card:hover .style-option-icon {
    background: #e8e8ed;
    color: #1d1d1f;
}

.style-option-card input[type="radio"]:checked+.style-card-content {
    border-color: #000;
    background: #fff;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.style-option-card input[type="radio"]:checked+.style-card-content .style-option-icon {
    background: #1d1d1f;
    color: #fff;
    transform: scale(1.05);
}

.style-title {
    font-size: 19px;
    font-weight: 800;
    color: #1d1d1f;
    margin-bottom: 10px;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.style-desc {
    font-size: 14px;
    color: #86868b;
    line-height: 1.5;
    margin-bottom: 0;
    max-width: 200px;
}

.style-link {
    font-size: 13px;
    color: #0066cc;
    text-decoration: none;
    font-weight: 500;
    align-self: flex-start;
    transition: color 0.2s;
}

.style-link:hover {
    color: #004499;
    text-decoration: underline;
}

.style-option-card input[type="radio"]:checked+.style-card-content::after {
    content: '';
    position: absolute;
    top: 20px;
    right: 20px;
    width: 28px;
    height: 28px;
    background: #000 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E") no-repeat center;
    background-size: 14px;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Mobile Style Options */
@media (max-width: 767px) {
    #style-selection-block {
        padding: 0;
    }

    .style-card-content {
        padding: 15px;
    }

    .style-title {
        font-size: 15px;
    }

    .style-desc {
        font-size: 13px;
    }

    .style-option-card input[type="radio"]:checked+.style-card-content::before {
        top: 10px;
        right: 10px;
        width: 22px;
        height: 22px;
        font-size: 12px;
    }

    #style-selection-block .form-group {
        margin-bottom: 20px;
    }
}

/* ========================================
   SIMPLE STORY UPLOAD SECTION
   ======================================== */
#simple-story-upload-section {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 0;
}

#simple-story-upload-section h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

#simple-story-upload-section .form-group {
    margin-bottom: 0;
}

#simple-story-upload-section input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 1.5rem;
    font-size: 16px;
    background-color: #fff;
    cursor: pointer;
}

/* Story File Upload */
#story-file-input {
    display: none;
}

.story-upload-container {
    display: none;
    width: 100%;
    margin-bottom: 20px;
}

.story-upload-container.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

.custom-file-upload-label {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    height: 200px !important;
    min-height: 200px !important;
    background-color: #fafafa !important;
    border: 2px dashed #ccc !important;
    border-radius: 2rem !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 auto !important;
    gap: 10px !important;
    box-sizing: border-box !important;
}

.custom-file-upload-label:hover {
    background-color: #f0f0f0 !important;
    border-color: #999 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.custom-file-upload-label:active {
    transform: translateY(0);
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin: 0;
    fill: #4CAF50;
    display: none;
    transition: all 0.3s ease;
}

.upload-text-main {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    display: block !important;
    margin: 0 !important;
    line-height: 1.2 !important;
    text-align: center !important;
}

.upload-text-sub {
    font-size: 14px;
    color: #888;
    display: block !important;
    margin: 0 !important;
    line-height: 1.2 !important;
    text-align: center !important;
}

.custom-file-upload-label.has-file {
    border-style: solid !important;
    border-color: #4CAF50 !important;
    background-color: #f9fff9 !important;
    justify-content: center !important;
}

.custom-file-upload-label.has-file .upload-icon {
    display: block !important;
    margin-bottom: 10px !important;
}

.file-name-display {
    font-family: monospace;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    max-width: 90%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center !important;
    margin: 0 !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 767px) {
    #simple-story-upload-section {
        padding: 0;
    }

    .custom-file-upload-label {
        min-height: 160px;
    }
}

/* ========================================
   PHOTO LIST & ITEMS
   ======================================== */
.photo-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    min-height: 50px;
}

.photo-item {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 1.5rem;
    overflow: hidden;
    cursor: grab;
    transition: border-color 0.2s, box-shadow 0.2s;
    border: 2px solid transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.photo-item:active {
    cursor: grabbing;
}

.photo-item.sortable-selected {
    border-color: #0d6efd;
    box-shadow: 0 0 8px rgba(13, 110, 253, 0.5);
}

.photo-item .photo-order-number {
    position: absolute;
    top: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 2px 6px;
    border-bottom-right-radius: 1.5rem;
    z-index: 2;
}

.photo-item img,
.photo-item .preview-content {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #eee;
}

.video-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.video-overlay svg,
.photo-item .video-overlay {
    width: 40px;
    height: 40px;
    fill: rgba(255, 255, 255, 0.9);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.photo-item .remove-photo-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 16px;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 3;
}

.photo-item:hover .remove-photo-btn {
    opacity: 1;
}

.photo-item.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f0f0;
    cursor: progress;
}

/* Photo Loading/Error States */
.photo-item.loading-item .loading-placeholder {
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
}

/* ========================================
   MUSIC PILL PLAYER (PREMIUM)
   ======================================== */
.music-list-vertical {
    display: flex;
    flex-direction: column;
    gap: 36px;
    width: 100%;
    margin-top: 36px;
    margin-bottom: 12px;
    box-sizing: border-box;
}

.music-item-pill-wrapper {
    width: 100%;
    position: relative;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    cursor: grab;
    user-select: none;
}

.music-item-pill-wrapper:active {
    cursor: grabbing;
}

.music-order-num {
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.music-pill-label-top {
    font-size: 14px;
    font-weight: 400;
    color: var(--gray-400);
    margin-bottom: 10px;
    margin-left: 24px;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 48px);
}

.music-pill-capsule {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 9999px;
    box-shadow: var(--shadow-soft);
    padding: 0 24px;
    height: 84px;
    box-sizing: border-box;
    position: relative;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.music-pill-capsule:hover {
    border-color: var(--gray-300);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.09);
}

.music-pill-actions-left {
    flex-shrink: 0;
}

.music-pill-actions-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.music-pill-player-core {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0 10px;
}

.music-pill-progress-track {
    width: 100%;
    height: 14px;
    /* Slightly thicker */
    background: var(--gray-200);
    /* Contrasting background using variable */
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    overflow: visible;
    /* Allow trim handles to extend beyond track height */
}

/* Trim active state — keep background consistent */
.music-pill-progress-track.trim-active {
    background: var(--gray-200);
}

.music-pill-progress-track.trim-active .music-pill-progress-fill {
    opacity: 1;
}

/* Selected (kept) zone — lightens fully to white */
.music-trim-selection {
    position: absolute;
    top: 0;
    bottom: 0;
    background: #ffffff;
    z-index: 2;
    pointer-events: none;
    border-radius: 20px;
}

/* Trim handles — small circles at handle positions */
.music-trim-hnd {
    position: absolute;
    top: 50%;
    width: 20px;
    height: 20px;
    background: #ffffff;
    border: 2px solid #000000;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: col-resize;
    z-index: 10;
    touch-action: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.music-pill-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: var(--color-black);
    width: 0%;
    border-radius: 20px;
    transition: none !important;
    /* critical for smooth RAF updates */
    will-change: width;
}

.music-pill-trim-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
}

.music-pill-trim-selection {
    position: absolute;
    top: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    border-left: 2.5px solid #000;
    border-right: 2.5px solid #000;
}

.music-trim-handle {
    position: absolute;
    top: 50%;
    width: 32px;
    height: 32px;
    background: #fff;
    border: 1.5px solid #000;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    cursor: col-resize;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.music-trim-handle svg {
    width: 16px;
    height: 16px;
    color: #000;
}

.music-action-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border-light);
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    padding: 0;
}

.music-action-btn:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.music-action-btn svg {
    width: 20px;
    height: 20px;
}

.music-action-btn.btn-remove svg {
    color: var(--text-primary);
}

/* Trim button turns filled/green when trim is saved on this track */
.music-action-btn.btn-trim--active {
    background: #000;
    border-color: #000;
}

.music-action-btn.btn-trim--active svg {
    color: #fff;
}

.music-action-btn.btn-remove:hover {
    background: #fff1f0;
    border-color: #ffa39e;
}

.music-action-btn.btn-remove:hover svg {
    color: #f5222d;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .music-list-vertical {
        display: block !important;
        margin-top: 30px;
    }

    .music-pill-capsule {
        height: 64px;
        padding: 0 16px;
        margin-bottom: 24px;
        gap: 12px;
    }

    .music-pill-actions-right {
        gap: 8px;
    }

    .music-action-btn {
        width: 38px;
        height: 38px;
    }
}

.photo-item.error-item {
    border: 2px solid #ff4d4f;
}

.photo-item.error-item .preview-content {
    background-color: #fff2f0;
}

/* Video Fallback */
.video-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 5px;
    box-sizing: border-box;
    text-align: center;
    background-color: #e9ecef;
}

.video-fallback .video-overlay {
    width: 30px;
    height: 30px;
    fill: #495057;
}

.video-fallback .file-name {
    font-size: 10px;
    color: #495057;
    margin-top: 5px;
    line-height: 1.3;
    word-break: break-all;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Mobile Photo List */
@media (max-width: 767px) {
    .photo-list {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }

    .photo-item {
        width: 100%;
        height: auto;
        aspect-ratio: 1/1;
    }

    .photo-item .remove-photo-btn {
        opacity: 1;
    }

    .photo-item .video-actions-overlay {
        opacity: 1 !important;
        visibility: visible !important;
    }
}

/* ========================================
   MUSIC SECTION
   ======================================== */
#music-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.music-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f0f0f0;
    padding: 8px 12px;
    border-radius: 1rem;
    font-size: 14px;
}

.music-item .remove-music-btn {
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #888;
}

.music-item .remove-music-btn:hover {
    color: #333;
}

.music-content,
.style-part-content {
    margin-top: 20px;
    animation: setup-fadeIn 0.4s ease;
}

.is-collapsed .music-content,
.is-collapsed .style-part-content {
    display: none !important;
}

/* ========================================
   GLOBAL PROGRESS HEADER (Setup Wizard)
   ======================================== */
.global-progress-header {
    max-width: 1040px;
    margin: 30px auto 10px;
    padding: 40px 40px 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0;
    animation: setup-fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.global-progress-header:has(.h-success-state-standard) {
    align-items: flex-end;
}

.progress-content-left {
    flex: 1;
    padding-bottom: 40px;
    overflow: visible;
}

.progress-header-title {
    font-family: var(--font-main);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--text-secondary);
    margin: 0 auto;
    display: block;
    opacity: 0.7;
    max-width: 1040px;
    text-align: left;
}

/* Header Timeline */
.header-timeline {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    overflow: visible;
}

.h-timeline-step {
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.h-timeline-step.active,
.h-timeline-step.completed {
    opacity: 1;
}

.h-step-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 2px solid var(--gray-400);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--gray-400);
    font-size: 12px;
}

.h-timeline-step.completed .h-step-icon {
    background: var(--success-color);
    border-color: var(--success-color);
    color: #fff;
}

.h-timeline-step.active .h-step-icon {
    border-color: var(--primary-accent);
    color: var(--primary-accent);
    background: var(--bg-surface);
}

.h-step-label {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    transition: font-size 0.3s ease;
    scroll-behavior: smooth;
}

.h-timeline-step:not(.active):not(.completed) .h-step-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.h-step-separator {
    width: 2px;
    height: 12px;
    background: var(--gray-200);
    margin-left: 11px;
    transition: height 0.3s ease;
}

.h-step-separator.completed {
    background: var(--success-color);
}

.h-step-icon-svg {
    width: 10px;
    height: 10px;
}

.h-step-dot {
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
}

/* Tag Visualization (QR Code) */
.tag-visualization {
    display: none;
    width: 420px;
    height: 100%;
    position: relative;
    flex-shrink: 0;
    align-items: center;
    justify-content: flex-end;
    transition: all 0.3s ease;
    z-index: 1;
}

.tag-visualization.has-qr {
    display: flex;
    animation: tag-slide-in 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.tag-visualization::after {
    content: '';
    width: 420px;
    height: 420px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.8), 0 25px 80px rgba(0, 0, 0, 0.22);
    margin-right: -80px;
}

.qr-code-styling-container {
    position: absolute;
    right: -30px;
    top: 50%;
    transform: translateY(calc(-50% - 10px));
    width: 320px;
    height: 320px;
    opacity: 0.15;
    mix-blend-mode: multiply;
    pointer-events: none;
}

.qr-code-styling-container canvas {
    width: 100% !important;
    height: 100% !important;
}

@keyframes tag-slide-in {
    from {
        transform: translateX(100px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Success State */
.h-success-state-standard {
    display: flex;
    align-items: center;
    animation: h-success-entrance 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.h-draw-path {
    stroke-dasharray: 25;
    stroke-dashoffset: 25;
    animation: h-stroke-draw 0.6s cubic-bezier(0.65, 0, 0.45, 1) 0.3s forwards;
}

@keyframes h-stroke-draw {
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes h-success-entrance {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Timeline Steps in Body */
.timeline-step.active .step-indicator {
    background: #fff;
    border-color: var(--primary-accent);
    color: var(--primary-accent);
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.05);
}

.step-content {
    flex: 1;
    padding-top: 2px;
}

.step-label {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 2px;
    display: block;
}

.timeline-step:not(.active):not(.completed) .step-label {
    color: var(--text-secondary);
}

/* Mobile Progress Header */
@media (max-width: 768px) {
    .global-progress-header {
        padding: 24px !important;
        margin: 20px auto !important;
        align-items: flex-end !important;
        flex-direction: row;
        position: relative;
        overflow: hidden;
        min-height: 333px;
    }

    .global-progress-header:has(.h-success-state-standard) {
        padding-left: 24px !important;
        padding-right: 24px !important;
    }

    .global-progress-header .progress-content-left {
        max-width: 100% !important;
        display: flex !important;
        justify-content: flex-start !important;
        align-items: flex-end !important;
        padding-right: 0 !important;
        text-align: left !important;
        margin: 0 !important;
        height: 100% !important;
    }

    .tag-visualization {
        display: none !important;
    }

    .tag-visualization.has-qr {
        display: flex !important;
        opacity: 0.45 !important;
        opacity: 0.45 !important;
        transform: scale(0.9) translateY(30px);
        /* Match JS start state to prevent jump */
        margin-right: 0;
        /* animation: tag-slide-in-mobile ... removed to prevent jump */
        position: absolute;
        left: auto;
        right: 0;
        bottom: 0;
        top: auto;
        width: 380px;
        height: 380px;
        z-index: 1;
        background: transparent !important;
        box-shadow: none !important;
        pointer-events: none;
        align-items: flex-end;
        justify-content: flex-end;
    }

    @keyframes tag-slide-in-mobile {
        from {
            transform: scale(0.9) translateX(30px) translateY(30px);
            opacity: 0;
        }

        to {
            transform: none;
            opacity: 0.45;
        }
    }

    .tag-visualization::after {
        width: 340px;
        height: 340px;
        border-radius: 12px;
        background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
        box-shadow: 0 20px 55px rgba(0, 0, 0, 0.22), 0 8px 20px rgba(0, 0, 0, 0.15);
        margin-right: -60px;
        margin-bottom: -60px;
    }

    .tag-visualization .qr-code-styling-container {
        width: 260px;
        height: 260px;
        right: -20px;
        top: auto;
        bottom: -20px;
        transform: none;
        mix-blend-mode: multiply;
        opacity: 0.25;
    }

    .h-success-state-standard .h-timeline-step {
        flex-direction: row !important;
        gap: 12px !important;
        align-items: center !important;
        text-align: left !important;
        opacity: 1 !important;
    }

    .h-success-state-standard .h-step-label {
        font-size: 15px !important;
    }

    .progress-content-left {
        flex: 1;
        z-index: 2;
        max-width: 100% !important;
        padding-bottom: 4px !important;
    }

    .progress-header-title {
        font-size: 11px;
        margin-bottom: 16px;
    }

    .h-step-label {
        font-size: 15px;
        /* transition: opacity 0.2s ease; - handled by JS now for smoothness */
        will-change: transform, opacity;
    }

    /* Magnet Effect Class (JS Injected) */
    .h-timeline-step.active-magnet .h-step-label {
        transform: scale(1.1);
        color: var(--text-primary);
        opacity: 1;
    }

    .header-timeline {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 12px;
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden !important;
        /* fix: prevent vertical scrollbar */
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        /* Firefox */
        -ms-overflow-style: none;
        /* IE/Edge */
        scroll-snap-type: x mandatory;
        padding-right: 120px;
        padding-left: 20px;
    }

    .header-timeline::-webkit-scrollbar {
        display: none !important;
        /* Chrome/Safari */
        width: 0 !important;
        height: 0 !important;
        background: transparent !important;
        -webkit-appearance: none !important;
    }

    .h-timeline-step {
        flex-shrink: 0;
        padding-bottom: 0;
        scroll-snap-align: start;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    .h-step-separator {
        width: 30px;
        height: 2px;
        background: var(--gray-200);
        margin: 0 4px;
        flex-shrink: 0;
    }
}

@media (max-width: 767px) {
    .global-progress-header {
        margin: 20px 16px 10px;
        max-width: calc(100% - 32px);
        padding: 24px 0 0 0 !important;
        gap: 0;
        overflow: hidden !important;
        /* fix: plaque must be clipped by border-radius */
    }

    .progress-content-left {
        width: 100%;
        text-align: left;
        max-width: 100%;
        padding-left: 0 !important;
        /* fix: remove padding wrapper so scroll reaches edge */
    }

    .header-timeline {
        padding-left: 24px;
        /* fix: Padding inside scroll container */
    }

    .progress-header-title {
        text-align: left;
        margin-bottom: 20px;
        display: block;
    }

    .setup-header {
        padding: 30px 20px 20px;
    }
}

/* ========================================
   SETUP SPECIFIC COMPONENTS
   ======================================== */
.setup-header-content p.description,
.setup-header-content .section-title {
    max-width: 1000px !important;
    text-align: left;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

p.description.mt-20 {
    max-width: 1040px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
    padding-left: 0;
}

@media (min-width: 1040px) {

    p.description.mt-20,
    .setup-header-content {
        padding-left: 0;
    }
}

.setup-header {
    padding: 20px 0 10px;
    text-align: left;
    max-width: 1040px;
    margin: 0 auto;
}

/* Standardized Setup Containers */
#order-section .container,
#screen-pending .container,
#screen-review .container {
    max-width: 1080px;
    width: 100%;
    padding: 0 20px !important;
    margin: 0 auto;
}

#order-section {
    padding-top: 80px;
}

@media (max-width: 767px) {
    #order-section {
        padding-top: 80px;
    }

    header .mobile-nav {
        justify-content: space-between;
        padding: 0 20px;
    }

    .mobile-nav .dropdown-arrow {
        display: block !important;
    }
}

/* Story Submit Button */
#submit-order-btn.btn-story-submit,
#submit-setup-btn.btn-story-submit {
    background-color: var(--color-black);
    border-color: var(--color-black);
    color: var(--color-white);
}

#submit-order-btn.btn-story-submit:hover,
#submit-setup-btn.btn-story-submit:hover {
    background-color: #333333;
    border-color: #333333;
}

/* Structure Title Alignment */
#structure-title {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 0;
}

/* Footer Description on Mobile */
@media (max-width: 767px) {
    #order-section>p.description.mt-20 {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* ========================================
   MOBILE MOBILE RESPONSIVE FIXES
   ======================================== */
@media (max-width: 767px) {

    .main-info-container,
    .parts-section,
    #order-form,
    #setup-form,
    #style-selection-block,
    .mode-switcher-container,
    .global-upload-controls {
        margin-left: auto;
        /* Reset to auto to respect container padding */
        margin-right: auto;
        max-width: 100%;
        width: 100%;
    }

    .text-fields-group input,
    .text-fields-group textarea,
    #order-form input,
    #order-form textarea,
    #setup-form input,
    #setup-form textarea,
    .form-group input,
    .form-group textarea {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
}

/* Content Standard Wrapper Spacing Fix */
#style-selection-block .form-group {
    margin-bottom: 16px;
}

#order-section .description.mt-20 {
    margin-top: 24px;
}

/* Purpose Selection UI (Centering & Layout) */
#purpose-selection-container:not(.d-none) {
    min-height: 80vh !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100%;
}

#purpose-selection-container.d-none {
    display: none !important;
}

/* Wide Form Group for PC */
#purpose-form-group {
    width: 100% !important;
    max-width: 600px !important;
    margin: 0 auto;
}

/* Continue Button Styling & Spacing */
#confirm-purpose-btn {
    width: 100% !important;
    max-width: 100% !important;
    justify-content: center;
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1.5px solid var(--border-light);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    margin-top: 30px !important;
}

#confirm-purpose-btn:not(:disabled):hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

#confirm-purpose-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    background: var(--gray-100);
}

/* Animations - DISABLED for instant page load */
.fade-in-section {
    opacity: 1;
    transform: none;
}

.active-mode {
    display: block !important;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ensure Mode Switcher is visible */
#main-order-interface .mode-switcher-container {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ========================================
   VIDEO ITEM EDIT TRIGGER
   ======================================== */
.video-actions-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 44px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    z-index: 5;
    border-bottom-right-radius: 1.5rem;
    border-bottom-left-radius: 1.5rem;
    opacity: 0;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    overflow: hidden;
    transform: translateY(10px);
}

.photo-item:hover .video-actions-overlay,
.photo-item:active .video-actions-overlay,
#main-photo-preview:hover .video-actions-overlay,
#main-photo-preview:active .video-actions-overlay {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .video-actions-overlay {
        opacity: 1;
        transform: translateY(0);
        height: 38px;
        background: rgba(0, 0, 0, 0.8);
    }

    .action-tile svg {
        width: 16px;
        height: 16px;
    }

    .delete-tile {
        font-size: 20px;
    }
}

.video-actions-overlay>* {
    pointer-events: auto;
}

.action-tile {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    color: rgba(255, 255, 255, 0.8);
}

.action-tile:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.edit-tile {
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.delete-tile:hover {
    background: rgba(239, 68, 68, 0.4);
    /* Subtle red for delete */
}

.action-tile svg {
    width: 18px;
    height: 18px;
}

.delete-tile {
    font-size: 24px;
    line-height: 1;
    padding-bottom: 2px;
}



/* ========================================
   VIDEO EDITOR MODAL (Refined)
   ======================================== */
/* Wrapper for stacking context */
.video-editor-modal,
#image-editor-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    /* Fallback for older browsers */
    height: 100dvh;
    /* Dynamic viewport height ensuring controls shift up */
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    /* Ensure it covers everything on mobile when address bar is shown/hidden */
    bottom: 0;
    right: 0;
    /* Respect safe area */
    padding-bottom: env(safe-area-inset-bottom);
}

.video-editor-modal:not(.d-none),
#image-editor-modal:not(.d-none) {
    opacity: 1;
    pointer-events: auto;
}

.video-editor-backdrop {
    position: fixed;
    /* Fixed is safer to cover view */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: -1;
    /* Behind content but in front of body */
}

/* ... */
.video-editor-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    height: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Center content vertically */
    z-index: 2;
    box-sizing: border-box;
    padding: 0;
}

/* Specific padding for Image Editor to avoid button overlap */
#image-editor-modal .video-editor-container {
    padding-bottom: 120px;
    padding-left: 16px;
    /* Ensure safety from edges */
    padding-right: 16px;
}

/* Video Styling */
.video-area {
    position: relative;
    width: 100%;
}

#image-overlay-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.video-wrapper {
    position: relative;
    width: 100%;
    background: black;
    overflow: hidden;
    max-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

#editor-video-preview {
    width: 100%;
    max-height: 60vh;
    display: block;
    object-fit: contain;
}

/* Click-to-Play Overlay */
.video-click-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    cursor: pointer;
}

.play-icon-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 6;
    opacity: 0.8;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Progress Bar (Playback) */
.editor-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6px;
    /* Increased base height */
    z-index: 10;
    cursor: pointer;
    transition: height 0.2s ease;
}

/* Expanding state when seeking */
.editor-progress-bar.seeking {
    height: 12px;
    /* Double when seeking */
}

.progress-track {
    position: relative;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
}

.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: white;
    width: 0%;
    z-index: 2;
}

.editor-progress-bar .dim-layer {
    position: absolute;
    top: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    /* Deep black dimming */
    z-index: 3;
    pointer-events: none;
}

.editor-progress-bar .dim-layer.left {
    left: 0;
    width: 0%;
}

.editor-progress-bar .dim-layer.right {
    right: 0;
    width: 0%;
}


/* Trim Area (Cut Controls) */
/* Trim Area (Cut Controls) */
.editor-trim-area {
    width: 100%;
    /* Add Blur Background - Stronger as requested */
    background: transparent;
    /* backdrop-filter: blur(40px); REMOVED */
    /* -webkit-backdrop-filter: blur(40px); REMOVED */

    padding: 20px 0;
    box-sizing: border-box;
}

.timeline-track-container {
    position: relative;
    height: 30px;
    display: flex;
    align-items: center;
    width: 100%;
    /* PC: reduced/no padding to align with video as requested */
    padding: 0;
}

.timeline-track {
    position: relative;
    height: 4px;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

/* Selection */
.timeline-selection {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
}

/* Dim Layers on Trim Track */
.timeline-track .dim-layer {
    position: absolute;
    top: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    pointer-events: none;
    z-index: 1;
}

.timeline-track .dim-layer.left {
    left: 0;
    width: 0%;
}

.timeline-track .dim-layer.right {
    right: 0;
    width: 0%;
}

/* Custom Handles */
.timeline-handle {
    position: absolute;
    top: 50%;
    width: 24px;
    height: 24px;
    transform: translate(-50%, -50%);
    cursor: col-resize;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
}

.timeline-handle::after {
    content: '';
    position: absolute;
    top: -15px;
    bottom: -15px;
    left: -15px;
    right: -15px;
}

.handle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.scissors-icon svg {
    width: 18px;
    height: 18px;
    color: white;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.8));
}

.scissors-icon.flipped svg {
    transform: scaleX(-1);
}

/* Custom Handles */
.music-trim-hnd {
    position: absolute;
    top: 50%;
    width: 32px;
    height: 32px;
    transform: translate(-50%, -50%);
    cursor: col-resize;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}

.music-trim-hnd .handle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none !important;
    border: none !important;
}

.music-trim-hnd .handle-icon svg {
    width: 20px;
    height: 20px;
    color: var(--text-primary, #000) !important;
    fill: none !important;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* Ensure no circles in SVGs from MediaManager */
.music-trim-hnd .handle-icon svg circle {
    stroke: currentColor;
    fill: none;
}

.music-trim-hnd .handle-icon.flipped svg {
    transform: scaleX(-1);
}

.trim-time-hint {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    pointer-events: none;
    white-space: nowrap;
    z-index: 20;
    font-variant-numeric: tabular-nums;
}

.music-trim-selection {
    position: absolute;
    top: 0;
    bottom: 0;
    background: transparent;
    z-index: 2;
    pointer-events: none;
}

.music-trim-cut-left,
.music-trim-cut-right {
    position: absolute;
    top: 0;
    bottom: 0;
    background: #fff;
    /* White area as requested */
    z-index: 15;
    pointer-events: none;
}

.music-trim-cut-left {
    left: 0;
    border-top-left-radius: 20px;
    border-bottom-left-radius: 20px;
}

.music-trim-cut-right {
    right: 0;
    border-top-right-radius: 20px;
    border-bottom-right-radius: 20px;
}

.music-trim-hnd-start {
    left: 0;
}

.music-trim-hnd-end {
    left: 100%;
}

/* Floating Actions */
.editor-floating-actions {
    position: absolute;
    bottom: calc(30px + env(safe-area-inset-bottom));
    /* Add safe area to base 30px spacing */
    left: 0;
    width: 100%;
    padding: 0 30px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 20;
}

.actions-right {
    display: flex;
    gap: 20px;
    align-items: center;
}

.float-btn {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    /* Standard-like bounce animation */
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s, border-color 0.2s;
}

.float-btn:active {
    transform: scale(0.9);
}

.float-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.15);
}

/* Mobile & Responsive Adjustments */
@media (max-width: 600px) {
    .video-editor-container {
        width: 100%;
        max-width: 100%;
        justify-content: center;
        padding: 0 16px;
    }

    .video-wrapper {
        border-radius: 16px;
        max-height: 55vh;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }

    .editor-trim-area {
        width: 100%;
        padding: 20px 10px;
        border-radius: 16px;
        margin-top: 10px;
    }

    .timeline-track-container {
        padding: 0;
        /* Edge to edge */
    }

    .editor-floating-actions {
        bottom: 20px;
        padding: 0 20px;
    }
}

/* Cancel Remake Button */
#btn-cancel-remake {
    background: transparent;
    color: var(--text-secondary);
    border: 1.5px solid var(--border-light);
    padding: 14px;
    border-radius: 9999px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 30px;
    font-size: 1rem;
}

#btn-cancel-remake:hover {
    background: var(--bg-surface-hover, #f8f9fa);
    color: var(--error-color, #dc2626);
    border-color: var(--error-color, #dc2626);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.1);
}

#btn-cancel-remake:active {
    transform: translateY(0);
}

/* === STREAMING PREVIEW & LOADING === */
.streaming-loading-screen {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.streaming-status-hero {
    position: relative;
    width: 100%;
}

.streaming-title {
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.7s ease, letter-spacing 0.7s ease;
    transform-origin: left center;
}

.video-preview-wrapper {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    isolation: isolate;
    transform: translateY(0) scale(1);
    transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.9s cubic-bezier(0.16, 1, 0.3, 1),
        border-radius 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.streaming-ready-aura {
    display: none;
}

.streaming-ready-badge {
    display: none;
}

.streaming-ready-dot {
    display: none;
}

.streaming-video-frame.is-visible {
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.28);
}

#streaming-video-container {
    position: relative;
    width: 100%;
    height: 100%;
}

#streaming-video-container>div {
    position: relative;
    width: 100%;
    height: 100%;
}

#streaming-video-container video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    vertical-align: top;
    background: #000;
}

/* Shimmer Animation */
.shimmer-box {
    background: linear-gradient(90deg,
            var(--gray-800) 0%,
            var(--gray-700) 50%,
            var(--gray-800) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Status Text */
.loading-status-text {
    text-align: center;
    margin-top: 24px;
    font-size: 16px;
    color: var(--gray-500);
    font-weight: 500;
    min-height: 24px;
    font-family: var(--font-main);
    letter-spacing: 0.02em;
    animation: fadeInUp 0.5s ease-out;
}

/* Streaming Controls */
.streaming-controls {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
    width: 100%;
    opacity: 0.94;
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.7s ease;
}

.streaming-controls #stream-stop-btn:hover {
    background-color: rgba(255, 77, 79, 0.1);
}

#experimental-preview-ui.is-review-ready .streaming-title {
    transform: translateY(-4px);
    letter-spacing: -0.02em;
}

#experimental-preview-ui.is-review-ready .streaming-video-frame {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 34px 90px rgba(0, 0, 0, 0.24);
}

#experimental-preview-ui.is-review-ready .streaming-controls {
    opacity: 1;
    transform: translateY(0);
}

#experimental-preview-ui:not(.is-review-ready) .streaming-controls {
    transform: translateY(12px);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   REQUIRED ASTERISK & CHECKBOX STYLES
   (Phase 3: Ticket System)
   ======================================== */

/* Required Field Asterisk */
.required-asterisk {
    color: #ef4444;
    font-weight: 600;
    margin-left: 2px;
}

/* Custom Checkbox Container */
.checkbox-group {
    margin-top: 16px;
    margin-bottom: 16px;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    position: relative;
    padding-left: 32px;
    min-height: 24px;
    user-select: none;
}

.checkbox-container input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* Custom Checkmark */
.checkbox-container .checkmark {
    position: absolute;
    left: 0;
    top: 2px;
    height: 22px;
    width: 22px;
    background-color: var(--bg-surface, #fff);
    border: 2px solid var(--border-light, #e5e7eb);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.checkbox-container:hover .checkmark {
    border-color: var(--gray-400, #9ca3af);
}

.checkbox-container input:checked~.checkmark {
    background-color: var(--accent-color, #3b82f6);
    border-color: var(--accent-color, #3b82f6);
}

/* Checkmark Indicator */
.checkbox-container .checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked~.checkmark:after {
    display: block;
}

/* Checkbox Label */
.checkbox-label {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary, #1f2937);
    line-height: 1.5;
}

.checkbox-group .description {
    margin-top: 6px;
    margin-left: 32px;
    font-size: 13px;
    color: var(--text-secondary, #6b7280);
}

/* === PUSH NOTIFICATION BUTTON (Shipping Form) === */
.btn-push-subscribe {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 100px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
    width: 100%;
    justify-content: center;
}

.btn-push-subscribe:hover:not(:disabled) {
    opacity: 0.8;
}

.btn-push-subscribe.push-enabled {
    background: #1a7a3f;
    cursor: default;
}
