/* ==========================================================================
   SWEETNOTE - MOBILE-FIRST RESPONSIVE DESIGN SYSTEM
   ========================================================================== */

:root {
    --bg-gradient: linear-gradient(135deg, #0f0514 0%, #1e0922 50%, #0a020d 100%);
    --accent-pink: #ff4e88;
    --accent-glow: #ff7eb3;
    --accent-gold: #fde047;
    --accent-blue: #38bdf8;
    --accent-green: #10b981;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.68);
    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.14);
    --glass-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
    --card-radius: 22px;
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-script: 'Dancing Script', cursive;
}

/* THEMES */
body[data-theme="pastel-bday"] {
    --bg-gradient: linear-gradient(135deg, #180814 0%, #2d0e22 50%, #0d040b 100%);
    --accent-pink: #f472b6;
    --accent-glow: #ec4899;
    --accent-gold: #f59e0b;
    --accent-blue: #38bdf8;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.72);
    --glass-bg: rgba(255, 255, 255, 0.07);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

body[data-theme="sunset-glow"] {
    --bg-gradient: linear-gradient(135deg, #1c0a00 0%, #361400 50%, #0f0500 100%);
    --accent-pink: #f97316;
    --accent-glow: #fb923c;
    --accent-gold: #facc15;
}

body[data-theme="rose-gold"] {
    --bg-gradient: linear-gradient(135deg, #0f0514 0%, #1e0922 50%, #0a020d 100%);
    --accent-pink: #ff4e88;
    --accent-glow: #ff7eb3;
    --accent-gold: #fde047;
}

body[data-theme="midnight-romance"] {
    --bg-gradient: linear-gradient(135deg, #090a1a 0%, #121435 50%, #050612 100%);
    --accent-pink: #a855f7;
    --accent-glow: #c084fc;
    --accent-gold: #38bdf8;
}

body[data-theme="lavender-dream"] {
    --bg-gradient: linear-gradient(135deg, #130a1c 0%, #261238 50%, #0b0512 100%);
    --accent-pink: #ec4899;
    --accent-glow: #f472b6;
    --accent-gold: #e879f9;
}

body[data-theme="emerald-love"] {
    --bg-gradient: linear-gradient(135deg, #021a12 0%, #063324 50%, #010f0a 100%);
    --accent-pink: #10b981;
    --accent-glow: #34d399;
    --accent-gold: #fbbf24;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-gradient);
    color: var(--text-primary);
    position: relative;
    display: flex;
    flex-direction: column;
    transition: background 0.4s ease;
}

/* Background Animated Canvas */
#heartCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* ==========================================================================
   TOP GLOBAL NAVIGATION BAR (RESPONSIVE ON ALL SCREENS)
   ========================================================================== */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    padding-top: env(safe-area-inset-top, 0px);
    background: rgba(15, 5, 20, 0.82);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
    gap: 10px;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    user-select: none;
    text-decoration: none;
    flex-shrink: 0;
    min-width: 0;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.nav-brand:hover {
    opacity: 0.92;
}

.nav-brand:active {
    transform: scale(0.97);
}

.brand-icon-wrap {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent-pink), #e11d48);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(255, 78, 136, 0.4);
    flex-shrink: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.heart-pulse-icon {
    width: 17px;
    height: 17px;
    color: #ffffff;
    animation: heartBeat 2s infinite ease-in-out;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.22); }
    30% { transform: scale(1); }
    45% { transform: scale(1.12); }
}

.brand-text-wrap {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.15;
}

.brand-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.brand-badge {
    font-size: 0.58rem;
    background: linear-gradient(135deg, var(--accent-pink), #a855f7);
    color: #fff;
    padding: 1.5px 5px;
    border-radius: 5px;
    font-weight: 800;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 6px rgba(255, 78, 136, 0.3);
}

.brand-subtitle {
    font-size: 0.65rem;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    display: none;
}

@media (min-width: 768px) {
    .brand-subtitle { display: block; }
}

/* Story Step Progress (Centered & Modern) */
.story-progress {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.step-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.step-dot.active {
    width: 20px;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--accent-pink), var(--accent-glow));
    box-shadow: 0 0 10px rgba(255, 78, 136, 0.6);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Icon Buttons in Nav */
.btn-nav-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
}

.btn-nav-icon i {
    width: 16px;
    height: 16px;
}

.btn-nav-icon:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.28);
    transform: translateY(-1px);
}

.btn-nav-icon:active, .btn-nav-icon.active {
    background: var(--accent-pink);
    border-color: var(--accent-glow);
    box-shadow: 0 0 12px rgba(255, 78, 136, 0.5);
    transform: scale(0.92);
}

/* Theme Picker Pill */
.theme-picker-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.theme-select-pill {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.08) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1L5 5L9 1' stroke='rgba(255,255,255,0.7)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 8px center;
    border: 1px solid var(--glass-border);
    color: #ffffff;
    padding: 6px 24px 6px 10px;
    border-radius: 20px;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    max-width: 106px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.theme-select-pill:hover {
    background-color: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.28);
}

.theme-select-pill:focus {
    border-color: var(--accent-pink);
    box-shadow: 0 0 10px rgba(255, 78, 136, 0.35);
}

.theme-select-pill option {
    background: #180a22;
    color: #ffffff;
    padding: 8px;
}

.btn-google-login, .btn-minimal-edit, .btn-make-yours-nav {
    border: none;
    padding: 7px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
}

.btn-google-login {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: #fff;
}

.btn-google-login:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.btn-google-login:active {
    transform: scale(0.95);
}

.btn-minimal-edit {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid var(--glass-border);
}

.btn-minimal-edit:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.btn-minimal-edit.active {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: #34d399;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.45);
}

.btn-minimal-edit:active {
    transform: scale(0.95);
}

.btn-make-yours-nav {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.btn-make-yours-nav:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.5);
}

.btn-make-yours-nav:active {
    transform: scale(0.95);
}

/* Expandable Nav Search Bar */
.nav-search-bar-expandable {
    position: sticky;
    top: 58px;
    z-index: 48;
    width: 100%;
    background: rgba(18, 7, 24, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 8px 14px;
    display: none;
    animation: slideDownSearch 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-search-bar-expandable.active {
    display: flex;
}

@keyframes slideDownSearch {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.search-input-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
}

.search-input-icon {
    position: absolute;
    left: 12px;
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
    pointer-events: none;
}

#globalTemplateSearchInput {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    border-radius: 22px;
    padding: 8px 36px;
    color: #fff;
    font-size: 0.84rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease;
}

#globalTemplateSearchInput:focus {
    border-color: var(--accent-pink);
    background: rgba(255, 255, 255, 0.12);
}

.btn-search-clear {
    position: absolute;
    right: 10px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 2px 6px;
    display: none;
}

.search-empty-state {
    text-align: center;
    padding: 40px 16px;
    color: var(--text-secondary);
}

.search-empty-state i {
    width: 44px;
    height: 44px;
    margin-bottom: 8px;
    color: var(--accent-pink);
    opacity: 0.8;
}

.search-empty-state h3 {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.search-empty-state p {
    font-size: 0.82rem;
}

/* User Avatar Dropdown */
.user-account-wrapper {
    position: relative;
}

.user-avatar-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    padding: 2px 8px 2px 4px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    color: #fff;
}

.user-avatar-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-pink), #9333ea);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.72rem;
}

