:root {
    --pink1: #ffb3d9;
    --pink2: #ff6fbf;
    --pink3: #ff2d97;
    --bg-dark: #05040a;
    --card-bg: #111;
    --shadow: 0 0 35px rgba(0, 0, 0, 0.7);
    --white-soft: rgba(255, 255, 255, 0.85);
    --danger: #ff375f;
    --success: #4ade80;
}

/* GLOBAL */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
    background: radial-gradient(circle at top, #1a1020, #000000);
    color: white;
}

.reel-app {
    width: 100%;
    height: 100%;
    position: relative;
}

/* CAMERA FULLSCREEN */

.camera-wrapper {
    position: fixed;
    inset: 0;
    background: var(--bg-dark);
    overflow: hidden;
}

#cameraPreview,
#ghostFrame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#ghostFrame {
    opacity: 0;
    pointer-events: none;
    mix-blend-mode: screen;
}
#processedPreview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    visibility: hidden; /* visible only when green screen / background replace is ON */
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

/* FLASH */

#flashEffect {
    position: absolute;
    inset: 0;
    background: white;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

/* COUNTDOWN */

#countdownOverlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    font-weight: 700;
    color: white;
    text-shadow: 0 0 30px rgba(0, 0, 0, 0.9);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

/* AR HEARTS */
/* AR STICKERS (tap to place) */
#arStickers {
    position: absolute;
    inset: 0;
    pointer-events: auto; /* allow drag/scale/delete on stickers */
    overflow: visible;
}

/* Live AR stickers on camera */
.ar-sticker {
    position: absolute;
    font-size: 32px;
    will-change: transform, opacity, left, top;
    cursor: grab;
    user-select: none;
    touch-action: none; /* better pointer/touch handling */
}



.ar-sticker {
    position: absolute;
    font-size: 32px;
    animation: float-sticker 3s ease-in-out forwards;
    will-change: transform, opacity;
}

@keyframes float-sticker {
    0%   { transform: translateY(0) scale(0.9); opacity: 0; }
    20%  { opacity: 1; }
    70%  { transform: translateY(-40px) scale(1.05); opacity: 1; }
    100% { transform: translateY(-60px) scale(0.9); opacity: 0; }
}

#arHearts span {
    position: absolute;
    font-size: 26px;
    animation: float-heart 3s infinite ease-in-out;
}

#arHearts span:nth-child(1) { left: 20%; bottom: 15%; }
#arHearts span:nth-child(2) { left: 50%; bottom: 10%; animation-delay: 0.6s; }
#arHearts span:nth-child(3) { left: 75%; bottom: 18%; animation-delay: 1.1s; }

/* AR Sticker palette (bottom center) */
.ar-sticker-palette {
    position: absolute;
    bottom: 110px;            /* sits above bottom bar */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    z-index: 8;
}

.ar-sticker-palette .sticker-pill {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    opacity: 0.7;
    transition: transform 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.ar-sticker-palette .sticker-pill.active {
    opacity: 1;
    transform: translateY(-2px) scale(1.05);
    background: rgba(255, 192, 203, 0.28); /* soft pink glow */
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

/* Live AR sticker element on camera */
.ar-sticker {
    position: absolute;
    font-size: 32px;
    pointer-events: auto;
    transform: translate(-50%, -50%);
    touch-action: none;
    user-select: none;
    z-index: 7;
}


@keyframes float-heart {
    0% { transform: translateY(0); opacity: 0; }
    20% { opacity: 1; }
    100% { transform: translateY(-90px); opacity: 0; }
}

/* TOP BAR */

.top-bar {
    position: absolute;
    top: 14px;
    left: 14px;
    right: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
    pointer-events: none;
}

.top-btn {
    pointer-events: auto;
    border-radius: 999px;
    border: none;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
}

.top-title {
    font-weight: 600;
    font-size: 16px;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.85);
}

.top-indicators {
    min-width: 80px;
    display: flex;
    justify-content: flex-end;
}

#clipCountBadge {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

/* LEFT LABEL */

.left-label {
    position: absolute;
    top: 52px;
    left: 16px;
    z-index: 10;
}

#modeLabel {
    font-size: 12px;
    padding: 4px 11px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

/* RIGHT TOOLBAR */

.right-toolbar {
    position: absolute;
    right: 14px;
    top: 70px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 20;
}

/* ============================================================
   TOOL BUTTON — Clean, Smaller, Beautiful Version
   ============================================================ */

/* MAIN BUTTON */
.tool-btn {
    width: 52px;                 /* decreased from 56 */
    height: 52px;
    border-radius: 16px;         /* smoother curve */

    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow: 0 4px 18px rgba(0,0,0,0.55);

    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);

    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;

    transition: 0.25s ease;
}

/* ICONS */
.tool-btn i {
    font-size: 20px;             /* decreased from 26px */
    color: #ffffff;
    opacity: 0.88;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* HOVER EFFECT */
.tool-btn:hover {
    background: rgba(255,255,255,0.22);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255,255,255,0.15);
}

.tool-btn:hover i {
    opacity: 1;
}

/* ACTIVE — GLOWING PINK */
.tool-btn.active {
    background: linear-gradient(180deg, var(--pink2), var(--pink3));
    border-color: transparent;
    box-shadow: 0 0 22px rgba(255, 60, 150, 0.55);
}

.tool-btn.active i {
    opacity: 1;
    transform: scale(1.07);
}

/* ============================================================
   MOBILE SIZE TWEAKS
   ============================================================ */
@media (max-width: 480px) {

    .tool-btn {
        width: 46px;         /* reduced */
        height: 46px;
        border-radius: 14px;
    }

    .tool-btn i {
        font-size: 18px;     /* smaller icon for phones */
    }

     .bottom-bar {
        height: 90px;
        bottom: 20px;
        gap: 40px;
        width: 96%;
    }
}


/* BOTTOM BAR */
.bottom-bar {
    position: absolute;
    bottom: 45px;
    left: 0;
    right: 0;
    height: 110px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 70px;
    z-index: 20;

    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(18px) saturate(140%);
    border-top: 1px solid rgba(255,255,255,0.08);

    padding: 18px 20px;
    border-radius: 28px;
    margin: 0 auto;
    width: 92%;
    box-shadow: 0 0 40px rgba(0,0,0,0.8);
}

