/* Melirana Studio — Funnel, Theme Picker & Photo Rotator Styles */

.studio-scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.studio-scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* Smooth stacked image cross-fade rotator */
.studio-rotator {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0f172a;
}

.studio-rotator-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    opacity: 0;
    transition: opacity 600ms ease;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

.studio-rotator-img.is-active {
    opacity: 1;
}

/* Landing page theme cards (ObrazkyAI-inspired 2-up + CTA + Info button) */
.studio-themes-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 18px;
}

@media (min-width: 640px) {
    .studio-themes-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }
}

@media (min-width: 1024px) {
    .studio-themes-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 20px;
    }
}

.studio-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    transition: transform 260ms ease, box-shadow 260ms ease, border-color 260ms ease;
}

.studio-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.10);
    border-color: #c7d2fe;
}

.studio-card-media {
    position: relative;
    width: 100%;
    background: #0f172a;
    overflow: hidden;
}

.studio-card-media--split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    aspect-ratio: 4 / 3;
    background: #e2e8f0;
}

.studio-card-media--single {
    aspect-ratio: 3 / 4;
}

.studio-card-media--single img {
    object-position: center top;
}

/* Studio Before / After Comparison Slider on Theme Cards */
.studio-compare-slider {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: 16px;
    background: #0f172a;
    user-select: none;
    -webkit-user-select: none;
    touch-action: pan-y;
    cursor: ew-resize;
    outline: none;
}

.studio-compare-slider:focus-visible {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.6);
}

.studio-compare-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

.studio-compare-img--after {
    z-index: 1;
}

.studio-compare-img--before {
    z-index: 2;
    will-change: clip-path;
}

.studio-compare-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    z-index: 5;
    pointer-events: none;
    transform: translateX(-50%);
    will-change: left;
}

.studio-compare-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.55);
}

.studio-compare-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 34px;
    height: 34px;
    border-radius: 9999px;
    background: #ffffff;
    border: 2px solid rgba(15, 23, 42, 0.15);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0f172a;
    transition: transform 0.15s ease;
}

.studio-compare-slider.is-active .studio-compare-handle {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.studio-compare-handle-icon {
    width: 17px;
    height: 17px;
}

.studio-compare-badge {
    position: absolute;
    bottom: 8px;
    z-index: 4;
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #ffffff;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    line-height: 1.1;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.studio-compare-badge--before {
    left: 8px;
}

.studio-compare-badge--after {
    right: 8px;
}

@keyframes studioCompareWiggle {
    0% {
        clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
        -webkit-clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
    }
    30% {
        clip-path: polygon(0 0, 36% 0, 36% 100%, 0 100%);
        -webkit-clip-path: polygon(0 0, 36% 0, 36% 100%, 0 100%);
    }
    70% {
        clip-path: polygon(0 0, 64% 0, 64% 100%, 0 100%);
        -webkit-clip-path: polygon(0 0, 64% 0, 64% 100%, 0 100%);
    }
    100% {
        clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
        -webkit-clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
    }
}

@keyframes studioDividerWiggle {
    0% { left: 50%; }
    30% { left: 36%; }
    70% { left: 64%; }
    100% { left: 50%; }
}

.studio-compare-slider.is-wiggling .studio-compare-img--before {
    animation: studioCompareWiggle 1s ease-in-out;
}

.studio-compare-slider.is-wiggling .studio-compare-divider {
    animation: studioDividerWiggle 1s ease-in-out;
}

.studio-ai-pill {
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 9999px;
    background: rgba(15, 23, 42, 0.52);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.88);
    font-size: 9px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: 0.02em;
    white-space: nowrap;
    pointer-events: none;
}

/* Showcase Before/After badge (bottom-left thumbnail of original selfie) */
.studio-showcase-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.45);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    pointer-events: none;
}

.studio-showcase-badge:hover {
    transform: scale(1.04);
}

.studio-showcase-thumb {
    width: 120px;
    height: 120px;
    border-radius: 14px;
    object-fit: cover;
    object-position: center top;
    border: 1.5px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    background: #1e293b;
    flex-shrink: 0;
    display: block;
}

.studio-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px 10px;
    text-align: center;
}

.studio-card-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
}

.studio-card-sub {
    font-size: 0.8125rem;
    color: #64748b;
    line-height: 1.4;
}

.studio-card-actions {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 14px;
}

.studio-btn-create {
    flex: 1 1 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 42px;
    padding: 0 16px;
    border-radius: 11px;
    background: #4f46e5;
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 700;
    transition: background-color 180ms ease, transform 120ms ease;
    text-decoration: none;
}