.user-name-text {
    font-size: 0.78rem;
    font-weight: 600;
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: rgba(24, 10, 32, 0.96);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    width: 200px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    display: none;
    flex-direction: column;
    padding: 6px;
    z-index: 100;
}

.user-dropdown-menu.active {
    display: flex;
}

.dropdown-user-info {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
}

.dropdown-user-info strong {
    font-size: 0.84rem;
    color: #fff;
}

.dropdown-user-info small {
    font-size: 0.72rem;
    color: var(--text-secondary);
    word-break: break-all;
}

.dropdown-item {
    background: transparent;
    border: none;
    color: #ffffff;
    padding: 9px 10px;
    border-radius: 8px;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-item:hover, .dropdown-item:active {
    background: rgba(255, 255, 255, 0.08);
}

.dropdown-danger { color: #f87171; }

/* ==========================================================================
   MARKETPLACE CATALOG VIEW (MOBILE OPTIMIZED)
   ========================================================================== */
.marketplace-view {
    position: relative;
    z-index: 5;
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px 16px 60px;
    width: 100%;
}

.marketplace-view:not(.active) {
    display: none !important;
}

/* Hero */
.marketplace-hero {
    text-align: center;
    max-width: 760px;
    margin: 0 auto 28px;
}

.hero-tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 14px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent-glow);
    margin-bottom: 14px;
}

.marketplace-hero-title {
    font-size: clamp(1.6rem, 5.5vw, 2.8rem);
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: -0.02em;
    color: #ffffff;
    margin-bottom: 12px;
}

.serif-italic {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 600;
}

.glow-text {
    background: linear-gradient(135deg, #ff7eb3, #ffd166, #ff4e88);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.marketplace-hero-sub {
    font-size: clamp(0.85rem, 3.2vw, 1rem);
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 20px;
    padding: 0 4px;
}

.hero-stats-strip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 8px 18px;
    gap: 16px;
    max-width: 100%;
}

.hero-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-stat-num {
    font-size: 1.05rem;
    font-weight: 800;
    color: #ffffff;
}

.hero-stat-lbl {
    font-size: 0.68rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.hero-stat-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.15);
}

/* Category Filter Pills (Horizontal Touch Carousel on Mobile) */
.catalog-controls-container {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
    width: 100%;
}

.category-filter-pills {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px 2px;
    max-width: 100%;
}

.category-filter-pills::-webkit-scrollbar {
    display: none;
}

.filter-pill {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 7px 14px;
    border-radius: 24px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.filter-pill.active {
    background: linear-gradient(135deg, var(--accent-pink), #e11d48);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(255, 78, 136, 0.35);
}

/* Template Cards Grid */
.template-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
    margin-bottom: 40px;
}

.template-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--card-radius);
    overflow: hidden;
    box-shadow: var(--glass-shadow);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
}

.template-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.3);
}

.template-card:active {
    transform: scale(0.98);
}

.template-card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.68rem;
    font-weight: 800;
    color: #fff;
    backdrop-filter: blur(8px);
}