/* ICON BUTTONS — left & right */
.bottom-icon-btn {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    color: white;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.25s ease;
    transform: scale(0.85)
}

.bottom-icon-btn i {
    font-size: 28px;
    opacity: 0.92;
    color: #ffffff;
    transition: 0.2s ease;
}

.bottom-icon-btn:hover i {
    opacity: 1;
    transform: translateY(-2px);
}




/* When any panel is open, push bottom controls upward */
.reel-app.panel-open .bottom-bar,
.reel-app.panel-open .bottom-secondary,
.reel-app.panel-open .clip-actions {
    transform: translateY(-260px); /* panel height */
    transition: transform 0.28s ease;
}


.round-btn.small {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: none;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.round-btn.small:hover {
    background: rgba(0, 0, 0, 0.85);
}

/* RECORD BUTTON */
/* RECORD AREA */
.record-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

/* TIMER */
.record-timer {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 1px;
    padding: 6px 12px;
    background: rgba(0,0,0,0.5);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.12);
}

/* RECORD BUTTON — PREMIUM */
.record-btn {
    width: 60px !important;
    height: 60px !important;
    border-radius: 50%;
    border: 4px solid white;
    background: radial-gradient(circle, var(--danger), #8a0f25);
    cursor: pointer;
    box-shadow: 0 0 25px rgba(255, 20, 80, 0.65) !important;
    transition: 0.2s ease;
    position: relative;
    transform: scale(0.85) !important;
}
.record-area {
    transform: none !important;
}

.record-btn::after {
    content: "";
    position: absolute;
    inset: 12px;
    background: white;
    border-radius: 12px;
    opacity: 0;
    transition: 0.22s ease;
}


.record-btn.recording {
    transform: scale(0.88);
    background: radial-gradient(circle, #ff0033, #600010);
}

.record-btn.recording::after {
    opacity: 1;
    border-radius: 8px;
}

/* BOTTOM SECONDARY (chips) */

.bottom-secondary {
    position: absolute;
    bottom: 6px;
    left: 12px;
    right: 12px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    z-index: 9;
}

.chip-group {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.55);
    padding: 4px 8px;
    border-radius: 999px;
    backdrop-filter: blur(14px);
}

.chip-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
}

.chip {
    font-size: 11px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(0, 0, 0, 0.5);
    padding: 3px 8px;
    color: var(--white-soft);
    cursor: pointer;
}

.chip.active {
    background: linear-gradient(90deg, var(--pink2), var(--pink3));
    border-color: transparent;
}

/* ======================================================
   CLIP ACTION ICON BUTTONS — BEAUTIFUL, STACKED LEFT
   ====================================================== */

.clip-actions {
    position: absolute;
    left: 20px;
    bottom: 165px; /* adjust based on your bottom bar */
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 50;
    pointer-events: auto;
}

/* Icon Buttons */
.clip-icon-btn {
    width: 52px;
    height: 52px;
    border-radius: 16px;

    background: rgba(0,0,0,0.55);
    border: 1px solid rgba(255,255,255,0.18);
    backdrop-filter: blur(12px);

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
    transition: 0.25s ease;
}

/* Icons inside */
.clip-icon-btn i {
    font-size: 26px;
    color: #fff;
    opacity: 0.9;
}

/* Hover effect */
.clip-icon-btn:hover {
    background: rgba(255,255,255,0.18);
    transform: translateY(-2px);
}

/* Active (Preview button pink style) */
.clip-icon-btn.primary {
    background: linear-gradient(90deg, var(--pink2), var(--pink3));
    border: none;
    box-shadow: 0 4px 18px rgba(255,70,150,0.45);
}

.clip-icon-btn.primary i {
    opacity: 1 !important;
}

/* Tooltip (browser native title works perfectly) */

/* Mobile improvements */
@media (max-width: 480px) {
    .clip-actions {
        bottom: 145px;
        left: 16px;
    }

    .clip-icon-btn {
        width: 48px;
        height: 48px;
    }

    .clip-icon-btn i {
        font-size: 22px;
    }
}



/* PLAYBACK PANEL */

.playback-panel {
    position: fixed;
    inset: 10%;
    background: #050509;
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 12px;
    display: none;
    flex-direction: column;
    z-index: 100;
}

.playback-panel.open {
    display: flex;
}

.playback-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.playback-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
#playbackVideo {
    width: 100%;
    height: calc(100% - 30px);
    object-fit: contain;
    background: black;
    border-radius: 12px;
}

#closePlaybackBtn {
    border-radius: 999px;
    border: none;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.06);
    color: white;
    cursor: pointer;
}

/* PANEL BACKDROP */

.panel-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 30;
}

.panel-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

/* PANELS - COMMON */

.panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: -70%;
    background: rgba(9, 9, 12, 0.96);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -18px 40px rgba(0, 0, 0, 0.9);
    color: white;
    z-index: 120;
    display: flex;
    flex-direction: column;
    transition: bottom 0.25s ease;
}

.panel-large {
    height: 65% !important;
}

.panel-small {
    height: 45%;
}

.panel.open {
    bottom: 0;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.panel-title {
    font-size: 14px;
    font-weight: 600;
}

.panel-close {
    border-radius: 999px;
    border: none;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.06);
    color: white;
    cursor: pointer;
}

.panel-body {
    flex: 1;
    padding: 10px 16px 16px;
    overflow-y: auto;
    font-size: 13px;
}

.panel-subtext {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
}

.panel-hint {
    margin-top: 12px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

.panel-section {
    margin-top: 12px;
}

.panel-section label {
    font-size: 12px;
    display: block;
    margin-bottom: 4px;
}

/* PANEL CONTENT STYLES */

.music-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.music-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.music-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
}

.music-item.active {
    background: linear-gradient(90deg, var(--pink2), var(--pink3));
}

.music-item span {
    font-size: 12px;
}

.effect-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.effect-card {
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    text-align: left;
}

.effect-card .effect-label {
    font-size: 13px;
    font-weight: 600;
}

.effect-card .effect-desc {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
}

.filter-list-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.filter-tag {
    font-size: 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.4);
    cursor: pointer;
}

.filter-tag.active {
    background: linear-gradient(90deg, var(--pink2), var(--pink3));
    border-color: transparent;
}

