/* Share-a-checkin modal. Dark surface to match the rest of the app
   (#1a1f29 cards on #131a24 sheet, yellow accent #f2c200, white text).
   The previous light-theme styling read as a different app dropped on top. */

.share-checkin-modal .share-modal-content {
    max-width: 540px;
    background: #131a24;
    border: 1px solid #2e3646;
    color: #eef2f7;
}

.share-checkin-modal .modal-header {
    border-bottom: 1px solid #2e3646;
    background: #151d29;
    position: relative;
}

.share-checkin-modal .modal-header h3 {
    color: #f6f9ff;
}

.share-checkin-modal .modal-close {
    color: #9ca9bb;
}

.share-checkin-modal .modal-close:hover {
    color: #f8fbff;
}

.share-checkin-modal .modal-body {
    background: #131a24;
}

.share-checkin-modal .modal-back {
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    color: #9ca9bb;
    cursor: pointer;
    padding: 0 0.6rem 0 0;
    margin-right: 0.4rem;
}

.share-checkin-modal .modal-back:hover {
    color: #f8fbff;
}

.share-modal-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.share-step {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.share-step[hidden] {
    display: none;
}

.share-modal-hint {
    color: #9ca9bb;
    font-size: 0.85rem;
    line-height: 1.45;
    margin: 0;
}

/* Destination chooser cards */
.dest-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    background: #1a1f29;
    border: 1px solid #2e3646;
    border-radius: 14px;
    padding: 1rem 1rem 1rem 0.9rem;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.15s, border-color 0.15s, transform 0.1s;
    color: inherit;
    font-family: inherit;
}

.dest-card:hover {
    background: #222835;
    border-color: #f2c200;
}

.dest-card:active {
    transform: scale(0.99);
}

.dest-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(242, 194, 0, 0.14);
    border: 1px solid rgba(242, 194, 0, 0.32);
    color: #f2c200;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dest-icon svg {
    width: 22px;
    height: 22px;
}

.dest-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dest-text strong {
    font-size: 0.98rem;
    font-weight: 700;
    color: #f8fbff;
}

.dest-text small {
    font-size: 0.78rem;
    color: #9ca9bb;
    line-height: 1.35;
}

.dest-arrow {
    color: #6b7588;
    font-size: 1.4rem;
    flex-shrink: 0;
    line-height: 1;
}

.dest-card:hover .dest-arrow {
    color: #f2c200;
}

/* Story preview — two-layer composition. Background image is the static
   photo+darkening from `?part=bg`; the sticker is a transparent PNG laid
   over it with `position: absolute`, draggable to reposition without
   refetching. The preview's inner coords (sx/sy fractions of width/height)
   are sent to the backend at share time so the rendered JPEG matches. */
.share-modal-story-preview {
    align-self: center;
    position: relative;
    width: 220px;
    aspect-ratio: 9 / 16;
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(160deg, #1a1f29, #0d1117);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
    /* Stop the browser's default touch-pan from competing with the sticker
       drag — without this, dragging on iOS scrolls the page instead. */
    touch-action: none;
    user-select: none;
}

.share-story-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.share-story-sticker {
    position: absolute;
    cursor: grab;
    /* Soft drop shadow so the sticker reads as floating above the photo,
       not as part of it — also helps the user see where the draggable
       hit-area is on a dark background. */
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
    transition: filter 0.15s;
    /* Prevent the iOS image-callout / drag-image from stealing the gesture. */
    -webkit-user-drag: none;
    user-select: none;
    touch-action: none;
}

.share-story-sticker:active,
.share-story-sticker.is-dragging {
    cursor: grabbing;
    filter: drop-shadow(0 6px 14px rgba(242, 194, 0, 0.45));
}

/* Size slider — sits right under the preview. Tight row so it reads as
   "this controls the thing above". Yellow accent matches the rest of the
   app's interactive elements. */
.share-size-row {
    align-self: stretch;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0 0.2rem;
}

.share-size-label {
    font-size: 0.78rem;
    color: #9ca9bb;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.share-size-input {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
    height: 24px;
}

.share-size-input::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 214, 71, 0.2);
}

.share-size-input::-moz-range-track {
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 214, 71, 0.2);
}

.share-size-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #f2c200;
    border: 2px solid #131a24;
    margin-top: -7px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.share-size-input::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #f2c200;
    border: 2px solid #131a24;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Variant grid (pill/stats × light/dark) */
.share-modal-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
}

.share-thumb {
    background: #1a1f29;
    border: 2px solid #2e3646;
    border-radius: 12px;
    padding: 0.4rem 0.4rem 0.5rem;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s, transform 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    overflow: hidden;
    color: inherit;
    font-family: inherit;
}

.share-thumb:hover {
    border-color: #4f607a;
    background: #222835;
}

.share-thumb.is-active {
    border-color: #f2c200;
    box-shadow: 0 0 0 2px rgba(242, 194, 0, 0.22);
}

.share-thumb-img-wrap {
    width: 100%;
    height: 64px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* Checker pattern shows the PNG transparency. Both light & dark keep
       this so the user can see at-a-glance that the sticker has no bg. */
    background-image:
        linear-gradient(45deg, #2a3140 25%, transparent 25%),
        linear-gradient(-45deg, #2a3140 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #2a3140 75%),
        linear-gradient(-45deg, transparent 75%, #2a3140 75%);
    background-size: 12px 12px;
    background-position: 0 0, 0 6px, 6px -6px, -6px 0;
    background-color: #1f2530;
}

.share-thumb-img-wrap.share-thumb-dark {
    background-image:
        linear-gradient(45deg, #1a1f29 25%, transparent 25%),
        linear-gradient(-45deg, #1a1f29 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #1a1f29 75%),
        linear-gradient(-45deg, transparent 75%, #1a1f29 75%);
    background-color: #111722;
}

.share-thumb-img {
    max-width: 90%;
    max-height: 100%;
    object-fit: contain;
}

.share-thumb-img-pill {
    width: 92%;
    max-height: 38px;
    border-radius: 99px;
}

.share-thumb-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: #9ca9bb;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.share-thumb.is-active .share-thumb-label {
    color: #ffd647;
}

/* Action buttons */
.share-action {
    width: 100%;
    border: 1px solid transparent;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.92rem;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.15s, background-color 0.15s, border-color 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.share-action:active {
    transform: scale(0.98);
}

.share-action-primary {
    background: #f2c200;
    color: #191d27;
}

.share-action-primary:hover {
    background: #ffd647;
}

.share-action-secondary {
    background: #1a1f29;
    color: #d3dbe7;
    border-color: #2e3646;
}

.share-action-secondary:hover {
    background: #222835;
    border-color: #4f607a;
    color: #f8fbff;
}

.share-modal-foot {
    color: #6b7588;
    font-size: 0.72rem;
    text-align: center;
    margin: 0;
    line-height: 1.4;
}

@media (max-width: 540px) {
    .share-modal-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Floating share button on the activity card cover (own check-ins only).
   Glassy circle that reads on top of any photo. Unchanged from before — the
   button itself looks fine on top of the dark cover photos. */
.activity-share-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: background-color 0.15s, transform 0.1s;
    padding: 0;
}

.activity-share-btn:hover {
    background: rgba(0, 0, 0, 0.78);
}

.activity-share-btn:active {
    transform: scale(0.94);
}

.activity-share-btn svg {
    width: 17px;
    height: 17px;
    transform: translate(-1px, 1px);
}