.popular-badge { background: linear-gradient(135deg, #f59e0b, #d97706); }
.featured-badge { background: linear-gradient(135deg, #ec4899, #be185d); }
.luxury-badge { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.apology-badge { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.birthday-badge { background: linear-gradient(135deg, #10b981, #047857); }
.anniversary-badge { background: linear-gradient(135deg, #eab308, #ca8a04); }

.template-card-preview-thumb {
    height: 160px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #140722;
}

.template-card-cover-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease;
}

.template-card-preview-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(14, 5, 22, 0.94) 0%, rgba(14, 5, 22, 0.35) 55%, rgba(14, 5, 22, 0.6) 100%);
    z-index: 2;
    pointer-events: none;
}

.template-card:hover .template-card-cover-img {
    transform: scale(1.08);
}

.mini-envelope-icon,
.thumb-tag {
    position: relative;
    z-index: 3;
}

.btn-edit-card-cover {
    display: none !important; /* Strictly hidden for everyone by default */
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 12;
    align-items: center;
    gap: 5px;
    background: rgba(14, 5, 22, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    padding: 4px 10px;
    font-size: 0.68rem;
    font-weight: 700;
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
    transition: all 0.22s ease;
    opacity: 0.9;
}

/* ONLY visible for verified admin (vishwakarmaakashrjcollege@gmail.com) */
body.admin-user-active .btn-edit-card-cover {
    display: inline-flex !important;
}

.btn-edit-card-cover:hover {
    opacity: 1;
    background: linear-gradient(135deg, #ff4e88, #9333ea);
    border-color: #ffffff;
    transform: translateY(-1px) scale(1.04);
    box-shadow: 0 6px 18px rgba(255, 78, 136, 0.5);
}

.btn-edit-card-cover i,
.btn-edit-card-cover svg {
    width: 12px;
    height: 12px;
}

.thumb-girlfriend { background: linear-gradient(135deg, #4a044e, #831843, #1e1b4b); }
.thumb-proposal { background: linear-gradient(135deg, #1e1b4b, #312e81, #0f172a); }

.mini-envelope-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    margin-bottom: 6px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.3);
}

.thumb-tag {
    font-size: 0.68rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.15);
}

.template-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.template-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    margin-bottom: 4px;
}

.template-category-tag {
    color: var(--accent-glow);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.template-rating {
    color: #fbbf24;
    font-weight: 600;
}

.template-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 6px;
    line-height: 1.3;
}

.template-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.45;
    margin-bottom: 12px;
}

.template-features-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 16px;
}

.template-features-tags span {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 600;
}

.template-card-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.template-price-wrap {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.original-strike {
    text-decoration: line-through;
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.free-price {
    color: #10b981;
    font-weight: 800;
    font-size: 0.98rem;
}

.card-open-action {
    color: var(--accent-glow);
    font-weight: 700;
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

/* Trust Strip */
.trust-banner-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    padding: 18px;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.trust-item i {
    width: 28px;
    height: 28px;
    color: var(--accent-glow);
    flex-shrink: 0;
}

.trust-item strong {
    font-size: 0.85rem;
    color: #fff;
    display: block;
}

.trust-item p {
    font-size: 0.74rem;
    color: var(--text-secondary);
}

/* ==========================================================================
   STORY DECK VIEWPORT & SLIDES
   ========================================================================== */
.story-deck-container {
    position: relative;
    z-index: 5;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 12px calc(80px + env(safe-area-inset-bottom, 16px));
    min-height: calc(100vh - 65px);
    min-height: calc(100dvh - 65px);
    width: 100%;
}

.demo-mode-top-bar {
    position: sticky;
    top: 58px;
    z-index: 45;
    background: rgba(24, 10, 32, 0.92);
    backdrop-filter: blur(14px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 6px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 500px;
    margin-bottom: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.demo-bar-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: #fff;
    font-weight: 700;
}

.demo-pill {
    background: #10b981;
    color: #fff;
    padding: 2px 7px;
    border-radius: 8px;
    font-size: 0.64rem;
    font-weight: 800;
}

.btn-demo-back {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ==========================================================================
   FLOATING / TOP STORY MUSIC DOCK & CONTROLS
   ========================================================================== */
.template-music-dock {
    width: 100%;
    max-width: 520px;
    margin: 0 auto 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 40;
    animation: fadeInSlide 0.3s ease;
    padding: 0 8px;
    flex-wrap: nowrap;
}

.btn-music-toggle {
    background: rgba(18, 10, 28, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    padding: 6px 14px 6px 8px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    max-width: 100%;
}

.btn-music-toggle:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.btn-music-toggle:active {
    transform: scale(0.97);
}

.music-disc-wrap {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.btn-music-toggle.playing .music-disc-wrap {
    animation: musicDiscSpin 3s linear infinite;
    background: linear-gradient(135deg, #f43f5e, #be123c);
    box-shadow: 0 0 14px rgba(244, 63, 94, 0.5);
}

@keyframes musicDiscSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.music-info-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    min-width: 120px;
}

.music-track-title {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.music-playback-status {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.03em;
}

.btn-music-toggle.playing .music-playback-status {
    color: #10b981;
}

.music-state-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    flex-shrink: 0;
}

.btn-music-toggle.playing .music-state-icon {
    background: #be123c;
    color: #ffffff;
}

.music-state-icon svg,
.music-state-icon i {
    width: 14px;
    height: 14px;
}

/* Slide Cards */
.story-slide {
    display: none;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    animation: fadeInSlide 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.story-slide.active {
    display: block;
}

@keyframes fadeInSlide {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: var(--card-radius);
    box-shadow: var(--glass-shadow);
    padding: clamp(20px, 5vw, 30px) clamp(14px, 4vw, 24px);
    text-align: center;
    position: relative;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--accent-glow);
    margin-bottom: 12px;
}

.slide-title {
    font-size: clamp(1.6rem, 5.5vw, 2.2rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 14px;
    color: #ffffff;
}

.slide-title-sm {
    font-size: clamp(1.25rem, 4.5vw, 1.5rem);
    font-weight: 800;
    margin-bottom: 4px;
    color: #ffffff;
}

.slide-hint {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.recipient-dedicated-badge {
    background: rgba(255, 255, 255, 0.06);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    padding: 10px 14px;
    margin-bottom: 12px;
}

.badge-prefix {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 2px;
}

.recipient-name-text {
    font-family: var(--font-serif);
    font-size: clamp(1.4rem, 5vw, 1.8rem);
    font-weight: 700;
    color: var(--accent-glow);
}

.slide-subtitle {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
}

/* COUNTDOWN CARD & INTERACTIVE DATE PICKER */
.countdown-minimal {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    padding: 12px 14px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.countdown-minimal:hover {
    border-color: rgba(255, 78, 136, 0.4);
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 78, 136, 0.15);
}

.countdown-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.countdown-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    flex: 1;
    min-width: 120px;
}

.countdown-date-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.countdown-date-badge i {
    width: 13px;
    height: 13px;
    color: #fde047;
}

.countdown-date-badge:hover {
    background: rgba(255, 78, 136, 0.25);
    border-color: rgba(255, 78, 136, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 78, 136, 0.3);
}

.countdown-date-badge:active {
    transform: translateY(0);
}

.date-edit-icon {
    display: inline-flex;
    align-items: center;
    opacity: 0.8;
}

.date-edit-icon i {
    width: 11px;
    height: 11px;
    color: #fff;
}

.hidden-date-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    pointer-events: none;
}

.countdown-timer-mini {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 0 2px;
}

.cd-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    min-width: 48px;
    padding: 4px 4px 2px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.cd-num {
    font-size: 1.15rem;
    font-weight: 800;
    font-family: 'Outfit', 'Inter', monospace, sans-serif;
    color: #ffffff;
    line-height: 1.1;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
}

.cd-unit {
    font-size: 0.58rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 1px;
}

.cd-sep {
    font-size: 1rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.4);
    animation: cdPulse 1s ease-in-out infinite;
    user-select: none;
}

@keyframes cdPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.countdown-edit-helper {
    margin-top: 8px;
    font-size: 0.68rem;
    color: #fde047;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    opacity: 0.85;
    animation: fadeInGlow 2s ease-in-out infinite alternate;
}

.countdown-edit-helper i {
    width: 12px;
    height: 12px;
}

@keyframes fadeInGlow {
    from { opacity: 0.6; }
    to { opacity: 1; }
}

.cd-celebration-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1.05rem;
    font-weight: 800;
    color: #fde047;
    text-shadow: 0 0 16px rgba(253, 224, 71, 0.6);
    padding: 6px 0;
    animation: cdBounce 0.8s ease infinite alternate;
}

@keyframes cdBounce {
    from { transform: scale(0.98); }
    to { transform: scale(1.02); }
}

body.viewer-mode .countdown-date-badge {
    cursor: default;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

body.viewer-mode .date-edit-icon,
body.viewer-mode .countdown-edit-helper,
body:not(.editing-active) .countdown-edit-helper,
body:not(.editing-active) .date-edit-icon {
    display: none !important;
}

.btn-story-start, .btn-primary-lg {
    background: linear-gradient(135deg, var(--accent-pink), #e11d48);
    border: none;
    color: #ffffff;
    padding: 13px 22px;
    border-radius: 26px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    box-shadow: 0 6px 20px rgba(255, 78, 136, 0.4);
    transition: transform 0.15s ease;
}

.btn-story-start:active, .btn-primary-lg:active {
    transform: scale(0.97);
}

/* ==========================================================================
   UNIVERSAL EDITABLE TEXT HIGHLIGHTS
   ========================================================================== */
.editable-text[contenteditable="true"] {
    outline: none;
    cursor: text;
    border-radius: 4px;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

body.editing-active .editable-text[contenteditable="true"]:hover,
body.editing-active .editable-text[contenteditable="true"]:focus {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 1.5px var(--accent-pink);
}

.viewer-mode .editable-text {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    cursor: default !important;
}

/* ==========================================================================
   PHOTOBOOTH STRIP & UPLOAD VISIBILITY LOGIC
   ========================================================================== */
.photobooth-minimal-layout { width: 100%; }
.file-input-hidden { display: none; }

.filmstrip-container {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 12px;
}

.filmstrip-header, .filmstrip-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.filmstrip-footer { margin-top: 10px; margin-bottom: 0; }

.filmstrip-frames {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.frame-box {
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 4 / 5;
    border: 1.5px solid rgba(255, 255, 255, 0.12);
}

.frame-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.upload-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.15s ease;
    pointer-events: none;
}

.viewer-mode .upload-overlay {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.viewer-mode .uploadable-frame { cursor: default !important; }

body:not(.viewer-mode) .uploadable-frame { cursor: pointer; }
body:not(.viewer-mode) .frame-box:hover .upload-overlay,
body:not(.viewer-mode) .frame-box:active .upload-overlay { opacity: 1; }

.frame-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
    color: #fff;
    font-size: 0.68rem;
    padding: 4px 6px;
    font-weight: 600;
}

/* Reasons Deck */
.reasons-card-deck { width: 100%; margin-top: 8px; }

.reason-single-card {
    padding: 18px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    margin-bottom: 12px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.reason-badge {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent-glow);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 2px;
}

.reason-icon { font-size: 1.5rem; margin-bottom: 6px; }
.reason-text { font-size: 0.88rem; line-height: 1.4; color: var(--text-primary); }

.reasons-nav-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.btn-icon-nav {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.reasons-counter-text {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Bucket List & Interactive Checkboxes */
.bucket-list-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
    margin-bottom: 14px;
}

.bucket-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bucket-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-pink);
    cursor: pointer;
    flex-shrink: 0;
}

.bucket-item label {
    font-size: 0.84rem;
    color: var(--text-primary);
    cursor: pointer;
    flex: 1;
    line-height: 1.35;
}

.btn-add-bucket {
    background: transparent;
    border: 1px dashed var(--glass-border);
    color: var(--text-secondary);
    padding: 7px 14px;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.stat-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 10px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-num {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--accent-glow);
    margin-bottom: 2px;
}

.stat-label {
    font-size: 0.68rem;
    color: var(--text-secondary);
    line-height: 1.25;
}

/* ==========================================================================
   ON/BELOW CARD STORY NAVIGATION DOCK
   ========================================================================== */
.story-card-footer-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 480px;
    margin: 16px auto 36px;
    padding: 8px 14px;
    background: rgba(24, 10, 32, 0.85);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 32px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
    position: relative;
    z-index: 20;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-card-nav {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-card-nav:hover {
    background: rgba(255, 255, 255, 0.16);
    transform: translateY(-1px);
}

.btn-card-nav:active {
    transform: scale(0.96);
}

.btn-card-next {
    background: linear-gradient(135deg, var(--accent-pink), #e11d48);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 14px rgba(255, 78, 136, 0.35);
}

.btn-card-next:hover {
    box-shadow: 0 6px 20px rgba(255, 78, 136, 0.5);
    background: linear-gradient(135deg, #ff6b9d, #f43f5e);
}

.card-nav-dots {
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-dot.active {
    width: 22px;
    border-radius: 10px;
    background: var(--accent-pink);
    box-shadow: 0 0 12px var(--accent-glow);
}

/* Viewer Mode Celebration Box (Pure personal signoff without upsell) */
.viewer-celebration-box {
    margin-top: 14px;
    padding: 16px 12px;
    text-align: center;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeInSlide 0.4s ease;
}

.celebration-badge-gold {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-size: 0.76rem;
    font-weight: 800;
    border-radius: 20px;
    margin-bottom: 8px;
    letter-spacing: 0.03em;
}

.viewer-celebration-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.viewer-celebration-sub {
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ==========================================================================
   MODALS & POPUPS
   ========================================================================== */
.customizer-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 150;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.customizer-modal-overlay.active {
    display: flex;
}

.pin-modal-card {
    max-width: min(92vw, 420px);
    width: 100%;
    padding: 24px 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

@keyframes pinModalShake {
    0%, 100% { transform: translateX(0); }
    15%, 45%, 75% { transform: translateX(-8px); }
    30%, 60%, 90% { transform: translateX(8px); }
}

.pin-modal-card.shake-animation {
    animation: pinModalShake 0.45s ease-in-out;
}

body.pin-lock-active {
    overflow: hidden !important;
}

#pinModalOverlay {
    z-index: 99999 !important;
}

.lock-icon-header {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 78, 136, 0.2);
    color: var(--accent-pink);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
}

.close-drawer-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
}

.result-url-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 10px 12px;
    color: #10b981;
    font-weight: 700;
    font-size: 0.82rem;
    text-align: center;
    margin-bottom: 10px;
}

/* Toast Signal */
.toast-banner-signal {
    position: fixed;
    top: 14px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    padding: 10px 18px;
    border-radius: 26px;
    font-weight: 700;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.45);
    z-index: 300;
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 90vw;
    text-align: center;
}

.toast-banner-signal.active {
    transform: translateX(-50%) translateY(0);
}

/* Instagram Browser Notice */
.ig-browser-notice {
    display: none;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    color: #fff;
    padding: 8px 12px;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    z-index: 200;
}

.ig-browser-notice.active { display: flex; }
.ig-notice-content { display: flex; align-items: center; gap: 6px; }
.btn-ig-close { background: transparent; border: none; color: #fff; font-size: 1.1rem; cursor: pointer; }

/* Dashboard & Admin */
.dashboard-links-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
    max-height: 60vh;
    overflow-y: auto;
}

.saved-link-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.card-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.views-badge {
    font-size: 0.68rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 6px;
    color: #38bdf8;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.short-url-text {
    font-size: 0.74rem;
    color: var(--accent-glow);
    word-break: break-all;
}

.card-action-row { display: flex; gap: 6px; }

.btn-mini-action {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    color: #fff;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.empty-dashboard-msg {
    text-align: center;
    padding: 24px;
    color: var(--text-secondary);
}

.empty-dashboard-msg i {
    width: 36px;
    height: 36px;
    margin-bottom: 6px;
    opacity: 0.5;
}

/* Admin Dashboard */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.admin-stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 10px 6px;
    text-align: center;
}

.admin-stat-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    margin-bottom: 2px;
}

.admin-stat-val {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
}

.pin-input-group {
    display: flex;
    gap: 6px;
    margin: 14px 0 6px;
}

.pin-input-group input {
    flex: 1;
    text-align: center;
    letter-spacing: 0.25em;
    font-size: 1.1rem;
    padding: 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    color: #fff;
}

.pin-error-msg {
    font-size: 0.74rem;
    color: #ef4444;
    display: none;
}

/* ==========================================================================
   STORY VIEW ACTIVE NAVBAR ENHANCEMENTS
   ========================================================================== */
body.story-view-active .theme-picker-wrapper {
    display: none !important;
}

body.story-view-active #btnNavSearch {
    display: none !important;
}

body.story-view-active #navSearchBar {
    display: none !important;
}

body.story-view-active .nav-brand {
    cursor: pointer;
}

body.story-view-active .nav-brand:hover .brand-title {
    color: var(--accent-glow);
}

body.story-view-active .nav-actions {
    gap: 6px;
}

/* ==========================================================================
   MOBILE SPECIFIC TWEAKS & ULTRA-RESPONSIVE NAVBAR BREAKPOINTS
   ========================================================================== */
@media (max-width: 768px) {
    .top-nav {
        height: 56px;
        padding: 0 12px;
        gap: 8px;
    }
    .brand-title { font-size: 0.98rem; }
    .story-progress {
        display: none !important; /* Step progress is handled seamlessly in footer nav on mobile */
    }
    .demo-mode-top-bar {
        max-width: 100%;
        padding: 6px 10px;
        border-radius: 16px;
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .top-nav {
        height: 52px;
        padding: 0 8px;
        gap: 6px;
    }
    .brand-title { font-size: 0.90rem; }
    .brand-icon-wrap { width: 28px; height: 28px; border-radius: 8px; }
    .heart-pulse-icon { width: 14px; height: 14px; }
    .nav-actions { gap: 5px; }
    .btn-nav-icon { width: 32px; height: 32px; }
    .theme-select-pill {
        max-width: 78px;
        font-size: 0.72rem;
        padding: 5px 18px 5px 7px;
        background-position: right 5px center;
    }
    .btn-google-login { padding: 4px 8px; font-size: 0.72rem; }
    .btn-minimal-edit { padding: 4px 8px; font-size: 0.72rem; }
    .btn-make-yours-nav { padding: 4px 8px; font-size: 0.72rem; }
    .user-name-text { max-width: 60px; font-size: 0.72rem; }
    .demo-mode-top-bar {
        padding: 5px 10px;
        font-size: 0.74rem;
        margin-bottom: 8px;
    }
    .demo-pill { font-size: 0.60rem; padding: 2px 5px; }
    .hero-stats-strip { gap: 10px; padding: 6px 12px; }
    .template-cards-grid { grid-template-columns: 1fr; gap: 14px; }
    .admin-stats-grid { grid-template-columns: 1fr 1fr; }
    .template-music-dock {
        gap: 6px;
        margin-bottom: 10px;
        padding: 0 4px;
    }
    .btn-music-toggle {
        padding: 5px 10px 5px 6px;
        gap: 7px;
    }
    .music-track-title {
        max-width: 105px;
        font-size: 0.74rem;
    }
    .btn-change-song-dock {
        padding: 6px 12px;
        font-size: 0.74rem;
        gap: 5px;
    }
}

@media (max-width: 360px) {
    .top-nav { padding: 0 4px; gap: 4px; }
    .brand-title { font-size: 0.82rem; }
    .brand-badge { display: none; }
    .brand-icon-wrap { width: 26px; height: 26px; }
    .heart-pulse-icon { width: 13px; height: 13px; }
    .auth-btn-text { display: none; }
    .btn-google-login {
        padding: 5px 7px;
        border-radius: 50%;
        width: 30px;
        height: 30px;
        justify-content: center;
    }
    .btn-minimal-edit {
        padding: 4px 7px;
        font-size: 0.68rem;
    }
    .theme-select-pill {
        max-width: 65px;
        font-size: 0.66rem;
        padding: 4px 14px 4px 5px;
    }
    .story-card-footer-nav { width: calc(100% - 12px); padding: 6px 8px; margin: 10px auto 20px; }
    .btn-card-nav { font-size: 0.74rem; padding: 5px 10px; }
}

/* ==========================================================================
   MARKETPLACE FOOTER
   ========================================================================== */
.marketplace-footer {
    width: 100%;
    max-width: 1180px;
    margin: 40px auto 24px;
    padding: 24px 20px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.marketplace-footer .footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-brand-info .footer-logo {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.footer-brand-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.footer-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: all 0.25s ease;
}

.footer-link-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.footer-bottom {
    text-align: center;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.45);
}

/* ==========================================================================
   DEDICATED MASTER ADMIN PORTAL VIEW
   ========================================================================== */
.admin-portal-view {
    width: 100%;
    min-height: 100vh;
    padding: 20px 16px 60px;
    position: relative;
    z-index: 10;
}

.admin-portal-container {
    max-width: 1140px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.admin-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(20, 10, 25, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #ff4e88, #9333ea);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.admin-brand h2 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.2px;
}

.admin-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: #10b981;
    font-weight: 600;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: pulse 2s infinite;
}

.admin-top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-admin-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-admin-action:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-admin-exit {
    background: linear-gradient(135deg, rgba(255, 78, 136, 0.2), rgba(168, 85, 247, 0.2));
    border-color: rgba(255, 78, 136, 0.35);
}

.btn-admin-exit:hover {
    background: linear-gradient(135deg, #ff4e88, #9333ea);
}

/* Admin Password Gate */
.admin-gate-card {
    max-width: 420px;
    margin: 40px auto;
    padding: 32px 24px;
    text-align: center;
    border-radius: 24px;
}

.admin-gate-icon {
    font-size: 2.8rem;
    margin-bottom: 12px;
}

.admin-gate-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.admin-gate-card p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.45;
}

.admin-gate-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-input-wrap {
    position: relative;
    width: 100%;
}

.admin-submit-btn {
    padding: 12px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.9rem;
}

.admin-error-msg {
    font-size: 0.78rem;
    color: #ef4444;
    font-weight: 600;
    margin-top: 4px;
}

/* Admin KPI Grid */
.admin-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.admin-kpi-card {
    padding: 18px 16px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.admin-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    border-color: rgba(255, 255, 255, 0.25);
}

.kpi-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.kpi-cards-created .kpi-icon-wrap { background: linear-gradient(135deg, #ff4e88, #ec4899); }
.kpi-total-views .kpi-icon-wrap { background: linear-gradient(135deg, #38bdf8, #2563eb); }
.kpi-recent-activity .kpi-icon-wrap { background: linear-gradient(135deg, #10b981, #059669); }
.kpi-top-template .kpi-icon-wrap { background: linear-gradient(135deg, #f59e0b, #d97706); }

.kpi-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.kpi-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.kpi-number {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
}

.kpi-number.kpi-text {
    font-size: 1.05rem;
}

/* Template Breakdown Section */
.admin-card-section {
    padding: 20px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.section-title-row h3, .section-header-bar h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-subtitle {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.template-breakdown-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tmpl-chip {
    padding: 6px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    font-size: 0.78rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tmpl-chip-count {
    font-weight: 800;
    color: var(--accent-glow);
}

/* Search & Filter Header */
.section-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.admin-search-filter-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.admin-search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0 10px;
}

.admin-search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    padding: 8px 6px;
    font-size: 0.8rem;
    width: 200px;
}

.admin-filter-scroll {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    max-width: 100%;
}

.admin-filter-pill {
    padding: 6px 11px;
    border-radius: 20px;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.admin-filter-pill.active, .admin-filter-pill:hover {
    color: #fff;
    background: rgba(255, 78, 136, 0.2);
    border-color: var(--accent-pink);
}

/* Activity Feed Cards List */
.admin-cards-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 580px;
    overflow-y: auto;
    padding-right: 4px;
}

.admin-card-row {
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    transition: all 0.2s ease;
}

.admin-card-row:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
}

.admin-card-primary-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 220px;
}

.admin-card-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #ff4e88, #9333ea);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.admin-card-titles h4 {
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.admin-card-meta {
    font-size: 0.72rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.admin-badge-tmpl {
    font-size: 0.68rem;
    padding: 2px 7px;
    border-radius: 8px;
    background: rgba(255, 78, 136, 0.15);
    color: var(--accent-glow);
    font-weight: 700;
}

.admin-badge-views {
    font-size: 0.70rem;
    padding: 2px 6px;
    border-radius: 8px;
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.admin-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-card-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-card-action:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.btn-action-del {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-action-del:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.admin-loading-state, .admin-empty-state {
    text-align: center;
    padding: 36px 16px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.admin-inspect-modal-card {
    width: 600px;
    max-width: 95vw;
    max-height: 85vh;
    overflow-y: auto;
}

.inspect-detail-row {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.inspect-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
}

.inspect-val {
    font-size: 0.84rem;
    color: #fff;
    line-height: 1.4;
}

.inspect-photo-grid {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.inspect-photo-thumb {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--glass-border);
}

@media (max-width: 768px) {
    .admin-kpi-grid { grid-template-columns: 1fr 1fr; }
    .admin-search-box input { width: 140px; }
    .admin-card-row { flex-direction: column; align-items: flex-start; }
    .admin-card-actions { width: 100%; justify-content: flex-end; }
}

/* ==========================================================================
   PROFESSIONAL AUTHENTICATION MODAL STYLES (ENHANCED UI)
   ========================================================================== */
.auth-modal-card {
    max-width: 440px;
    width: 94vw;
    padding: 32px 28px;
    border-radius: 28px;
    text-align: left;
    position: relative;
    background: linear-gradient(165deg, rgba(30, 24, 38, 0.94) 0%, rgba(18, 14, 24, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(225, 29, 72, 0.15);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
}

.auth-modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.75);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.auth-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: rotate(90deg) scale(1.05);
}

.auth-modal-header {
    text-align: center;
    margin-bottom: 22px;
}

.auth-brand-badge-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
}

.auth-brand-badge {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(225, 29, 72, 0.25), rgba(168, 85, 247, 0.25));
    border: 1px solid rgba(255, 78, 136, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fb7185;
    box-shadow: 0 8px 24px rgba(225, 29, 72, 0.25);
    animation: floatBadge 3.5s ease-in-out infinite alternate;
}

.auth-brand-badge i {
    width: 24px;
    height: 24px;
}

@keyframes floatBadge {
    0% { transform: translateY(0); }
    100% { transform: translateY(-4px); }
}

.auth-modal-header h3 {
    font-size: 1.45rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
    margin: 0;
}

.auth-modal-header p {
    font-size: 0.84rem;
    color: rgba(255, 255, 255, 0.65);
    margin-top: 6px;
    line-height: 1.45;
}

.auth-tabs-row {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 4px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    gap: 4px;
}

.auth-tab-btn {
    flex: 1;
    padding: 10px 14px;
    border-radius: 11px;
    font-size: 0.85rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.auth-tab-btn i {
    width: 15px;
    height: 15px;
    transition: transform 0.2s ease;
}

.auth-tab-btn:hover:not(.active) {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
}

.auth-tab-btn.active {
    background: linear-gradient(135deg, #e11d48, #be185d 50%, #9333ea 100%);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(225, 29, 72, 0.45);
}

.auth-field-group {
    margin-bottom: 16px;
}

.auth-field-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.88);
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    position: absolute;
    left: 14px;
    width: 17px;
    height: 17px;
    color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
    transition: color 0.2s ease;
}

.auth-input-field {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.25s ease;
    outline: none;
}

.auth-input-field::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.auth-input-wrap:focus-within .auth-input-icon {
    color: #fb7185;
}

.auth-input-field:focus {
    background: rgba(255, 255, 255, 0.09);
    border-color: #fb7185;
    box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.22);
}

.password-input-wrap .auth-input-field {
    padding-right: 44px;
}

.btn-toggle-pwd {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-toggle-pwd i {
    width: 17px;
    height: 17px;
}

.btn-toggle-pwd:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.auth-submit-btn {
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    padding: 13px 20px;
    border-radius: 14px;
    background: linear-gradient(135deg, #e11d48, #f43f5e 50%, #9333ea 100%);
    border: none;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 20px rgba(225, 29, 72, 0.38);
}

.auth-submit-btn .btn-arrow-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.auth-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(225, 29, 72, 0.55);
}

.auth-submit-btn:hover:not(:disabled) .btn-arrow-icon {
    transform: translateX(3px);
}

.auth-submit-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 18px 0;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-divider span {
    padding: 0 12px;
}

.btn-google-auth-full {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    padding: 12px 18px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-google-auth-full .google-svg-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-google-auth-full:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.auth-trust-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 18px;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
}

.auth-trust-footer i {
    width: 13px;
    height: 13px;
    color: #10b981;
}

.auth-feedback-alert {
    padding: 11px 16px;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeIn 0.25s ease;
}

.auth-feedback-alert.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.auth-feedback-alert.info {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #bae6fd;
}

#authModalOverlay {
    z-index: 220;
}

.auth-feedback-alert.success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #6ee7b7;
}

/* ==========================================================================
   ADMIN DATE FILTER & MAIN NAVIGATION TABS
   ========================================================================== */
.admin-date-filter-card {
    padding: 12px 18px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    background: rgba(255, 255, 255, 0.04);
}

.date-filter-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #fff;
}

.date-quick-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-date-quick {
    padding: 5px 11px;
    border-radius: 14px;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-date-quick.active, .btn-date-quick:hover {
    color: #fff;
    background: rgba(139, 92, 246, 0.25);
    border-color: #8b5cf6;
}

.custom-date-pickers {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-date-input {
    padding: 5px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    color: #fff;
    font-size: 0.76rem;
    color-scheme: dark;
}

.btn-apply-date-filter {
    padding: 5px 12px;
    border-radius: 10px;
    font-size: 0.76rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #ff4e88, #9333ea);
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-apply-date-filter:hover {
    transform: scale(1.04);
}

.btn-reset-date-filter {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: #fff;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

/* Admin Main Navigation Tabs */
.admin-main-nav-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 8px;
    margin-top: 4px;
    overflow-x: auto;
}

.admin-tab-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 14px;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.admin-tab-nav-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.admin-tab-nav-btn.active {
    color: #fff;
    background: rgba(255, 78, 136, 0.18);
    border-color: rgba(255, 78, 136, 0.4);
    box-shadow: 0 4px 14px rgba(255, 78, 136, 0.2);
}

/* Admin Data Table */
.admin-users-table-wrap {
    overflow-x: auto;
    width: 100%;
}

.admin-data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.82rem;
}

.admin-data-table thead th {
    padding: 12px 14px;
    color: var(--text-secondary);
    font-weight: 700;
    border-bottom: 1px solid var(--glass-border);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.5px;
}

.admin-data-table tbody td {
    padding: 12px 14px;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
}

.admin-data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

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

.user-cell-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff;
}

.badge-role {
    font-size: 0.70rem;
    padding: 2px 7px;
    border-radius: 8px;
    font-weight: 700;
}

.badge-role.admin {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.badge-role.creator {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.35);
}

.badge-payment-status {
    font-size: 0.70rem;
    padding: 3px 8px;
    border-radius: 8px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-payment-status.completed_free {
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
}

.badge-payment-status.completed {
    background: rgba(56, 189, 248, 0.18);
    color: #38bdf8;
}

/* ==========================================================================
   INTERACTIVE ACTIVITY: REALISTIC SCRATCH-OFF SECRET COUPON
   ========================================================================== */
.scratch-coupon-wrapper {
    margin: 18px 0 10px 0;
    padding: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    animation: fadeInScale 0.6s ease;
}

.scratch-coupon-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.scratch-badge {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 10px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f59e0b, #ec4899);
    color: #fff;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.3);
}

.scratch-instruction {
    font-size: 0.76rem;
    color: #ffd1dc;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.scratch-card-box {
    position: relative;
    width: 100%;
    min-height: 135px;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(135deg, #1f1230 0%, #2f1742 100%);
    border: 2px dashed rgba(255, 215, 0, 0.4);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
    user-select: none;
    -webkit-user-select: none;
}

/* Hidden Reward Content */
.scratch-secret-content {
    position: absolute;
    inset: 0;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 1;
}

.scratch-reward-icon {
    font-size: 2.2rem;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 12px rgba(255, 215, 0, 0.4));
    animation: pulseSlow 2s infinite ease-in-out;
}

.scratch-reward-text {
    flex: 1;
    text-align: left;
}

.scratch-reward-pill {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fbbf24;
    display: block;
    margin-bottom: 2px;
}

.scratch-reward-text h4 {
    font-size: 0.98rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.35;
    margin-bottom: 4px;
    text-shadow: 0 2px 10px rgba(255, 215, 0, 0.25);
}

.scratch-reward-text p {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
    margin: 0;
}

.scratch-stamp {
    position: absolute;
    right: 12px;
    bottom: 10px;
    padding: 4px 10px;
    border: 2px solid #10b981;
    border-radius: 8px;
    color: #34d399;
    font-weight: 900;
    font-size: 0.74rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transform: rotate(-8deg) scale(0);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.scratch-stamp.stamped {
    transform: rotate(-8deg) scale(1);
    opacity: 0.9;
}

/* Scratch Overlay Canvas */
.scratch-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    cursor: grab;
    touch-action: none;
    transition: opacity 0.4s ease;
}

.scratch-canvas:active {
    cursor: grabbing;
}

.scratch-canvas.cleared {
    opacity: 0;
    pointer-events: none;
}

.scratch-footer-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 0.76rem;
    color: var(--text-secondary);
}

.btn-scratch-reveal {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 3px 10px;
    font-size: 0.72rem;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-scratch-reveal:hover {
    background: rgba(255, 255, 255, 0.16);
}

/* ==========================================================================
   IN-APP MUSIC SEARCH & AUDIO PICKER
   ========================================================================== */
.btn-change-song-dock {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: linear-gradient(135deg, #ff2d75 0%, #9333ea 100%);
    border: 1.5px solid rgba(255, 255, 255, 0.7);
    border-radius: 28px;
    padding: 8px 16px;
    color: #ffffff !important;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.3px;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(255, 45, 117, 0.5), 0 0 10px rgba(147, 51, 234, 0.35);
    transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    white-space: nowrap;
    flex-shrink: 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.btn-change-song-dock:hover {
    background: linear-gradient(135deg, #ff1464 0%, #a855f7 100%);
    border-color: #ffffff;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 24px rgba(255, 20, 100, 0.65), 0 0 18px rgba(168, 85, 247, 0.5);
}

.btn-change-song-dock:active {
    transform: scale(0.96);
}

.btn-change-song-dock i,
.btn-change-song-dock svg {
    width: 15px;
    height: 15px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
    animation: musicNoteBounce 2s infinite ease-in-out;
}

@keyframes musicNoteBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

.mobile-drawer-pull-bar {
    display: none;
    width: 44px;
    height: 5px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.35);
    margin: 12px auto 2px;
}

.music-search-modal-card {
    max-width: 520px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.music-search-body {
    padding: 16px 20px 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
}

.music-search-input-wrap {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    padding: 10px 14px;
    gap: 10px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.music-search-input-wrap:focus-within {
    border-color: var(--accent-glow);
    box-shadow: 0 0 15px rgba(255, 78, 136, 0.3);
}

.music-search-icon {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.music-search-input-wrap input {
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 0.92rem;
    width: 100%;
}

.music-search-input-wrap input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.btn-clear-music-search {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
}

.music-quick-chips-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.chips-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 700;
}

.music-quick-chip {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 4px 9px;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    transition: all 0.2s;
}

.music-quick-chip:hover {
    background: rgba(255, 78, 136, 0.2);
    border-color: rgba(255, 78, 136, 0.4);
    color: #fff;
}

.music-results-container {
    min-height: 220px;
    max-height: 380px;
    overflow-y: auto;
}

.music-empty-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    gap: 10px;
}

.music-empty-hint i {
    width: 36px;
    height: 36px;
    opacity: 0.4;
}

.music-loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 30px;
    color: #ffd1dc;
    font-size: 0.85rem;
}

.spin-icon {
    animation: spin 1s linear infinite;
}

.music-results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.music-track-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 8px 12px;
    gap: 12px;
    transition: all 0.2s;
}

.music-track-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 126, 179, 0.35);
}

.music-track-item.active-preview {
    background: rgba(255, 78, 136, 0.15);
    border-color: rgba(255, 78, 136, 0.5);
}

.track-artwork-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.track-info-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.track-name-main {
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-artist-sub {
    font-size: 0.74rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-actions-col {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.btn-track-preview {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-track-preview:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.08);
}

.btn-track-select {
    padding: 6px 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, #ff4e88, #a855f7);
    border: none;
    color: #fff;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-track-select:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 14px rgba(255, 78, 136, 0.4);
}

/* ==========================================================================
   MUSIC SKELETON SHIMMER LOADING STATE
   ========================================================================== */
.music-skeleton-wrap {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 4px 0;
}

.music-skeleton-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.skeleton-art {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    flex-shrink: 0;
}

.skeleton-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.skeleton-title {
    width: 65%;
    height: 14px;
    border-radius: 6px;
}

.skeleton-sub {
    width: 40%;
    height: 10px;
    border-radius: 5px;
}

.skeleton-btn {
    width: 72px;
    height: 30px;
    border-radius: 12px;
    flex-shrink: 0;
}

.shimmer {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.16) 50%, rgba(255, 255, 255, 0.04) 100%);
    background-size: 200% 100%;
    animation: shimmerWave 1.4s infinite ease-in-out;
}

@keyframes shimmerWave {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==========================================================================
   MOBILE PHONE RESPONSIVE BOTTOM SHEET OPTIMIZATION
   ========================================================================== */
@media (max-width: 640px) {
    #musicSearchModalOverlay {
        padding: 0;
        align-items: flex-end;
    }

    .music-search-modal-card {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 88vh;
        border-radius: 26px 26px 0 0 !important;
        border-bottom: none;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.7);
        animation: slideUpMobileSheet 0.32s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .mobile-drawer-pull-bar {
        display: block;
    }

    .music-search-modal-card .drawer-header {
        padding: 8px 18px 8px 18px;
    }

    .music-search-body {
        padding: 10px 14px 28px 14px;
        gap: 12px;
    }

    .music-search-input-wrap {
        padding: 9px 12px;
    }

    .music-search-input-wrap input {
        font-size: 16px; /* Prevents auto-zoom on iOS */
    }

    .music-quick-chips-row {
        gap: 6px;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .music-quick-chips-row::-webkit-scrollbar {
        display: none;
    }

    .music-quick-chip {
        flex-shrink: 0;
        font-size: 0.74rem;
        padding: 5px 10px;
    }

    .music-results-container {
        max-height: 52vh;
        min-height: 180px;
    }

    .music-track-item {
        padding: 8px 10px;
        gap: 9px;
    }

    .track-artwork-thumb {
        width: 40px;
        height: 40px;
        border-radius: 8px;
    }

    .track-name-main {
        font-size: 0.84rem;
        max-width: 140px;
    }

    .track-artist-sub {
        font-size: 0.70rem;
        max-width: 130px;
    }

    .btn-track-preview {
        width: 32px;
        height: 32px;
    }

    .btn-track-select {
        padding: 6px 10px;
        font-size: 0.72rem;
    }
}

@keyframes slideUpMobileSheet {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* ==========================================================================
   CUSTOM COVER EDITOR MODAL
   ========================================================================== */
.cover-edit-modal-card {
    max-width: 480px;
    width: 100%;
}

.cover-edit-body {
    padding: 16px 20px 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cover-preview-box {
    width: 100%;
    height: 160px;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    background: #0f0518;
}

.cover-preview-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cover-preview-tag {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
}

.cover-input-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.btn-browse-cover {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px dashed rgba(255, 255, 255, 0.35);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-browse-cover:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: var(--accent-glow);
}

.cover-divider-or {
    text-align: center;
    position: relative;
    margin: 4px 0;
}

.cover-divider-or::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.12);
}

.cover-divider-or span {
    position: relative;
    background: #170b22;
    padding: 0 10px;
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.cover-url-input-wrap {
    display: flex;
    gap: 8px;
}

.cover-url-input-wrap input {
    flex: 1;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 9px 12px;
    color: #fff;
    font-size: 0.82rem;
    outline: none;
}

.cover-url-input-wrap input:focus {
    border-color: var(--accent-glow);
}

.btn-apply-cover-url {
    padding: 9px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.btn-apply-cover-url:hover {
    background: rgba(255, 255, 255, 0.22);
}

.cover-edit-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 6px;
}

.btn-reset-default-cover {
    padding: 9px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.btn-reset-default-cover:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.btn-save-cover-confirm {
    flex: 1;
    padding: 10px 18px;
    border-radius: 12px;
    background: linear-gradient(135deg, #ff2d75, #9333ea);
    border: none;
    color: #fff;
    font-size: 0.84rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(255, 45, 117, 0.4);
    transition: all 0.2s ease;
}

.btn-save-cover-confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(255, 45, 117, 0.6);
}








/* ==========================================================================
   VIEWER CARD UNWRAPPING & RETRY LOADER OVERLAY
   ========================================================================== */
.card-loader-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, rgba(30, 10, 36, 0.94) 0%, rgba(10, 5, 18, 0.98) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.card-loader-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.card-loader-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    padding: 38px 28px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 40px rgba(255, 45, 117, 0.15);
    text-align: center;
    overflow: hidden;
    animation: cardLoaderPop 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardLoaderPop {
    from {
        transform: scale(0.92);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.card-loader-anim-wrap {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-loader-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(255, 45, 117, 0.4);
    animation: loaderPulseRing 2.2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

.card-loader-ring.r2 {
    animation-delay: 0.6s;
    border-color: rgba(168, 85, 247, 0.35);
}

@keyframes loaderPulseRing {
    0% {
        transform: scale(0.7);
        opacity: 1;
    }
    100% {
        transform: scale(1.65);
        opacity: 0;
    }
}

.card-loader-heart-icon {
    position: relative;
    z-index: 2;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 45, 117, 0.25), rgba(168, 85, 247, 0.25));
    border: 1px solid rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 8px 24px rgba(255, 45, 117, 0.3);
    animation: heartIconFloat 2s ease-in-out infinite alternate;
}

@keyframes heartIconFloat {
    from {
        transform: translateY(0px) scale(1);
    }
    to {
        transform: translateY(-4px) scale(1.05);
    }
}

.card-loader-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 8px 0;
    letter-spacing: -0.02em;
}

.card-loader-sub {
    font-size: 0.88rem;
    color: var(--text-secondary, #cbd5e1);
    margin: 0 0 22px 0;
    min-height: 20px;
    transition: color 0.2s ease;
}

.card-loader-progress-wrap {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
    margin: 0 auto;
}

.card-loader-bar {
    height: 100%;
    width: 25%;
    background: linear-gradient(90deg, #ff2d75, #ec4899, #a855f7);
    border-radius: 999px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 12px rgba(255, 45, 117, 0.6);
}

.card-loader-error {
    margin-top: 14px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeInError 0.3s ease;
}

@keyframes fadeInError {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.card-loader-error-desc {
    font-size: 0.84rem;
    color: #fca5a5;
    line-height: 1.45;
    margin-bottom: 18px;
}

.card-loader-btn-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@media (min-width: 480px) {
    .card-loader-btn-row {
        flex-direction: row;
    }
}

.btn-loader-retry {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 14px;
    background: linear-gradient(135deg, #ff2d75, #be123c);
    border: none;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(255, 45, 117, 0.4);
    transition: all 0.2s ease;
}

.btn-loader-retry:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(255, 45, 117, 0.6);
}

.btn-loader-home {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-loader-home:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.35);
}
