/**
 * Memorials Module — Candle of Hope
 * Unified styles for the memorial/candle system
 * Relay For Life Rossendale
 */

/* ============================================================
   CRUK Brand Tokens
   ============================================================ */
:root {
    --cruk-navy: #2E008B;
    --cruk-magenta: #EC008C;
    --cruk-cyan: #00B6ED;
    --cruk-purple: #590075;
    --candle-amber: #fbbf24;
    --candle-glow: rgba(251, 191, 36, 0.4);
}

/* ============================================================
   SHARED / DARK SECTION BASE
   ============================================================ */
.memorials-dark-section,
.dark-section {
    background: linear-gradient(180deg, #0d0d1a 0%, #111827 100%);
    color: #fff;
}

/* ============================================================
   HERO SECTIONS
   ============================================================ */
.memorials-hero {
    background: linear-gradient(135deg, var(--cruk-navy) 0%, var(--cruk-purple) 40%, var(--cruk-magenta) 100%);
    position: relative;
    overflow: hidden;
    min-height: 400px;
}

.memorials-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 50%, rgba(0, 182, 237, 0.15) 0%, transparent 70%),
        radial-gradient(ellipse at 70% 80%, rgba(236, 0, 140, 0.1) 0%, transparent 60%);
    pointer-events: none;
}

.memorial-hero {
    background: linear-gradient(135deg, var(--cruk-navy) 0%, var(--cruk-purple) 40%, var(--cruk-magenta) 100%);
    position: relative;
    overflow: hidden;
}

.memorial-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 50%, rgba(0, 182, 237, 0.15) 0%, transparent 70%),
        radial-gradient(ellipse at 70% 80%, rgba(236, 0, 140, 0.1) 0%, transparent 60%);
    pointer-events: none;
}

.dedications-hero {
    background: linear-gradient(135deg, var(--cruk-navy), var(--cruk-purple));
}

.gallery-hero {
    background: linear-gradient(135deg, var(--cruk-navy), var(--cruk-purple));
}

/* ============================================================
   GLASS CARDS
   ============================================================ */
.glass-card {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

/* ============================================================
   CANDLE CARDS
   ============================================================ */
.candle-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
}

