/* ======================================================
SHARE MODAL DIALOG MOTION
====================================================== */
@media (min-width: 768px) {
    #share-preview-modal.sc-modal .sc-share-modal__dialog {
        transform: translateY(10px) !important;
    }

    #share-preview-modal.sc-modal.show .sc-share-modal__dialog {
        transform: translateY(0) !important;
    }

    #share-preview-modal.sc-modal.sc-is-closing .sc-share-modal__dialog {
        transform: translateY(10px) !important;
    }
}

/* ======================================================
SHARE BUILD MODAL
====================================================== */
#share-preview-modal.sc-share-modal {
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(9px);
    -webkit-backdrop-filter: blur(9px);
    padding: 24px 16px;
    overscroll-behavior: contain;
}

.sc-share-modal__dialog {
    width: min(100%, 760px);
    max-height: min(900px, calc(100vh - 60px));
    max-height: min(900px, calc(100svh - 60px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    padding: 22px 20px 18px;
    border-radius: 14px;
    border: 1px solid #2f2f2f;
    background: #141414;
    font-family: 'IBM Plex Sans', sans-serif;
    position: relative;
}

.sc-modal-dialog.sc-share-modal__dialog {
    padding: 0;
    max-width: 550px;
}

#share-preview-modal .sc-share-modal__close {
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.82);
    z-index: 3;
}

#share-preview-modal .sc-share-modal__close:hover,
#share-preview-modal .sc-share-modal__close:focus-visible {
    color: rgba(255, 255, 255, 0.98);
}

#share-preview-modal .sc-share-modal__close i {
    font-size: 1.8rem;
}

.sc-share-modal__title {
    font-family: inherit;
}

/* ======================================================
SHARE PREVIEW TABS
====================================================== */

.sc-share-preview-tabs {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 10px 16px 6px;
}

.sc-share-preview-tabs-inner {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    background: rgba(255, 255, 255, 0.07);
    border: 0;
    position: relative;
}

.sc-share-preview-tab {
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.2rem;
    transition: color 120ms ease;
    position: relative;
    z-index: 1;
}

.sc-share-preview-tab:hover {
    color: rgba(255, 255, 255, 0.82);
}

.sc-share-preview-tab.is-active {
    color: #fff;
    font-weight: 600;
}

.sc-share-preview-tab-indicator {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 0;
    width: 40px;
    border-radius: 4px;
    background: #e1251b;
    z-index: 0;
    transition: left 120ms cubic-bezier(0.4, 0, 0.2, 1), width 120ms cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.sc-share-modal__cta-btn[disabled],
.sc-share-modal__cta-btn.is-preparing {
    opacity: 0.55;
    cursor: wait;
    pointer-events: none;
}

.sc-share-preview-panels {
    flex: 1 1 auto;
    min-height: 0;
    position: relative;
}

.sc-share-preview-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    visibility: hidden;
    pointer-events: none;
}

.sc-share-preview-slide.is-active {
    visibility: visible;
    pointer-events: auto;
}

/* ======================================================
SHARE PREVIEW
====================================================== */
.sc-share-preview-wrap {
    flex: 1 1 auto;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow: hidden;
    min-height: 420px;
    padding: 0 18px 12px;
}

.sc-share-preview-loader {
    color: rgba(255, 255, 255, 0.72);
    opacity: 0;
    transition: opacity 160ms ease;
}

.sc-share-preview-loader__spinner {
    border: 2px solid rgba(255, 255, 255, 0.16);
    border-top-color: #e1251b;
    animation: sc-share-preview-spin 800ms linear infinite;
}

.sc-share-preview-loader__text {
    font-size: 1.05rem;
    letter-spacing: 0.02em;
}

@keyframes sc-share-preview-spin {
    to {
        transform: rotate(360deg);
    }
}

#share-preview-modal.sc-share-modal.sc-share-modal--preparing .sc-share-preview-loader {
    opacity: 1;
}

#share-preview-modal.sc-share-modal.sc-share-modal--preparing .sc-share-preview-stage {
    opacity: 1;
}


.sc-share-preview-stage {
    --story-scale: 0.3;
    width: calc(1080px * var(--story-scale));
    height: calc(1920px * var(--story-scale));
    aspect-ratio: 9 / 16;
    border-radius: calc(42px * var(--story-scale));
    overflow: hidden;
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: #121214;
    opacity: 1;
    transform: scale(1);
    transform-origin: center center;
    transition: opacity 180ms ease;
}

