/* Wall (feed) styles */

/* Wall (feed) styles - theme aware (works in light & dark) */

body.wall-page {
    background: var(--bs-body-bg);
}

/* Subtle background glow */
body.wall-page::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 15% 10%, rgba(var(--bs-primary-rgb), 0.10), transparent 40%),
        radial-gradient(circle at 80% 0%, rgba(114, 57, 234, 0.10), transparent 45%),
        radial-gradient(circle at 70% 90%, rgba(26, 188, 156, 0.08), transparent 45%);
    opacity: 0.9;
    z-index: 0;
}

.wall-wrapper {
    max-width: 960px;
    margin: 20px auto 40px;
    position: relative;
    z-index: 1;
}

.wall-composer {
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 16px;
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
    padding: 18px 20px;
    margin-bottom: 16px;
}

.wall-composer-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.wall-composer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.wall-composer textarea {
    width: 100%;
    border-radius: 14px;
    border: 1px solid var(--bs-border-color);
    background: var(--bs-tertiary-bg);
    padding: 12px 14px;
    resize: vertical;
    min-height: 86px;
    font-size: 14px;
}

.wall-composer-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.wall-composer-actions {
    display: flex;
    gap: 8px;
}

.wall-icon-btn {
    border: none;
    background: #f0f2f5;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
}

.wall-icon-btn:hover {
    background: #e4e6eb;
}

.wall-feed {
    margin-top: 12px;
}

.wall-post-card {
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 16px;
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
    padding: 0; /* let Metronic card sections manage padding */
    margin-bottom: 14px;
    overflow: hidden;
}

.wall-post-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wall-post-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wall-post-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
}

.wall-post-meta {
    font-size: 12px;
    color: #777;
}

.wall-post-content {
    margin-top: 6px;
    font-size: 14px;
    line-height: 1.65;
    white-space: pre-wrap;
}

.wall-post-media {
    margin-top: 8px;
}

/* Ensure wall carousel images are displayed as squares (width == height) */
.wall-square-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.wall-post-footer {
    margin-top: 10px;
    border-top: 1px solid #f0f0f0;
    padding-top: 6px;
}

.wall-post-actions {
    display: flex;
    gap: 8px;
    font-size: 13px;
}

.wall-post-actions button {
    border: none;
    background: transparent;
    cursor: pointer;
    color: #555;
    padding: 4px 6px;
    border-radius: 4px;
}

.wall-post-actions button:hover {
    background: #f0f2f5;
}

.wall-comments {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid #f7f7f7;
}

.wall-comment-item {
    font-size: 13px;
    margin-bottom: 4px;
}

.wall-comment-author {
    font-weight: 600;
}

.wall-comment-box {
    padding: 5px;
    margin-top: 6px;
    display: flex;
    gap: 6px;
}

.wall-comment-box input {
    flex: 1;
    border-radius: 999px;
    border: 1px solid #e0e0e0;
    padding: 6px 10px;
    font-size: 13px;
}

.wall-comment-box button {
    border-radius: 999px;
    border: none;
    padding: 6px 12px;
    background: #eeeeee;
    color: #282727;
    font-size: 13px;
}

.wall-loading, .wall-load-more {
    text-align: center;
    padding: 12px;
    color: #777;
    font-size: 13px;
}

.wall-new-indicator {
    text-align: center;
    margin-bottom: 8px;
}

.wall-new-indicator button {
    border-radius: 999px;
    border: none;
    padding: 6px 16px;
    background: #28a745;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}

/* ---------- Stories strip (socialfeed) ---------- */
.wall-story-strip {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 6px 2px;
    scroll-snap-type: x mandatory;
}

.wall-story-bubble {
    border: 0;
    background: transparent;
    padding: 0;
    width: 78px;
    flex: 0 0 auto;
    text-align: center;
    scroll-snap-align: start;
}

.wall-story-avatar {
    width: 62px;
    height: 62px;
    border-radius: 999px;
    padding: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(45deg, #f9a825, #ec407a, #7e57c2);
    position: relative; /* for author badge */
}

/* Small user profile badge for public stories */
.wall-story-author-badge {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--bs-body-bg);
    border: 2px solid var(--bs-body-bg);
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.wall-story-author-badge img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 999px;
    display: block;
}

.wall-story-bubble.is-public .wall-story-avatar {
    background: linear-gradient(45deg, rgba(var(--bs-primary-rgb), 0.6), rgba(126, 87, 194, 0.6));
}

.wall-story-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    object-fit: cover;
    border: 2px solid var(--bs-body-bg);
}