.candle-card:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(251, 191, 36, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.candle-grid-item {
    animation: fadeInUp 0.5s ease backwards;
}

.candle-grid-item:nth-child(1) { animation-delay: 0.05s; }
.candle-grid-item:nth-child(2) { animation-delay: 0.1s; }
.candle-grid-item:nth-child(3) { animation-delay: 0.15s; }
.candle-grid-item:nth-child(4) { animation-delay: 0.2s; }
.candle-grid-item:nth-child(5) { animation-delay: 0.25s; }
.candle-grid-item:nth-child(6) { animation-delay: 0.3s; }
.candle-grid-item:nth-child(7) { animation-delay: 0.35s; }
.candle-grid-item:nth-child(8) { animation-delay: 0.4s; }

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

/* ============================================================
   CANDLE TYPE BADGES
   ============================================================ */
.candle-type-badge,
.candle-type-pill {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: capitalize;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    backdrop-filter: blur(8px);
}

/* Light backgrounds (Tailwind pages) */
.candle-type-pill {
    background: rgba(107, 114, 128, 0.15);
    color: #6b7280;
    backdrop-filter: none;
}

.candle-type-memory,
.candle-type-in_memory { background: rgba(220, 53, 69, 0.15); color: #dc3545; }
.candle-type-celebration,
.candle-type-in_honour { background: rgba(255, 193, 7, 0.15); color: #d97706; }
.candle-type-hope,
.candle-type-survivor { background: rgba(16, 185, 129, 0.15); color: #059669; }
.candle-type-gratitude,
.candle-type-fighter { background: rgba(239, 68, 68, 0.15); color: #dc2626; }
.candle-type-supporter { background: rgba(59, 130, 246, 0.15); color: #2563eb; }
.candle-type-carer { background: rgba(236, 72, 153, 0.15); color: #db2777; }

/* ============================================================
   CANDLE COLOR DOT
   ============================================================ */
.candle-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px currentColor;
}

/* ============================================================
   CANDLE GLOW EFFECTS
   ============================================================ */
.candle-glow {
    filter: drop-shadow(0 0 20px var(--candle-glow));
}

/* ============================================================
   DEDICATION TYPE CARDS
   ============================================================ */
.dedication-type-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: pointer;
}

.dedication-type-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(236, 0, 140, 0.3);
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

.dedication-type-card[data-type="memory"]:hover { border-color: rgba(220, 53, 69, 0.5); }
.dedication-type-card[data-type="celebration"]:hover { border-color: rgba(255, 193, 7, 0.5); }
.dedication-type-card[data-type="hope"]:hover { border-color: rgba(0, 182, 237, 0.5); }
.dedication-type-card[data-type="gratitude"]:hover { border-color: rgba(40, 167, 69, 0.5); }

.dedication-icon {
    width: 64px;
    height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
}

/* ============================================================
   DEDICATION CARDS (LIST)
   ============================================================ */
.dedication-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    transition: all 0.3s ease;
}

.dedication-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* ============================================================
   WALL FILTER BAR
   ============================================================ */
.wall-filter-bar {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.filter-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    padding: 1rem;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 1rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.filter-pill:hover,
.filter-pill.active {
    background: var(--cruk-magenta);
    color: #fff;
    border-color: var(--cruk-magenta);
}

/* ============================================================
   GALLERY
   ============================================================ */
.gallery-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.gallery-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

/* Photo grid & lightbox */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.photo-item {
    position: relative;
    overflow: hidden;
    border-radius: 0.75rem;
    cursor: pointer;
    aspect-ratio: 1;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.photo-item:hover img {
    transform: scale(1.05);
}

.photo-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.photo-item:hover .photo-overlay {
    opacity: 1;
}

.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.lightbox-close:hover { background: rgba(255, 255, 255, 0.25); }

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }
.lightbox-nav:hover { background: rgba(255, 255, 255, 0.2); }

/* ============================================================
   CANDLE BAGS
   ============================================================ */
.bag-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    transition: all 0.3s ease;
    overflow: hidden;
}

.bag-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border-color: rgba(251, 191, 36, 0.3);
}

.type-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

/* Donation option inside purchase */
.donation-option {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.donation-option:hover {
    border-color: rgba(251, 191, 36, 0.4);
    background: rgba(255, 255, 255, 0.08);
}

.donation-option.selected {
    border-color: var(--candle-amber);
    background: rgba(251, 191, 36, 0.1);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.15);
}

/* ============================================================
   CEREMONY
   ============================================================ */
.memorials-live-section {
    background: #0a0a1a;
    min-height: 100vh;
    position: relative;
}

.live-toolbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.live-canvas-area {
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.live-overlay-text {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 10;
}

.live-feed-bar {
    position: fixed;
    bottom: 60px;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    height: 80px;
    overflow: hidden;
}

.live-feed-scroll {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 1rem;
    overflow-x: auto;
    scroll-behavior: smooth;
}

.live-feed-scroll::-webkit-scrollbar { display: none; }

.live-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 100;
}

/* ============================================================
   SLIDESHOW
   ============================================================ */
.memorials-slideshow-section {
    background: #0a0a1a;
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
}

.slideshow-toolbar {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 10;
}

.slideshow-canvas-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 1.5rem;
}

.slideshow-info {
    text-align: center;
    max-width: 600px;
}

.slideshow-progress {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
}

.slideshow-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--candle-amber), var(--cruk-magenta));
    transition: width 0.1s linear;
    width: 0%;
}

/* ============================================================
   FLAME CARD
   ============================================================ */
.flame-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.flame-card:hover {
    border-color: rgba(251, 191, 36, 0.3);
}

.flame-card.active {
    border-color: var(--candle-amber);
    background: rgba(251, 191, 36, 0.08);
    box-shadow: 0 0 16px rgba(251, 191, 36, 0.15);
}