.sc-share-story-canvas {
    width: 1080px;
    height: 1920px;
    aspect-ratio: 9 / 16;
    position: relative;
    transform: scale(var(--story-scale));
    transform-origin: top left;
    overflow: hidden;
    border-radius: 10px;
    background: #16161a;
    color: #eceae4;
    font-family: 'IBM Plex Sans', Arial, sans-serif;
}

.sc-share-story__skeleton {
    position: absolute;
    inset: 0;
    z-index: 10;
    overflow: hidden;
    background: #252525;
    pointer-events: none;
    opacity: 1;
    transition: opacity 400ms ease;
    will-change: opacity;
}

.sc-share-story__skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 250%;
    height: 100%;
    background: linear-gradient(110deg, transparent 0%, rgba(70, 74, 80, 0.35) 25%, rgba(78, 82, 88, 0.75) 50%, rgba(70, 74, 80, 0.65) 65%, transparent 100%);
    filter: blur(80px);
    transform: translate3d(-100%, 0, 0);
    animation: sc-share-skeleton-shimmer 2.6s ease-in-out infinite;
    will-change: transform;
}

.sc-share-story-canvas.is-loaded .sc-share-story__skeleton {
    opacity: 0;
}

@keyframes sc-share-skeleton-shimmer {
    0%   { transform: translate3d(-120%, 0, 0); }
    100% { transform: translate3d(180%, 0, 0); }
}

.sc-share-story__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(180deg, #1a1a1f 0%, #0f0f12 100%);
}

.sc-share-square__photo-img {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.sc-share-story__center {
    position: relative;
    z-index: 2;
}

.sc-share-story__brand-mark {
    width: 46px;
    height: 46px;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.8));
}

.sc-share-story__wordmark {
    color: #fff;
    font-family: 'Aldrich', sans-serif;
    font-size: 27px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: normal;
    text-shadow:
        0 0 6px rgba(0, 0, 0, 0.2),
        0 2px 10px rgba(0, 0, 0, 0.2),
        0 4px 22px rgba(0, 0, 0, 0.2),
        0 8px 40px rgba(0, 0, 0, 0.2);
}

.sc-share-story__wordmark span {
    color: #e1251b;
    font-size: 0.7em;
}

.sc-share-story__center {
    min-height: 0;
}

.sc-share-story__hero {
    background: rgba(255, 255, 255, 0.04);
}

.sc-share-story__title-block {
    padding-top: 0;
}

.sc-share-story__car-name {
    max-width: 920px;
    color: #e1251b;
    font-size: 60px;
}

.sc-share-story__car-brand-model {
    color: #9a988f;
}

.sc-share-story__section {
    padding-top: 14px;
}

.sc-share-story__section-label {
    color: #9a988f;
    font-size: 27px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: normal;
}

.sc-share-story__section-label + * {
    margin-top: 7px !important;
}

.sc-share-story__section-label span {
    margin-left: 7px;
    color: #77766f;
}

.sc-share-story__spec-highlights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 15px !important;
}

.sc-share-story__spec-card {
    min-height: 142px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-top: 3px solid #e1251b;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.025);
}

.sc-share-story__spec-card-value {
    color: #eceae4;
    font-size: 60px;
    font-weight: 600;
    line-height: 1;
}

.sc-share-story__spec-card-value small {
    padding-bottom: 6px;
    color: #9a988f;
    font-size: 25px;
    font-weight: 400;
}

.sc-share-story__spec-card-label {
    margin-top: 2px;
    color: #9a988f;
    font-size: 23px;
    font-weight: 500;
    letter-spacing: 0.14em;
}

.sc-share-story__spec-row {
    min-height: 74px;
    padding: 0 21px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.025);
    color: #eceae4;
    font-size: 28px;
    line-height: 1.2;
}

.sc-share-story__spec-row dt {
    color: #9a988f;
    font-weight: 500;
    text-transform: uppercase;
}

.sc-share-story__spec-row dd {
    max-width: 60%;
    font-weight: 500;
    text-align: right;
}

.sc-share-story__spec-icon {
    width: 28px;
    height: 28px;
    color: #e1251b;
}

.sc-share-story__mod-pill {
    min-width: 0;
    max-width: 100%;
    min-height: 58px;
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.025);
    color: #969689;
    font-size: 23px;
    font-weight: 500;
    line-height: 1.15;
    white-space: nowrap;
}

.sc-share-story__mod-pill--more {
    color: #9a988f;
    border-style: dashed;
    white-space: nowrap;
}