.panel-list {
    padding-left: 18px;
    font-size: 13px;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bg-mode-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.bg-mode-btn {
    font-size: 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(0, 0, 0, 0.5);
    padding: 4px 10px;
    color: var(--white-soft);
    cursor: pointer;
    transition: 0.2s ease;
}

.bg-mode-btn.active {
    background: linear-gradient(90deg, var(--pink2), var(--pink3));
    border-color: transparent;
    color: #fff;
}

.bg-upload-row input[type="file"] {
    margin-top: 4px;
    font-size: 12px;
}


/* RESPONSIVE */

@media (max-width: 768px) {
    .bottom-bar {
        gap: 50px;
        bottom: 40px;
    }
    .clip-actions {
        top: 56%;
    }
    .playback-panel {
        inset: 6%;
    }
}


/* ========================================================= */
/* ========== PHASE 3 – EDIT MODE (XPartner theme) ========= */
/* ========================================================= */
 /* FORCE edit-mode to stay inside the reel app ONLY */ 
 /* Full-screen Edit Mode container */ 
 /* FULLSCREEN, SELF-CONTAINED EDIT MODE OVERLAY */
#editMode {
    position: fixed !important;       /* Must stay inside this window */
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0,0,0,0.90);
    backdrop-filter: blur(16px);
    display: none;
    flex-direction: column;
    overflow: hidden !important;      /* Prevent content from overflowing */
    z-index: 9999 !important;         /* Above the camera, below global UI */
    border-radius: 0 !important;
}



/* Add class .open via JS when entering edit mode */
.edit-mode.open {
    display: flex;
}

/* ------------------------ */
/* TOP BAR: back | title | next */
/* ------------------------ */
 .edit-top-bar {
    height: 55px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: rgba(0,0,0,0.65);
    position: relative;
    z-index: 10000;
}


.edit-top-btn {
    position: relative !important;
    z-index: 96 !important;
}
.edit-top-btn.primary {
    position: relative !important;
}


.edit-title {
    color: white;
    font-size: 17px;
    font-weight: 600;
    pointer-events: none;
}

#editDoneBtn {
    background: linear-gradient(135deg, #ff7ac4, #ff2e98);
    color: #fff;
    padding: 8px 20px;
    border-radius: 22px;
    border: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    z-index: 10001;
}

/* ------------------------ */
/* MAIN LAYOUT: preview + bottom tools */
/* ------------------------ */
 .edit-layout {
    flex: 1;
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
}


 .edit-preview-area {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden !important;
    position: relative;
}

 
.edit-bottom {
    background: rgba(20,20,20,0.85);
    height: 250px;
    padding-top: 10px;
    overflow: hidden;
    position: relative;
    z-index: 1000;
}

.edit-preview-frame {
    max-height: 70vh;
    width: auto;
    margin: 0 auto;
}


#editPreviewVideo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#editPreviewCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: none; /* only used in cover picker */
}

/* The overlay layer sits above the preview video */
#editOverlayLayer {
    position: absolute;
    inset: 0;
    pointer-events: none; /* overlays themselves enable pointer events when created */
}

/* ------------------------ */
/* BOTTOM EDITING PANEL WITH TABS */
/* ------------------------ */

.edit-bottom {
    height: 260px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(14px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);

    display: flex;
    flex-direction: column;
}

/* Edit mode: lift preview and trim handles when panel is open */
.edit-mode.open .edit-preview-area {
    padding-bottom: 260px; /* same as edit-bottom height */
    transition: padding-bottom 0.28s ease;
}

/* ------------------------ */
/* TABS */
/* ------------------------ */

.edit-tabs {
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.edit-tab {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.65);
    padding: 6px 10px;
    font-size: 13px;
    cursor: pointer;
    border-radius: 8px;
}

.edit-tab.active {
    background: linear-gradient(90deg, var(--pink2), var(--pink3));
    color: white;
}

/* ------------------------ */
/* PANEL CONTENT AREAS */
/* ------------------------ */

.edit-panel {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 10px 16px 18px;
    font-size: 13px;
}

.edit-panel.active {
    display: block;
}

.edit-panel-header {
    margin-bottom: 12px;
}

.edit-panel-title {
    font-size: 14px;
    font-weight: 600;
}

.edit-panel-subtitle {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.65);
}



/* ------------------------ */
/* TEXT TAB */
/* ------------------------ */

.text-controls-row,
.stickers-controls-row {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.text-style-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 14px;
}

.text-style-group label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
}

.text-style-group input[type="range"] {
    width: 100%;
}

.chip-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ------------------------ */
/* STICKERS TAB */
/* ------------------------ */

.stickers-controls-row {
    margin-bottom: 16px;
}

/* ------------------------ */
/* HASHTAGS TAB */
/* ------------------------ */

.edit-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    color: white;
}

.hashtag-group {
    margin-top: 16px;
}

.hashtag-group-title {
    font-size: 12px;
    color: var(--pink1);
    margin-bottom: 6px;
}

.hashtag-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hashtag-chip {
    padding: 6px 12px;
    border-radius: 12px;
    background: rgba(255,255,255,0.08);
    border: none;
    color: white;
    font-size: 12px;
    cursor: pointer;
}

.hashtag-chip.active {
    background: linear-gradient(90deg, var(--pink2), var(--pink3));
}

.selected-hashtags {
    margin-top: 20px;
}

.selected-hashtags-label {
    font-size: 12px;
    margin-bottom: 6px;
}

.selected-hashtag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.selected-hashtag-pill {
    padding: 6px 12px;
    border-radius: 12px;
    background: linear-gradient(90deg, var(--pink2), var(--pink3));
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.selected-hashtag-pill button {
    border: none;
    background: transparent;
    color: white;
    cursor: pointer;
}

/* ------------------------ */
/* CAPTION TAB */
/* ------------------------ */

.caption-editor {
    margin-top: 10px;
}

.edit-textarea {
    width: 100%;
    border-radius: 12px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    color: white;
    resize: none;
}

.caption-meta-row {
    margin-top: 6px;
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: rgba(255,255,255,0.75);
}

/* ------------------------ */
/* COVER TAB */
/* ------------------------ */

.cover-preview {
    margin-top: 8px;
    display: flex;
    justify-content: center;
}

.cover-preview-inner {
    width: 200px;
    height: 350px;
    background: black;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 18px rgba(0,0,0,0.6);
}

#coverCanvas {
    width: 100%;
    height: 100%;
}