.flame-preview {
    width: 40px;
    height: 60px;
}

/* ============================================================
   TYPE CARDS (light-a-candle wizard)
   ============================================================ */
.type-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.type-card:hover { border-color: rgba(236, 0, 140, 0.4); transform: translateY(-4px); }

.type-card.selected {
    border-color: var(--cruk-magenta);
    background: rgba(236, 0, 140, 0.1);
    box-shadow: 0 0 24px rgba(236, 0, 140, 0.2);
}

.type-option {
    cursor: pointer;
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    overflow: hidden;
}

.stat-card-mini {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
}

/* ============================================================
   ANALYTICS (Admin)
   ============================================================ */
.analytics-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    padding: 1.5rem;
}

.analytics-value {
    font-size: 2rem;
    font-weight: 800;
}

/* ============================================================
   TRIBUTE PAGE
   ============================================================ */
.tribute-message {
    font-size: 1.15rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.85);
}

/* ============================================================
   RANK BADGES (Leaderboard)
   ============================================================ */
.rank-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
}

.rank-1 .rank-badge { background: linear-gradient(135deg, #ffd700, #ffaa00); color: #1a1a2e; }
.rank-2 .rank-badge { background: linear-gradient(135deg, #c0c0c0, #a0a0a0); color: #1a1a2e; }
.rank-3 .rank-badge { background: linear-gradient(135deg, #cd7f32, #a0522d); color: #fff; }
.rank-default .rank-badge { background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.6); }

.top-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    transition: background 0.2s;
}

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

/* ============================================================
   SHARE & LIKE BUTTONS
   ============================================================ */
.share-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.share-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.like-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
    border-radius: 9999px;
    padding: 0.4rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
}

.like-btn:hover,
.like-btn.active {
    color: #ff6b7d;
    border-color: rgba(220, 53, 69, 0.4);
    background: rgba(220, 53, 69, 0.1);
}

.action-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    border-radius: 9999px;
    padding: 0.4rem 1rem;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

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

/* ============================================================
   STATUS BADGES
   ============================================================ */
.status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-approved { background: rgba(40, 167, 69, 0.2); color: #69f0ae; }
.status-pending { background: rgba(255, 193, 7, 0.2); color: #ffd54f; }
.status-rejected { background: rgba(220, 53, 69, 0.2); color: #ff6b7d; }

/* Pending admin card */
.pending-card {
    background: rgba(255, 193, 7, 0.06);
    border: 1px solid rgba(255, 193, 7, 0.15);
    border-radius: 0.75rem;
}

/* ============================================================
   WIZARD (light-a-candle)
   ============================================================ */
.wizard-step {
    display: none;
}

.wizard-step.active {
    display: block;
    animation: wizardFadeIn 0.4s ease;
}

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

.step-pill {
    transition: all 0.3s ease;
}

.step-pill.active {
    background: linear-gradient(135deg, var(--cruk-magenta), var(--cruk-cyan)) !important;
    color: #fff !important;
    box-shadow: 0 4px 16px rgba(236, 0, 140, 0.3);
}

.step-pill.completed {
    background: rgba(0, 182, 237, 0.2) !important;
    color: var(--cruk-cyan) !important;
}

/* ============================================================
   CANDLE FLOATER ANIMATION (particles)
   ============================================================ */
@keyframes floatUp {
    0% { transform: translateY(0) scale(1); opacity: 0.7; }
    100% { transform: translateY(-100vh) scale(0.3); opacity: 0; }
}

.candle-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--candle-amber);
    border-radius: 50%;
    animation: floatUp linear infinite;
    box-shadow: 0 0 6px 2px var(--candle-glow);
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination .page-link {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.8);
}

.pagination .page-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .memorials-hero {
        min-height: 300px;
    }

    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .live-feed-bar {
        height: 60px;
    }

    .slideshow-canvas-area {
        padding: 1rem;
    }
}