.wall-story-name {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    color: var(--bs-gray-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- Story viewer ---------- */
.wall-story-viewer {
    position: relative;
    background: #000;
    min-height: 560px;
    border-radius: 12px;
    overflow: hidden;
}

.wall-story-progress {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    gap: 6px;
    z-index: 5;
}

.wall-story-seg {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 99px;
    overflow: hidden;
}

.wall-story-seg.done .wall-story-fill {
    width: 100% !important;
}

.wall-story-fill {
    width: 0%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    transition: width 0.05s linear;
}

.wall-story-topbar {
    position: absolute;
    top: 18px;
    left: 14px;
    right: 14px;
    z-index: 6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wall-story-stage {
    width: 100%;
    height: 100%;
    min-height: 560px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.wall-story-sticker {
    position: absolute;
    transform: translate(-50%, -50%);
    color: #fff;
    font-weight: 700;
    text-shadow: 0 2px 12px rgba(0,0,0,0.35);
    max-width: 90%;
    text-align: center;
    pointer-events: none; /* viewer only */
}

.wall-story-media {
    width: 100%;
    height: 100%;
    max-height: 560px;
    object-fit: contain;
    display: block;
}

.wall-story-text {
    width: 100%;
    height: 100%;
    min-height: 560px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: radial-gradient(circle at 15% 10%, rgba(255, 255, 255, 0.14), transparent 40%),
                linear-gradient(135deg, rgba(126, 87, 194, 0.65), rgba(236, 64, 122, 0.65));
}

.wall-story-text-inner {
    color: #fff;
    font-weight: 700;
    text-align: center;
    font-size: 1.25rem;
    line-height: 1.4;
    max-width: 520px;
}

.wall-story-overlay-text {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 78px;
    color: #fff;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0,0,0,0.4);
    font-size: 1.05rem;
}

/* Song chip overlay (cover + title + optional lyrics snippet) */
.wall-story-songchip {
    position: absolute;
    left: 14px;
    bottom: 68px;
    z-index: 6;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: calc(100% - 28px);
    padding: 8px 10px;
    border-radius: 14px;
    background: rgba(0,0,0,0.38);
    border: 1px solid rgba(255,255,255,0.14);
    backdrop-filter: blur(8px);
    color: #fff;
    pointer-events: none; /* keep navigation taps working */
}

.wall-story-songchip-cover { flex: 0 0 auto; }

.wall-story-songchip-img {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    object-fit: cover;
    display: block;
}

.wall-story-songchip-img--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 18px;
    background: rgba(255,255,255,0.12);
}

.wall-story-songchip-meta {
    min-width: 0;
    line-height: 1.25;
}

.wall-story-songchip-title {
    font-weight: 800;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}

.wall-story-songchip-artist {
    font-weight: 600;
    font-size: 11px;
    opacity: 0.85;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}

.wall-story-songchip-lyrics {
    margin-top: 4px;
    font-size: 11px;
    font-weight: 600;
    opacity: 0.95;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 320px;
}

.wall-story-actions {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 14px;
    z-index: 6;
    display: flex;
    gap: 10px;
    justify-content: flex-start;
}

.wall-story-nav {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 35%;
    background: transparent;
    border: 0;
    z-index: 4;
}

.wall-story-prev { left: 0; }
.wall-story-next { right: 0; }

/* ---------- Media grid (multi-image) ---------- */
.wall-media-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 6px;
    border-radius: 12px;
    overflow: hidden;
}

.wall-media-item {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 10px;
}

.wall-media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wall-media-item-1 {
    grid-row: 1 / span 2;
}

.wall-media-more {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1.3rem;
    background: rgba(0,0,0,0.45);
}

/* ---------- Story Studio (full-screen editor) ---------- */
body.story-studio-open {
    overflow: hidden;
}

.story-studio-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(6px);
}

.story-studio-header {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(17, 24, 39, 0.85);
    color: #fff;
}

.story-studio-title {
    font-weight: 700;
}

.story-studio-body {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 14px;
    padding: 14px;
    height: calc(100vh - 64px);
}

@media (max-width: 992px) {
    .story-studio-body {
        grid-template-columns: 1fr;
        height: auto;
        overflow-y: auto;
    }
}

.story-studio-preview {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.story-studio-canvas {
    position: relative;
    width: 100%;
    max-width: 520px;
    aspect-ratio: 9 / 16;
    border-radius: 16px;
    overflow: hidden;
    margin: 0 auto;
    background: #000;
    box-shadow: 0 18px 48px rgba(0,0,0,0.35);
}

.story-studio-canvas img,
.story-studio-canvas video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    z-index: 1;
}

.story-studio-overlay-layer {
    position: absolute;
    inset: 0;
    z-index: 3;
}

.story-studio-hint {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.85);
    text-align: center;
    padding: 18px;
    font-weight: 600;
}