.cover-slider-row {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cover-time-label {
    font-size: 12px;
    color: rgba(255,255,255,0.75);
}

.cover-actions {
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
}

/* ------------------------ */
/* EDIT MODE – GLOBAL TIMELINE */
/* ------------------------ */

.edit-timeline-row {
    margin: 10px 16px 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

#editTimelineSlider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 999px;
    background: rgba(255,255,255,0.25);
    outline: none;
}

/* Thumb styling for WebKit (Chrome, Edge) */
#editTimelineSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: linear-gradient(90deg, var(--pink2), var(--pink3));
    box-shadow: 0 0 8px rgba(255,105,180,0.7);
    cursor: pointer;
}

/* Thumb styling for Firefox */
#editTimelineSlider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: linear-gradient(90deg, var(--pink2), var(--pink3));
    box-shadow: 0 0 8px rgba(255,105,180,0.7);
    cursor: pointer;
}

.edit-timeline-time {
    font-size: 12px;
    color: rgba(255,255,255,0.75);
    min-width: 42px;
    text-align: right;
}


/* ------------------------ */
/* OVERLAY ITEMS (text, stickers) */
/* ------------------------ */
/* Selected overlay highlight */
.overlay-item.overlay-selected {
    outline: 1px dashed rgba(255,255,255,0.9);
    outline-offset: 4px;
    border-radius: 8px;
}

#overlayContainer {
    position: absolute;
    inset: 0;         /* FULL AREA */
    width: 100%;
    height: 100%;
    pointer-events: none;   /* important: allow drag pass-through */
    z-index: 30;
}


.overlay-item {
    position: absolute;
    transform: translate(-50%, -50%);
    pointer-events: auto; /* allow dragging */
}
.overlay-item:active {
    cursor: grabbing;
}

.overlay-delete-btn {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
}

.overlay-item:hover .overlay-delete-btn {
    display: block;
}

/* Make stickers resizable with Phase 3 JS */
.overlay-resize-handle {
    position: absolute;
    bottom: -12px;
    right: -12px;
    width: 22px;
    height: 22px;
    background: var(--pink3);
    border-radius: 999px;
    cursor: nwse-resize;
    display: none;
}

.overlay-item:hover .overlay-resize-handle {
    display: block;
}

/* Responsive fixes */
@media (max-width: 768px) {
    .edit-preview-frame {
        width: 280px;
        height: 500px;
    }
    .cover-preview-inner {
        width: 160px;
        height: 280px;
    }
}

#arHearts {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 5;
}

.floating-heart {
    position: absolute;
    bottom: -20px;
    background: rgba(255,90,140,0.8);
    clip-path: path("M 10 30 Q 30 2 50 30 Q 70 2 90 30 Q 90 60 50 90 Q 10 60 10 30 Z");
    opacity: 0;
    transition: transform 2.4s linear, opacity 2.4s linear;
}

.floating-heart.rise {
    transform: translateY(-160px);
    opacity: 1;
}


/* ================================
   VISIBILITY & READABILITY ENHANCEMENTS
   ================================ */

/* Increase all UI font sizes */
body, button, .control-label, .panel-title, .category-btn,
.music-vertical-item-name, .music-vertical-item-artist,
.filter-name, .effect-name, .voice-effect-name {
    font-size: 15px !important;
}

/* Improve right-side control labels */
.control-label {
    font-size: 14px !important;
    font-weight: 600 !important;
    opacity: 1 !important;
}

/* Make icons bigger */
.control-icon i,
.bottom-btn i,
.share-icon i {
    font-size: 22px !important;
}

/* Right-side control icons */
.control-icon {
    width: 55px !important;
    height: 55px !important;
    font-size: 24px !important;
}

/* Bottom Buttons */
.bottom-btn {
    font-size: 30px !important;
}

/* Record Button */
.record-btn {
    width: 60px !important;
    height: 60px !important;
}

.record-btn::before {
    top: 12px !important;
    left: 12px !important;
    right: 12px !important;
    bottom: 12px !important;
}

/* Category buttons (Music) */
.category-btn {
    font-size: 14px !important;
    padding: 10px 20px !important;
}

/* Panel Headers */
.panel-title {
    font-size: 22px !important;
    font-weight: 700 !important;
}

/* Music List */
.music-vertical-item {
    padding: 10px 12px !important;
}

.music-vertical-item-name {
    font-size: 16px !important;
}

.music-vertical-item-artist {
    font-size: 13px !important;
}

.beauty-slider-row {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.beauty-slider-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    margin-bottom: 4px;
}

#beautyLevelSlider {
    width: 100%;
    cursor: pointer;
}


/* Filters & Effects Cards */
.filter-card, .effect-card {
    padding: 18px !important;
}

.filter-icon, .effect-icon {
    font-size: 30px !important;
}

.filter-name, .effect-name {
    font-size: 14px !important;
}

/* Voice Effects */
.voice-effect-card {
    padding: 15px !important;
}

.voice-effect-icon {
    font-size: 22px !important;
}

.voice-effect-name {
    font-size: 14px !important;
}

/* Toast Notifications */
.toast {
    font-size: 16px !important;
    padding: 14px 22px !important;
}

/* Music Indicator + Timer */
.music-indicator,
.recording-timer {
    font-size: 15px !important;
    padding: 10px 18px !important;
}

/* Overlay Option Panel */
.overlay-option span {
    font-size: 16px !important;
    font-weight: 600 !important;
}

/* Text Overlay Input */
.text-overlay-input-panel input[type="text"] {
    font-size: 18px !important;
    padding: 10px !important;
}

.input-controls label {
    font-size: 16px !important;
}

.confirm-btn {
    font-size: 18px !important;
    padding: 10px 20px !important;
}

/* Safe higher contrast */
.control-icon,
.category-btn,
.filter-card,
.effect-card,
.voice-effect-card,
.music-vertical-item {
    background: rgba(255,255,255,0.15) !important;
    border-color: rgba(255,255,255,0.3) !important;
}

/* Improve Gallery Icons */
.gallery-play-btn, .gallery-share-btn, .gallery-post-btn {
    width: 48px !important;
    height: 48px !important;
    font-size: 22px !important;
}

/* Improve Share Options */
.share-option .share-name {
    font-size: 14px !important;
}


/* ============================== */
/*   FIX EFFECTS PANEL VISIBILITY */
/* ============================== */
.effect-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
    gap: 16px !important;
    margin-top: 18px !important;
}