.studio-btn-create:hover {
    background: #4338ca;
}

.studio-btn-create:active {
    transform: scale(0.98);
}

.studio-btn-info {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 11px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #1e293b;
    transition: background-color 180ms ease, border-color 180ms ease;
    text-decoration: none;
}

.studio-btn-info:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

/* Landing 4-step visual showcase */
.studio-steps-flow {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 640px) {
    .studio-steps-flow {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }
}

@media (min-width: 1024px) {
    .studio-steps-flow {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 16px;
    }
}

.studio-step-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    padding: 22px 20px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
}

/* ==========================================================================
   Dedicated Interactive Theme Picker (/studio/themes)
   ========================================================================== */
.studio-picker-shell {
    height: 100dvh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #0f172a;
}

@media (min-width: 768px) {
    .studio-picker-shell {
        background: #f8fafc;
    }
}

.studio-picker-stage {
    flex: 1 1 0%;
    min-height: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    touch-action: pan-y;
}

.studio-picker-filters {
    position: relative;
    z-index: 30;
    flex-shrink: 0;
    padding: 8px 10px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (min-width: 768px) {
    .studio-picker-filters {
        position: absolute;
        top: 10px;
        left: 10px;
        right: 10px;
        padding: 0;
        background: transparent;
        border-bottom: 0;
        pointer-events: none;
    }
}

.studio-picker-filters > * {
    pointer-events: auto;
}

.studio-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 13px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(15, 23, 42, 0.10);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.14);
    color: #0f172a;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.studio-filter-pill.is-active {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #ffffff;
}

.studio-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9999px;
    background: rgba(15, 23, 42, 0.08);
    color: inherit;
    font-size: 11px;
    font-weight: 700;
}

.studio-filter-pill.is-active .studio-filter-count {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
}

.studio-carousel-viewport {
    flex: 1 1 0%;
    min-height: 0;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.studio-carousel-track {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
    transition: transform 380ms cubic-bezier(0.22, 1, 0.36, 1);
}

.studio-carousel-slide {
    flex: 0 0 100vw;
    width: 100vw;
    height: 100%;
    padding: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 768px) {
    .studio-carousel-slide {
        flex: 0 0 320px;
        width: 320px;
        height: min(64vh, 520px);
        padding: 8px 10px;
    }
}

@media (min-width: 1100px) {
    .studio-carousel-slide {
        flex: 0 0 340px;
        width: 340px;
        height: min(66vh, 550px);
        padding: 8px 11px;
    }
}

.studio-slide-card {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0f172a;
    transition: transform 320ms ease, opacity 320ms ease, box-shadow 320ms ease;
    user-select: none;
}

@media (min-width: 768px) {
    .studio-slide-card {
        border-radius: 20px;
        box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
    }
    .studio-carousel-slide.is-active .studio-slide-card {
        transform: scale(1.05);
        opacity: 1;
        z-index: 10;
        box-shadow: 0 22px 48px rgba(15, 23, 42, 0.28);
        outline: 2px solid rgba(79, 70, 229, 0.45);
    }
    .studio-carousel-slide:not(.is-active) .studio-slide-card {
        transform: scale(0.92);
        opacity: 0.58;
        cursor: pointer;
    }
    .studio-carousel-slide:not(.is-active) .studio-slide-card:hover {
        opacity: 0.84;
    }
}

/* Story progress bars at top of active slide */
.studio-story-bars {
    position: absolute;
    top: 12px;
    left: 14px;
    right: 14px;
    z-index: 20;
    display: flex;
    gap: 5px;
    pointer-events: none;
}

.studio-story-bar {
    flex: 1 1 0%;
    height: 3px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.32);
    overflow: hidden;
}

.studio-story-bar-fill {
    display: block;
    width: 0%;
    height: 100%;
    background: #ffffff;
    border-radius: 9999px;
}

.studio-story-bar.is-done .studio-story-bar-fill {
    width: 100%;
}

.studio-story-bar.is-current .studio-story-bar-fill {
    animation: studioStoryProgress 2400ms linear forwards;
}

@keyframes studioStoryProgress {
    from { width: 0%; }
    to { width: 100%; }
}

.studio-slide-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 15;
    padding: 56px 18px 18px;
    background: linear-gradient(to top, rgba(2, 6, 23, 0.88) 0%, rgba(2, 6, 23, 0.48) 55%, transparent 100%);
    color: #ffffff;
    pointer-events: none;
}