.story-studio-resize-handle {
    position: absolute;
    width: 14px;
    height: 14px;
    right: -8px;
    bottom: -8px;
    border-radius: 4px;
    background: rgba(0,0,0,0.55);
    border: 2px solid rgba(255,255,255,0.95);
    cursor: nwse-resize;
}

/* Delete handle for stickers (top-right small X) */
.story-studio-delete-handle {
    position: absolute;
    width: 16px;
    height: 16px;
    right: -10px;
    top: -10px;
    border-radius: 999px;
    background: rgba(239,68,68,0.95);
    border: 2px solid rgba(255,255,255,0.95);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #fff;
}

/* Background animations (simple IG-like feel) */
@keyframes storyBgZoom {
    0% { transform: scale(1); }
    100% { transform: scale(1.08); }
}

@keyframes storyBgPan {
    0% { transform: scale(1.06) translateX(-1.5%); }
    100% { transform: scale(1.06) translateX(1.5%); }
}

.story-bg-zoom {
    animation: storyBgZoom 8s ease-in-out infinite alternate;
}

.story-bg-pan {
    animation: storyBgPan 8s ease-in-out infinite alternate;
}

/* Sticker animations */
@keyframes stickerPop {
    0% { transform: translate(-50%, -50%) scale(0.85); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@keyframes stickerFade {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes stickerSlideUp {
    0% { transform: translate(-50%, calc(-50% + 16px)); opacity: 0; }
    100% { transform: translate(-50%, -50%); opacity: 1; }
}

.story-sticker-anim-pop { animation: stickerPop 420ms ease-out both; }
.story-sticker-anim-fade { animation: stickerFade 520ms ease-out both; }
.story-sticker-anim-slide { animation: stickerSlideUp 520ms ease-out both; }

.story-studio-inline-input {
    max-width: 520px;
    margin: 0 auto;
}

.story-studio-tools {
    background: rgba(17, 24, 39, 0.85);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    padding: 14px;
    color: #fff;
    overflow: auto;
}

.story-studio-tools .form-label {
    color: rgba(255,255,255,0.85);
}

/* Compact mobile layout: keep only 4 primary tool icons visible,
   move the toolbar to the bottom over the canvas and hide advanced controls */
@media (max-width: 768px) {
    .story-studio-body {
        display: flex;
        flex-direction: column;
        height: calc(100vh - 64px);
    }

    .story-studio-preview {
        flex: 1 1 auto;
        justify-content: center;
    }

    .story-studio-tools {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 2100;
        border-radius: 16px 16px 0 0;
        padding: 8px 14px;
        box-shadow: 0 -8px 24px rgba(0,0,0,0.45);
    }

    /* Only keep the first row (4 icon buttons) visible on small screens */
    .story-studio-tools > *:not(:first-child) {
        display: none !important;
    }

    .story-studio-tools .d-flex.flex-wrap.gap-2.mb-3 {
        margin-bottom: 0;
        justify-content: space-between;
    }

    .story-studio-tools .btn {
        flex: 1 1 0;
        justify-content: center;
        padding-inline: 0;
    }
}

.story-studio-sticker {
    position: absolute;
    transform: translate(-50%, -50%);
    left: 50%;
    top: 50%;
    padding: 6px 10px;
    border-radius: 16px;
    background: rgba(0,0,0,0.35);
    color: #fff;
    font-weight: 800;
    user-select: none;
    cursor: grab;
    max-width: 92%;
    text-align: center;
    line-height: 1.25;
}

.story-studio-sticker.is-selected {
    outline: 2px solid rgba(255,255,255,0.9);
}

.story-studio-sticker.is-editing {
    cursor: text;
    user-select: text;
    outline: 2px solid rgba(59, 130, 246, 0.95);
    background: rgba(0,0,0,0.55);
}

.story-studio-format-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.story-studio-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.18);
    color: rgba(255,255,255,0.92);
    font-size: 12px;
}

/* ---------- Reaction picker ---------- */
.wall-reaction-bar {
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
}

.wall-like-btn.active {
    color: var(--bs-primary) !important;
}