/* EFFECT CARD — Modern Theme */
.effect-card {
    padding: 18px 16px !important;
    border-radius: 14px !important;
    background: rgba(255,255,255,0.06) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.28) !important;
    min-height: 110px !important;
    cursor: pointer !important;
    transition: all 0.25s ease !important;
}

/* EFFECT HOVER */
.effect-card:hover {
    background: rgba(255,255,255,0.12) !important;
    transform: translateY(-4px) !important;
}

/* EFFECT ACTIVE */
.effect-card.active {
    background: rgba(236, 72, 153, 0.2) !important;
    border-color: rgba(236, 72, 153, 0.6) !important;
    box-shadow: 0 0 18px rgba(236, 72, 153, 0.35) !important;
}

/* EFFECT LABEL */
.effect-label {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #fff !important;
}

/* EFFECT DESCRIPTION */
.effect-desc {
    font-size: 13px !important;
    opacity: 0.85 !important;
    line-height: 1.3 !important;
    color: rgba(255,255,255,0.9) !important;
}

/* =============================== */
/*     FIX FILTERS PANEL UI        */
/* =============================== */
/* FILTER PANEL TITLE */
#panel-filters .panel-title {
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #fff !important;
}

/* FILTER PANEL SUBTITLE */
#panel-filters .panel-subtitle {
    font-size: 14px !important;
    color: rgba(255,255,255,0.75) !important;
    margin-bottom: 14px !important;
}

/* FILTER LIST CONTAINER */
.filter-list-panel,
.filter-chip-group {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
    margin-top: 15px !important;
}

/* FILTER CHIP BUTTON — Beautiful Pink Theme */
.filter-tag {
    padding: 12px 20px !important;
    background: rgba(255,255,255,0.08) !important;
    color: #eaeaea !important;
    border-radius: 50px !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    border: 1px solid rgba(255,255,255,0.12) !important;
    cursor: pointer !important;
    transition: all 0.25s ease !important;
    backdrop-filter: blur(10px);
}

/* FILTER HOVER */
.filter-tag:hover {
    background: rgba(255,255,255,0.18) !important;
    color: #ffffff !important;
    box-shadow: 0 0 16px rgba(255,255,255,0.15) !important;
    transform: translateY(-2px) !important;
}

/* ACTIVE FILTER */
.filter-tag.active {
    background: var(--pink3) !important;
    color: white !important;
    font-weight: 600 !important;
    border-color: var(--pink3) !important;
    box-shadow: 0 6px 18px rgba(255, 46, 166, 0.45) !important;
}

/* Mobile Optimization */
@media (max-width: 480px) {
    .filter-tag {
        padding: 10px 16px !important;
        font-size: 14px !important;
    }
}





/* ======================================
   BEAUTIFUL TOOLS PANEL (Updated)
   ====================================== */

.tools-panel {
    padding: 10px 4px;
    color: white;
}

.tools-header {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #fff;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.tools-card {
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(12px);
    padding: 18px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.1);
    transition: 0.25s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}

.tools-card:hover {
    transform: translateY(-4px);
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,105,180,0.4);
    box-shadow: 0 6px 24px rgba(255,105,180,0.4);
}

.tools-icon {
    font-size: 32px;
    color: var(--pink2);
    margin-bottom: 10px;
}

.tools-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.tools-desc {
    font-size: 13px;
    opacity: 0.85;
    line-height: 1.4;
}

.tools-footer {
    margin-top: 20px;
    font-size: 12px;
    opacity: 0.7;
    line-height: 1.5;
}

.tools-footer {
    margin-top: 20px;
    font-size: 12px;
    opacity: 0.7;
    line-height: 1.5;
}


/* ============================================================
   RESPONSIVE LAYOUT FIXES — Inserted at END of CSS
   Prevent overlap of bottom bar, right toolbar, clip actions
   ============================================================ */

/* SCALE VARIABLES */
:root {
    --ui-scale-lg: 1;
    --ui-scale-md: 0.94;
    --ui-scale-sm: 0.88;
    --ui-scale-xs: 0.82;
}

/* === RIGHT TOOLBAR RESPONSIVE === */
@media (max-height: 800px) {
    .right-toolbar {
        top: 60px !important;
        transform: scale(var(--ui-scale-md));
    }
}

@media (max-height: 720px) {
    .right-toolbar {
        top: 42px !important;
        transform: scale(var(--ui-scale-md)) translateY(-10px);
    }
}

@media (max-height: 650px) {
    .right-toolbar {
        top: 34px !important;
        transform: scale(var(--ui-scale-sm)) translateY(-18px);
    }
}

@media (max-height: 600px) {
    .right-toolbar {
        top: 24px !important;
        transform: scale(var(--ui-scale-xs)) translateY(-28px);
    }
}

/* === BOTTOM BAR RESPONSIVE === */
@media (max-height: 800px) {
    .bottom-bar {
        bottom: 38px !important;
        transform: scale(var(--ui-scale-md));
    }
}

@media (max-height: 720px) {
    /* .bottom-bar {
        bottom: 24px !important;
        transform: scale(var(--ui-scale-sm));
    } */
}

@media (max-height: 650px) {
    /* .bottom-bar {
        bottom: 16px !important;
        transform: scale(var(--ui-scale-sm));
    } */
}

@media (max-height: 600px) {
    /* .bottom-bar {
        bottom: 10px !important;
        transform: scale(var(--ui-scale-xs));
    } */
}

/* === CLIP ACTION BUTTON RESPONSIVE === */
@media (max-height: 800px) {
    .clip-actions {
        top: 62% !important;
    }
}

@media (max-height: 720px) {
    .clip-actions {
        top: 59% !important;
    }
}

@media (max-height: 650px) {
    .clip-actions {
        top: 57% !important;
    }
}

@media (max-height: 600px) {
    .clip-actions {
        top: 54% !important;
    }
}

/* === CHIPS ROW RESPONSIVE === */
@media (max-height: 800px) {
    .bottom-secondary {
        bottom: 4px !important;
        transform: scale(var(--ui-scale-md));
    }
}

@media (max-height: 720px) {
    .bottom-secondary {
        bottom: 0px !important;
        transform: scale(var(--ui-scale-sm));
    }
}

@media (max-height: 650px) {
    .bottom-secondary {
        bottom: -4px !important;
        transform: scale(var(--ui-scale-xs));
    }
}