.sc-share-story__mod-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
}

.sc-share-story__mod-icon svg {
    width: 20px;
    height: 20px;
}

.sc-share-story__mods {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(2, auto);
    max-height: 124px;
}

.sc-share-story__build-link {
    margin-top: 12px;
}

.sc-share-story__build-link-label {
    color: #9a988f;
    font-size: 20px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: normal;
}

.sc-share-story__build-link-url {
    margin-top: 8px !important;
    color: #eceae4;
    font-size: 25px;
    font-weight: 600;
    line-height: 1.15;
}

.sc-share-story__badge {
    width: 300px;
    min-height: 58px;
    padding: 14px 17px;
    border: 1px solid;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.sc-share-story__badge svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.sc-share-story__badge strong {
    flex: 1 1 auto;
    font-family: 'Rajdhani', sans-serif;
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
}

.sc-share-story__badge small {
    flex-shrink: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
    text-align: right;
}

.sc-share-story__badge--og {
    width: 260px;
    border-color: rgba(100, 143, 255, 0.4);
    background: linear-gradient(180deg, rgba(24, 35, 57, 0.96), rgba(19, 25, 41, 0.98));
    color: #87adff;
}

.sc-share-story__badge--legend {
    border-color: #614b24;
    background: linear-gradient(180deg, #241e12 0%, #18130b 100%);
    color: #e6bc6e;
}

.sc-share-story__badge--elite {
    border-color: #4d3766;
    background: linear-gradient(180deg, #1e1729 0%, #17121f 100%);
    color: #a87ae0;
}

/* ======================================================
SQUARE (1:1) SHARE CARD
====================================================== */

/* Stage overrides for square aspect ratio */
.sc-share-preview-stage--post {
    aspect-ratio: 1 / 1;
    height: calc(1080px * var(--story-scale));
}

/* Canvas base */
.sc-share-square-canvas {
    width: 1080px;
    height: 1080px;
    aspect-ratio: 1 / 1;
    background: #16161a;
    color: #eceae4;
    font-family: 'IBM Plex Sans', Arial, sans-serif;
}

/* Full-height content wrapper sits above bg/overlay */
.sc-share-square__wrap {
    height: 100%;
}

/* Photo — top 53% */
.sc-share-square__photo {
    height: 551px; /* 51% of 1080 */
    flex-shrink: 0;
}


/* Dark gradient at the bottom of the photo for badge legibility */
.sc-share-square__photo-scrim {
    height: 40%;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.62) 100%);
    pointer-events: none;
    z-index: 1;
}



/* Title */
.sc-share-square__car-name {
    color: #e1251b;
    font-size: 52px;
    line-height: 0.82;
    letter-spacing: -0.025em;
    max-width: 984px;
}

.sc-share-square__car-brand-model {
    margin-top: 0 !important;
    font-size: 22px;
}

/* Specs section — layout via utility classes on the element */

/* Spec highlight tiles — 3-col for square (HP · Torque · Engine) */
.sc-share-square__spec-highlights {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.sc-share-square-canvas .sc-share-story__spec-card {
    min-height: 90px;
    padding: 16px 18px;
    overflow: hidden;
}

.sc-share-square-canvas .sc-share-story__spec-card-value {
    font-size: 36px;
    flex-wrap: nowrap;
    line-height: 1;
    overflow: hidden;
    min-width: 0;
}

/* Clamp spec value to 1 line — prevents engine string from wrapping */
.sc-share-square-canvas .sc-share-story__spec-card-value span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    min-width: 0;
}

.sc-share-square-canvas .sc-share-story__spec-card-value small {
    font-size: 20px;
    margin-bottom: 2px;
    flex-shrink: 0;
}

.sc-share-square-canvas .sc-share-story__spec-card-label {
    font-size: 16px;
    margin-top: 5px;
}

/* Mods section — layout via utility classes on the element */

/* Mod section label — compact, sentence case */
.sc-share-square-canvas .sc-share-story__section-label {
    font-size: 21px;
    text-transform: none;
    letter-spacing: 0;
}

/* Mod pills — slightly smaller for the square */
.sc-share-square-canvas .sc-share-story__mods {
    max-height: none;
    grid-template-rows: repeat(2, auto);
}

.sc-share-square-canvas .sc-share-story__mod-pill {
    min-height: 50px;
    padding: 8px 14px;
    font-size: 18px;
    gap: 10px;
}

.sc-share-square-canvas .sc-share-story__mod-icon {
    width: 28px;
    height: 28px;
}

.sc-share-square-canvas .sc-share-story__mod-icon svg {
    width: 16px;
    height: 16px;
}

/* Footer — layout (pt, flex-shrink) via utility classes on the element */

.sc-share-square__footer-url {
    color: #eceae4;
    font-size: 20px;
    font-weight: 500;
}

.sc-share-square__footer-cta {
    color: #eceae4;
    font-size: 20px;
    font-weight: 600;
    white-space: nowrap;
    margin-left: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sc-share-square__footer-cta i {
    font-size: 14px;
}

/* ======================================================
SHARE MODAL ACTIONS
====================================================== */
.sc-share-modal__cta-btn {
    transition: filter 160ms ease;
}

.sc-share-modal__cta-btn:hover,
.sc-share-modal__cta-btn:focus-visible {
    filter: brightness(1.07);
}

.sc-share-modal__cta-btn:focus-visible {
    outline: none;
}

.sc-share-modal__utility-toast {
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translate(-50%, -100%);
    padding: 4px 9px;
    border-radius: 6px;
    border: 1px solid #2f2f2f;
    background: #b20011;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
    color: #f4f4f4;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.1;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 160ms ease;
    z-index: 4;
}

.sc-share-modal__utility-toast.is-visible {
    opacity: 1;
    visibility: visible;
}

.sc-share-modal__utility-toast.is-error {
    color: #ff8b8b;
    border-color: rgba(255, 139, 139, 0.35);
    background: rgba(52, 20, 20, 0.92);
}

.sc-share-modal__status {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    padding: 5px 12px;
    max-width: calc(100% - 24px);
    border-radius: 999px;
    border: 1px solid #2f2f2f;
    background: #161618;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #f4f4f4;
    font-size: var(--fs-12);
    flex-shrink: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 180ms ease;
}

.sc-share-modal__status:not(:empty) {
    opacity: 1;
    visibility: visible;
}

.sc-share-modal__status.is-error {
    color: #ff8b8b;
    border-color: rgba(255, 139, 139, 0.35);
    background: rgba(52, 20, 20, 0.92);
}

@media (max-width: 767px) {
    @keyframes sc-share-sheet-slide-up {
        from {
            transform: translateY(100%);
        }

        to {
            transform: translateY(0);
        }
    }

    @keyframes sc-share-sheet-slide-down {
        from {
            transform: translateY(0);
        }

        to {
            transform: translateY(100%);
        }
    }

    #share-preview-modal.sc-share-modal {
        align-items: flex-end;
        padding: 0;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    #share-preview-modal.sc-modal .sc-share-modal__dialog {
        width: 100%;
        max-width: none;
        height: min(92svh, 760px);
        max-height: 92svh;
        padding: 0;
        overflow: hidden;
        border: 0;
        border-radius: 18px 18px 0 0;
        background: #1e1e1e;
        box-shadow: none !important;
        transform: translateY(100%);
        transition: none;
    }

    #share-preview-modal.sc-modal.show .sc-share-modal__dialog {
        animation: sc-share-sheet-slide-up 260ms cubic-bezier(0.16, 1, 0.3, 1) both !important;
    }

    #share-preview-modal.sc-modal.sc-is-closing .sc-share-modal__dialog {
        animation: sc-share-sheet-slide-down 220ms cubic-bezier(0.4, 0, 0.6, 1) both !important;
    }

    #share-preview-modal.sc-modal.show .sc-share-modal__dialog.is-dragging {
        animation: none !important;
        transition: none !important;
    }

    .sc-share-modal__dialog::before {
        content: '';
        position: absolute;
        top: 7px;
        left: 50%;
        width: 36px;
        height: 4px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.24);
        transform: translateX(-50%);
        z-index: 4;
    }

    .sc-share-modal__title {
        padding: 22px 16px 12px;
        font-size: 1.55rem;
        text-align: center;
    }

    #share-preview-modal .sc-share-modal__close {
        display: none;
    }

    .sc-share-preview-wrap {
        flex: 1 1 auto;
        min-height: 0;
        padding: 0 12px 8px;
        overflow: hidden;
    }

    .sc-share-preview-stage {
        flex-shrink: 0;
    }

    .sc-share-preview-tabs {
        padding: 8px 12px 2px;
    }

    .sc-share-modal__actions {
        margin-top: 0;
        padding: 10px 12px max(12px, env(safe-area-inset-bottom));
    }

    .sc-share-modal__cta-btn {
        font-size: 1.1rem;
    }

}