.studio-stage-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 25;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.84);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.24);
    color: #0f172a;
    cursor: pointer;
    touch-action: manipulation;
    transition: transform 160ms ease, background-color 160ms ease, opacity 160ms ease;
}

.studio-stage-arrow:hover {
    background: #ffffff;
    transform: translateY(-50%) scale(1.06);
}

.studio-stage-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

.studio-stage-arrow--prev { left: 10px; }
.studio-stage-arrow--next { right: 10px; }

@media (min-width: 768px) {
    .studio-stage-arrow {
        width: 46px;
        height: 46px;
        background: rgba(255, 255, 255, 0.92);
        border-color: rgba(15, 23, 42, 0.12);
        box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
    }
    .studio-stage-arrow--prev { left: 18px; }
    .studio-stage-arrow--next { right: 18px; }
}

/* Sticky bottom dock on /studio/themes */
.studio-picker-dock {
    flex-shrink: 0;
    z-index: 35;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -6px 20px -4px rgba(15, 23, 42, 0.10);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.studio-thumb-btn {
    flex-shrink: 0;
    position: relative;
    width: 66px;
    height: 82px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #cbd5e1;
    opacity: 0.9;
    cursor: pointer;
    touch-action: manipulation;
    transition: opacity 180ms ease, transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
    background: #0f172a;
    padding: 0;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

@media (min-width: 768px) {
    .studio-thumb-btn {
        width: 74px;
        height: 92px;
        border-radius: 14px;
    }
}

.studio-thumb-btn:hover {
    opacity: 1;
    border-color: #94a3b8;
}

.studio-thumb-btn.is-active {
    opacity: 1;
    border-color: #4f46e5;
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.30);
}

.studio-thumb-check {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.18);
    display: none;
    align-items: center;
    justify-content: center;
}

.studio-thumb-btn.is-active .studio-thumb-check {
    display: flex;
}

.studio-picker-cta {
    position: relative;
    overflow: hidden;
    width: 100%;
    min-height: 56px;
    padding: 8px 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #4f46e5 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 10px 24px -4px rgba(79, 70, 229, 0.42);
    transition: transform 150ms ease, box-shadow 200ms ease;
}

.studio-picker-cta:hover {
    box-shadow: 0 14px 28px -4px rgba(79, 70, 229, 0.52);
}

.studio-picker-cta:active {
    transform: scale(0.99);
}

.studio-picker-cta-shimmer {
    pointer-events: none;
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.18) 50%, transparent 100%);
    transform: translateX(-100%) skewX(-15deg);
    animation: studioShimmer 5s infinite;
}

@keyframes studioShimmer {
    0%, 65% { transform: translateX(-120%) skewX(-15deg); }
    100% { transform: translateX(120%) skewX(-15deg); }
}

/* Upload Wizard Selfie Guide (/studio/{slug}) */
.studio-selfie-rules {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.studio-rule-tile {
    border-radius: 14px;
    padding: 8px 6px 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.studio-rule-tile--ok {
    background: #ecfdf5;
    border: 1.5px solid #6ee7b7;
}

.studio-rule-tile--no {
    background: #fff1f2;
    border: 1.5px solid #fda4af;
}

.studio-rule-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    border-radius: 9999px;
    padding: 2px 7px;
    font-size: 10px;
    font-weight: 800;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.2;
}

.studio-rule-badge--ok {
    background: #059669;
}

.studio-rule-badge--no {
    background: #e11d48;
}

.studio-rule-photo {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    object-position: center top;
    border-radius: 8px;
    display: block;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.studio-rule-tile--ok .studio-rule-photo {
    border: 1px solid rgba(5, 150, 105, 0.25);
}

.studio-rule-tile--no .studio-rule-photo {
    border: 1px solid rgba(225, 29, 72, 0.25);
}

.studio-rule-text {
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.25;
}

.studio-rule-text--ok {
    color: #064e3b;
}

.studio-rule-text--no {
    color: #881337;
}

@media (min-width: 640px) {
    .studio-selfie-rules {
        gap: 12px;
    }
    .studio-rule-tile {
        padding: 10px 8px 12px;
        gap: 8px;
    }
    .studio-rule-text {
        font-size: 11.5px;
    }
}

/* Ensure hidden utility always takes precedence over display utilities (e.g. inline-flex) */
.hidden {
    display: none !important;
}

/* On desktop (>= 768px), hide the mobile Save/Share button, leaving direct download */
@media (min-width: 768px) {
    .gallery-share-photo-btn,
    #gallery-lightbox-share {
        display: none !important;
    }
}