/* SAFE AREA INSETS (iPhone Notches) */
@supports(padding: env(safe-area-inset-bottom)) {
    .bottom-bar {
        padding-bottom: env(safe-area-inset-bottom);
    }
    .bottom-secondary {
        padding-bottom: calc(env(safe-area-inset-bottom) / 2);
    }
}
    
/* ============================================
   BEAUTIFUL MUSIC CATEGORY BUTTONS (Soft Pink)
   ============================================ */
.music-category-btn {
    padding: 8px 18px;
    background: rgba(255,255,255,0.08);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.15);
    color: #eee;
    font-size: 14px;
    font-weight: 500;

    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: 0.25s ease;
}

/* Hover */
.music-category-btn:hover {
    background: rgba(255,255,255,0.18);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(255,255,255,0.15);
}

/* Selected / Active */
.music-category-btn.active {
    background: linear-gradient(90deg, var(--pink2), var(--pink3));
    color: white;
    border-color: transparent;
    box-shadow: 0 5px 18px rgba(255, 60, 150, 0.5);
}

/* ============================================
   PREVIEW SELECTED TRACK BUTTON (Soft Pink)
   ============================================ */
.music-preview-btn {
    padding: 10px 20px;
    border-radius: 14px;

    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.18);
    color: white;

    font-size: 14px;
    font-weight: 600;

    backdrop-filter: blur(10px);
    cursor: pointer;

    display: inline-flex;
    align-items: center;
    gap: 8px;

    transition: 0.25s ease;
}

/* Icon inside */
.music-preview-btn i {
    font-size: 18px;
    opacity: 0.9;
}

/* Hover */
.music-preview-btn:hover {
    background: rgba(255,255,255,0.22);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(255,255,255,0.15);
}

/* Active Playing State */
.music-preview-btn.playing {
    background: linear-gradient(90deg, var(--pink2), var(--pink3));
    border-color: transparent;
    box-shadow: 0 5px 18px rgba(255, 55, 150, 0.55);
}

.music-preview-btn.playing i {
    opacity: 1 !important;
}

#panel-more .tools-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.15);
    margin-bottom: 12px;
    cursor: pointer;
}

#panel-more .tools-icon {
    font-size: 22px;
    opacity: 0.9;
}

/* MORE PANEL — SNAPCHAT STYLE (OPTION C) */
.more-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
    padding: 22px;
    justify-items: center;
    text-align: center;
}

.more-option-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    font-size: 13px;
}

.more-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: white;
    border: 2px solid rgba(255,255,255,0.15);
    transition: 0.25s ease;
}

.more-circle:hover {
    background: rgba(255,255,255,0.20);
    border-color: var(--pink2);
    transform: scale(1.07);
    box-shadow: 0 0 12px rgba(255, 90, 150, 0.5);
}

.more-option-item span {
    margin-top: 8px;
    opacity: 0.85;
    font-size: 12px;
}

/* FIX PANEL OVERLAP */
#panel-speed {
    z-index: 1000 !important;
}

#panel-more {
    z-index: 1100 !important;
}

.panel {
    position: fixed;
    left: 0;
    width: 100%;
}

/* ===== TRIM TIMELINE ===== */

.trim-clip-list {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.trim-clip-btn {
    border: none;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.trim-clip-btn.active {
    background: linear-gradient(135deg, #ff6ea8, #ff3f7f);
    box-shadow: 0 0 10px rgba(255, 63, 127, 0.4);
    transform: translateY(-1px);
}

.trim-timeline-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: linear-gradient(90deg, #2a2a3a, #181824);
    padding: 6px;
    margin-bottom: 10px;
}

.trim-timeline {
    position: relative;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    transform-origin: left center;
    transition: transform 0.18s ease-out;
}

/* Frame strip + waveform stacked */
#trimFrameCanvas,
#trimWaveCanvas {
    position: absolute;
    inset: 0;
}

/* Handles + active range */
.trim-handle {
    position: absolute;
    top: 0;
    width: 10px;
    height: 100%;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    cursor: ew-resize;
    transform: translateX(-50%);
    transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
}

.trim-handle::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 18px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    transform: translate(-50%, -50%);
}

.trim-handle.dragging {
    background: #ff70a2;
    box-shadow: 0 0 14px rgba(255, 112, 162, 0.8);
}

.trim-handle.snapped {
    transform: translateX(-50%) scaleY(1.08);
}

.trim-range-fill {
    position: absolute;
    top: 4px;
    bottom: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255, 112, 162, 0.7), rgba(255, 190, 230, 0.8));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

/* Info row + buttons */

.trim-info-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.75);
}

.trim-info-row span span {
    font-weight: 600;
}

.trim-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.trim-actions button {
    border-radius: 999px;
    font-size: 13px;
    padding: 6px 14px;
}

#trimResetBtn {
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: transparent;
    color: #fff;
}

#trimApplyBtn {
    border: none;
    background: linear-gradient(135deg, #ff6ea8, #ff3f7f);
    color: #fff;
    box-shadow: 0 0 14px rgba(255, 63, 127, 0.55);
}

.edit-overlay-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* Overlay items */
.overlay-item {
    position: absolute;
    transform: translate(-50%, -50%);
    cursor: grab;
    touch-action: none;
    pointer-events: auto;
}

.overlay-item.overlay-selected {
    outline: 2px solid rgba(255, 64, 129, 0.9);
    border-radius: 8px;
}

.overlay-item.overlay-locked {
    opacity: 0.7;
}

.overlay-item.overlay-hidden {
    opacity: 0.3;
}

/* Buttons on each overlay (delete, lock, visibility) */
.overlay-delete-btn,
.overlay-lock-btn,
.overlay-vis-btn {
    position: absolute;
    top: -18px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.75);
    color: #fff;
    cursor: pointer;
    pointer-events: auto;
}

.overlay-delete-btn { right: -18px; }
.overlay-lock-btn { left: -18px; }
.overlay-vis-btn { left: 4px; top: -20px; }

/* Resize handle (stickers) */
.overlay-resize-handle {
    position: absolute;
    right: -10px;
    bottom: -10px;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    border: 2px solid #fff;
    background: rgba(0,0,0,0.8);
    box-sizing: border-box;
    cursor: nwse-resize;
    pointer-events: auto;
}

/* Center guides */
.overlay-guide {
    position: absolute;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.12s ease;
}

.overlay-guide-h {
    height: 1px;
    background: rgba(255,255,255,0.6);
    transform: translateY(-0.5px);
}

.overlay-guide-v {
    width: 1px;
    background: rgba(255,255,255,0.6);
    transform: translateX(-0.5px);
}


.color-chip-row {
    display: flex;
    gap: 10px;
}

.color-chip {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid #fff;
    cursor: pointer;
}
.color-chip.active {
    border: 2px solid #ff2f87;
}


/* MORE OPTIONS PANEL */
.more-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 6px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
}

.more-row:last-child {
    border-bottom: none;
}

.more-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.more-left i {
    font-size: 20px;
    opacity: 0.85;
}

.more-open, 
.more-toggle {
    font-size: 12px;
    opacity: 0.7;
}

/* SNAPCHAT STYLE MORE PANEL */
.more-panel-body {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    padding: 14px;
}

.snap-item {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    padding: 16px 10px;
    text-align: center;
    cursor: pointer;
    transition: 0.25s;
    backdrop-filter: blur(16px);
}

.snap-item:hover {
    transform: translateY(-4px) scale(1.03);
    background: rgba(255, 182, 230, 0.25);
    box-shadow: 0 0 25px rgba(255, 90, 200, 0.4);
}

.snap-icon i {
    font-size: 26px;
    color: #fff;
    opacity: 0.9;
}

.snap-text {
    margin-top: 6px;
    font-size: 13px;
    opacity: 0.8;
}

/* AR Sticker Styling */
.ar-sticker {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.ar-sticker.selected {
    outline: 2px dashed #ff4081;
    border-radius: 8px;
}

.ar-delete-btn {
    position: absolute;
    top: -12px;
    right: -12px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* ===== Responsive Fix: Bottom bar for small phones ===== */
@media (max-width: 480px) {
  .bottom-bar {
    height: 90px;
    bottom: 20px;
    gap: 40px;
    width: 96%;
  }
}

/* ============================
   REAL-TIME AUDIO METER
============================ */
.audio-meter {
    width: 60px;
    height: 14px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.18);
    overflow: hidden;
    margin-top: 4px;
    position: relative;
}

.audio-meter canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* =======================================================
   CIRCULAR AUDIO RING METER (Around the record button)
======================================================= */
.audio-ring-canvas {
    position: absolute;
    width: 90px;
    height: 90px;
    pointer-events: none;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.overlay-resize-handle-h {
    width: 20px;
    height: 40px;
    background: rgba(255,255,255,0.9);
    border: 2px solid #ff0088;
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 6px;
    cursor: ew-resize;
    z-index: 10;
}

.overlay-resize-handle-v {
    width: 40px;
    height: 20px;
    background: rgba(255,255,255,0.9);
    border: 2px solid #ff0088;
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 6px;
    cursor: ns-resize;
    z-index: 10;
}

/* ================================
   MUSIC PANEL – SOFT PINK THEME
================================= */

.music-search-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    padding: 10px 14px;
    border-radius: 14px;
    margin-bottom: 14px;
    backdrop-filter: blur(12px);
}

.music-search-wrapper i {
    font-size: 18px;
    color: var(--pink2);
}

#musicSearchInput {
    width: 100%;
    background: transparent;
    border: none;
    color: white;
    outline: none;
    font-size: 14px;
}

.music-list {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.music-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 14px;
    cursor: pointer;
    transition: 0.25s ease;
}

.music-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 192, 203, 0.15);
    border-color: rgba(255, 60, 150, 0.4);
}

.music-item.active {
    background: linear-gradient(90deg, var(--pink2), var(--pink3));
    border-color: transparent;
    box-shadow: 0 4px 18px rgba(255, 60, 150, 0.4);
}
 
.music-left {
    display: flex;
    gap: 12px;
    align-items: center;
}

.music-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    object-fit: cover;
}

.music-title {
    font-size: 14px;
    font-weight: 600;
}

.music-artist {
    font-size: 11px;
    opacity: 0.7;
}

.music-meta {
    display: flex;
    flex-direction: column;
}

/* Equalizer */
.equalizer {
    display: flex;
    gap: 3px;
    height: 18px;
    opacity: 0;
    transition: 0.2s ease;
}

.equalizer.active {
    opacity: 1;
}

.eq-bar {
    width: 3px;
    height: 5px;
    background: var(--pink2);
    border-radius: 4px;
    animation: none;
}

.equalizer.active .eq-bar {
    animation: eqAnim 0.8s infinite ease-in-out alternate;
}

.eq-bar:nth-child(2) { animation-delay: 0.1s; }
.eq-bar:nth-child(3) { animation-delay: 0.2s; }
.eq-bar:nth-child(4) { animation-delay: 0.3s; }

@keyframes eqAnim {
    from { height: 5px; }
    to   { height: 16px; }
}


/* =========================================
   POST REEL PAGE (TikTok / Instagram style)
   ========================================= */

.post-reel-page {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}

.post-reel-page.open {
    opacity: 1;
    pointer-events: auto;
}

.post-reel-backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top, rgba(255, 111, 191, 0.3), transparent 55%),
        rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(18px);
}

.post-reel-card {
    position: relative;
    z-index: 1;
    width: min(1080px, 96vw);
    max-height: 86vh;
    background: radial-gradient(circle at top left, rgba(255, 109, 191, 0.18), transparent 40%),
                rgba(10, 10, 17, 0.98);
    border-radius: 24px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.85);
    padding: 18px 22px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: postReelFadeUp 0.36s ease-out;
}

@keyframes postReelFadeUp {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header */

.post-reel-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.post-reel-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: none;
    background: radial-gradient(circle, rgba(255, 111, 191, 0.18), rgba(255, 45, 151, 0.04));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white-soft);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.post-reel-icon-btn i {
    font-size: 18px;
}

.post-reel-icon-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.55);
    background: radial-gradient(circle, rgba(255, 111, 191, 0.3), rgba(255, 45, 151, 0.08));
}

.post-reel-header-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.post-reel-title {
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.post-reel-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

.post-reel-primary-btn {
    border: none;
    border-radius: 999px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, var(--pink2), var(--pink3));
    color: white;
    box-shadow: 0 10px 30px rgba(255, 109, 191, 0.45);
    transition: transform 0.14s ease, box-shadow 0.14s ease, opacity 0.14s ease;
}

.post-reel-primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 40px rgba(255, 109, 191, 0.6);
}

.post-reel-primary-btn:disabled {
    opacity: 0.6;
    cursor: default;
    box-shadow: none;
}

/* Layout */

.post-reel-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.3fr);
    gap: 18px;
    padding-top: 10px;
    overflow: hidden;
}

.post-reel-preview-column {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.post-reel-form-column {
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    max-height: calc(86vh - 88px);
    padding-right: 4px;
}

/* Video & cover */

.post-reel-video-shell {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: radial-gradient(circle at top, #1e1b2a, #05040a);
    box-shadow: var(--shadow);
    aspect-ratio: 9 / 16;
}

#postReelPreviewVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.post-reel-video-label {
    position: absolute;
    left: 10px;
    bottom: 10px;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.6);
    color: var(--white-soft);
    backdrop-filter: blur(12px);
}

/* Cover block */

.post-reel-cover-shell {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 16px;
    background: radial-gradient(circle at top left, rgba(255, 111, 191, 0.16), rgba(15, 15, 24, 0.96));
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.post-reel-cover-thumb {
    position: relative;
    width: 88px;
    height: 124px;
    border-radius: 16px;
    overflow: hidden;
    background: radial-gradient(circle, #242233, #05040a);
}

.post-reel-cover-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.post-reel-cover-badge {
    position: absolute;
    left: 6px;
    top: 6px;
    padding: 2px 8px;
    font-size: 10px;
    border-radius: 999px;
    background: rgba(5, 4, 10, 0.8);
    color: var(--white-soft);
    backdrop-filter: blur(10px);
}

.post-reel-cover-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.post-reel-cover-title {
    font-size: 14px;
    font-weight: 600;
    color: white;
}

.post-reel-cover-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

/* Generic sections */

.post-section {
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(10, 10, 20, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.post-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.post-section-title {
    font-size: 13px;
    font-weight: 600;
    color: white;
}

.post-section-subtitle {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
}

.post-section-char {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

/* Caption */

.post-caption-input {
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: radial-gradient(circle at top, rgba(255, 111, 191, 0.07), rgba(8, 8, 16, 0.98));
    color: white;
    padding: 8px 10px;
    font-size: 13px;
    resize: vertical;
    min-height: 72px;
    max-height: 150px;
}

.post-caption-input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.post-section-footer {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Hashtags */

.post-selected-hashtags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.post-selected-hashtags .hashtag-pill {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    border: 1px solid rgba(255, 111, 191, 0.5);
    color: var(--white-soft);
    background: radial-gradient(circle, rgba(255, 111, 191, 0.19), rgba(9, 9, 18, 0.98));
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.post-selected-hashtags .hashtag-pill span.remove {
    font-size: 12px;
    opacity: 0.9;
}

/* Visibility pills */

.post-visibility-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.post-visibility-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(15, 15, 24, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    font-size: 12px;
    color: var(--white-soft);
}

.post-visibility-pill input {
    display: none;
}

.post-visibility-pill span {
    position: relative;
}

.post-visibility-pill input:checked + span {
    color: white;
    font-weight: 600;
}

.post-visibility-pill input:checked + span::before {
    content: "";
    position: absolute;
    inset: -4px -8px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(255, 179, 217, 0.55), rgba(255, 45, 151, 0.55));
    opacity: 0.4;
    z-index: -1;
}

/* Toggles */

.post-toggle-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.post-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
}

.post-toggle input {
    display: none;
}

.post-toggle-pill {
    width: 32px;
    height: 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    position: relative;
    transition: background 0.18s ease;
}

.post-toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: white;
    transition: transform 0.18s ease;
}

.post-toggle input:checked + .post-toggle-pill {
    background: linear-gradient(135deg, var(--pink2), var(--pink3));
}

.post-toggle input:checked + .post-toggle-pill .post-toggle-knob {
    transform: translateX(14px);
}

/* Upload progress */

.post-upload-section {
    margin-top: 4px;
}

.post-upload-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.post-upload-status {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
}

.post-upload-bar {
    position: relative;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.post-upload-bar-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--pink2), var(--pink3));
    box-shadow: 0 0 18px rgba(255, 109, 191, 0.75);
    transition: width 0.25s ease-out;
}

.post-upload-note {
    margin-top: 6px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

/* Small link button */

.link-btn {
    border: none;
    background: transparent;
    color: var(--pink1);
    font-size: 11px;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
}

/* Responsive */

@media (max-width: 900px) {
    .post-reel-card {
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .post-reel-layout {
        grid-template-columns: 1fr;
        gap: 12px;
        overflow-y: auto;
    }

    .post-reel-form-column {
        max-height: unset;
    }
}



.multi-track-timeline {
    width: 100%;
    background: #101114;
    padding: 10px;
    border-top: 1px solid rgba(255,255,255,0.03);
}

.timeline-header {
    display: flex;
    gap: 10px;
    margin-bottom: 6px;
}

.timeline-header button {
    background: #1b1d21;
    border: 1px solid rgba(255,255,255,0.05);
    color: #dce4ec;
    padding: 4px 8px;
    border-radius: 4px;
}

.timeline-ruler {
    position: relative;
    height: 24px;
    margin-bottom: 10px;
}

.timeline-tracks {
    max-height: 220px;
    overflow-y: auto;
}

.timeline-track {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.track-label {
    width: 80px;
    font-size: 13px;
    color: #8da0ad;
}

.track-content {
    flex: 1;
    height: 48px;
    position: relative;
    background: rgba(255,255,255,0.02);
    border-radius: 5px;
}

.timeline-clip {
    position: absolute;
    top: 8px;
    height: 32px;
    background: #2a2d31;
    border-radius: 6px;
    padding: 0 8px;
    color: #fff;
    display: flex;
    align-items: center;
    cursor: grab;
    user-select: none;
}

.timeline-clip .clip-handle {
    position: absolute;
    top: 0;
    width: 6px;
    height: 100%;
    cursor: ew-resize;
}

.timeline-clip .handle-left { left: 0; }
.timeline-clip .handle-right { right: 0; }


.voiceover-controls {
    display: flex;
    gap: 12px;
    padding: 10px 0;
}

.voiceover-track-clip {
    background: linear-gradient(180deg, #ff4d6d, #c9184a);
}

.voiceover-track-clip .clip-label {
    font-weight: 600;
}
