
/* ==========================================================
   /ui/css/modules/ljh-campaign.css
   ----------------------------------------------------------
   LJH – Site Campaign Module
   ----------------------------------------------------------
   Ansvar:
     - Campaign roof (publik + admin)
     - Campaign panel, lights, title, badge, text, CTA
     - Carousel engine (auto-scroll publik)
     - Carousel sort mode (admin drag & drop)
     - Carousel drop zone (admin upload)
     - Carousel delete-knapp (admin + office)
     - Sort-mode delete-knapp (admin + office)
     - Start Today checkbox-layout (admin)
     - Sort thumbnail med siffra-overlay (admin + office)

   Prefix: ljh-campaign-, ljh-carousel-, ljh-sort-, ljh-drop-
   Laddas villkorligt via css_loader.php ($appKey === 'campaigns')
   Designspråk: Aqua Dark Glass
   Version: V 0.02 FAS 2
   ========================================================== */


/* ==========================================================
   1. CAMPAIGN ROOF
   ---------------------------------------------------------- */

.ljh-campaign-roof {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 26px;
    margin-bottom: 40px;
}


/* ==========================================================
   2. CAMPAIGN PANEL (glasruta)
   ---------------------------------------------------------- */

.ljh-campaign-panel {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 720px;
    padding: 28px 36px;
    border-radius: 16px;
    text-align: center;
    background: linear-gradient(
        180deg,
        rgba(255,255,255,0.96),
        rgba(240,245,255,0.94)
    );
    border: 3px solid #e6c36a;
    box-shadow:
        0 20px 60px rgba(0,0,0,0.45),
        inset 0 2px 10px rgba(255,255,255,0.7);
    transform: translateY(-6px);
}


/* ==========================================================
   3. CAMPAIGN LIGHTS (dekorativa ljuslister)
   ---------------------------------------------------------- */

.ljh-campaign-lights {
    position: absolute;
    top: -46px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 760px;
    pointer-events: none;
    z-index: 1;
}

.ljh-light-row {
    height: 10px;
    margin: 4px 0;
    border-radius: 999px;
    animation: ljh-blink 1.2s infinite linear;
}

.ljh-light-row.top {
    background-image: radial-gradient(circle, #ffe38a 3px, transparent 4px);
    background-size: 22px 10px;
    filter: drop-shadow(0 0 6px rgba(255,215,120,0.6));
}

.ljh-light-row.bottom {
    background-image: radial-gradient(circle, #ffe38a 5px, transparent 6px);
    background-size: 28px 12px;
    filter:
        drop-shadow(0 0 10px rgba(255,215,120,0.8))
        drop-shadow(0 2px 4px rgba(0,0,0,0.25));
    animation-delay: 0.6s;
}

@keyframes ljh-blink {
    0%   { opacity: 0.6; }
    50%  { opacity: 1.0; }
    100% { opacity: 0.6; }
}


/* ==========================================================
   4. CAMPAIGN TYPOGRAPHY
   ---------------------------------------------------------- */

.ljh-campaign-title {
    font-size: 34px;
    font-weight: 700;
    color: #5b8fe8;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
}

.ljh-campaign-description {
    font-size: 22px;
    color: #4a5f7a;
    opacity: 0.9;
    margin-top: 8px;
    margin-bottom: 18px;
}

.ljh-campaign-price {
    font-size: 36px;
    font-weight: 700;
    color: #1b5e20;
    text-shadow: 0 0 6px rgba(76,175,80,0.25);
    margin-bottom: 6px;
}

.ljh-campaign-price span {
    font-size: 18px;
    font-weight: 500;
    color: #6b7f99;
    margin-left: 6px;
}

.ljh-campaign-value {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    margin-bottom: 14px;
}

.ljh-old-price {
    color: #9aa6b8;
    text-decoration: line-through;
}

.ljh-discount {
    color: #2e7d32;
    font-weight: 600;
}

.ljh-campaign-meta-grid {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 10px;
}

.ljh-campaign-meta-item {
    font-size: 15px;
    color: #4a5f7a;
}

.ljh-campaign-meta-item strong {
    color: #1b5e20;
    font-weight: 700;
}


/* ==========================================================
   5. CAMPAIGN BADGE (status)
   ---------------------------------------------------------- */

.ljh-campaign-badge {
    display: inline-block;
    font-weight: 700;
    font-size: 0.95rem;
    color: rgba(255,255,255,0.92);
    letter-spacing: 0.2px;
    padding: 6px 12px;
    border-radius: 12px;
    margin-bottom: 14px;
}

.ljh-campaign-badge.is-active {
    background: linear-gradient(180deg, rgba(60,140,255,0.55), rgba(20,80,180,0.65));
    border: 1px solid rgba(120,180,255,0.6);
}

.ljh-campaign-badge.is-warning {
    background: linear-gradient(180deg, rgba(255,160,60,0.55), rgba(180,90,20,0.65));
    border: 1px solid rgba(255,190,120,0.6);
}

.ljh-campaign-badge.is-ended {
    background: linear-gradient(180deg, rgba(255,80,80,0.55), rgba(160,30,30,0.65));
    border: 1px solid rgba(255,120,120,0.6);
}

.ljh-campaign-badge.is-upcoming {
    background: linear-gradient(180deg, rgba(120,180,255,0.45), rgba(40,100,200,0.55));
    border: 1px solid rgba(150,200,255,0.6);
}


/* ==========================================================
   6. CAMPAIGN CTA
   ---------------------------------------------------------- */

.ljh-campaign-btn {
    display: inline-block;
    padding: 12px 20px;
    margin-top: 16px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 14px;
    background: linear-gradient(145deg, #fff6b0, #f3d76a, #d4a21e);
    border: 2px solid #c99b18;
    box-shadow: 0 4px 12px rgba(0,0,0,0.35);
    transition: transform 0.2s ease;
}

.ljh-campaign-btn:hover {
    transform: translateY(-1px);
}


/* ==========================================================
   7. CAROUSEL (container + track)
   ---------------------------------------------------------- */

.ljh-carousel {
    width: 100%;
    margin-top: 10px;
    background: transparent;
    overflow: hidden;
}

.ljh-carousel-track {
    display: flex;
    background: transparent;
    transition: transform 0.4s ease;
}

.ljh-carousel-slide {
    flex: 0 0 100%;
    display: flex;
    justify-content: center;
    cursor: grab;
}

.ljh-carousel-slide.dragging {
    opacity: 0.4;
    transform: scale(0.98);
    cursor: grabbing;
}


/* ==========================================================
   8. CAROUSEL CARD + IMAGE
   ---------------------------------------------------------- */

.ljh-carousel-card {
    position: relative;
    width: 100%;
    max-width: 480px;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255,255,255,0.04);
    box-shadow: 0 14px 40px rgba(0,0,0,0.45);
}

.ljh-carousel-image {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 2 / 1;
    object-fit: cover;
    object-position: top center;   /* ← visa toppen av bilden */
    pointer-events: none;
}

.ljh-carousel-content {
    display: none;
}


/* ==========================================================
   9. CAROUSEL DELETE BUTTON (karusell)
   ----------------------------------------------------------
   Ett klick raderar direkt — karusellen rör sig och
   det är opraktiskt med två-stegs confirm här.
   ---------------------------------------------------------- */

.ljh-carousel-delete-btn {
    position: absolute;
    z-index: 20;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #ff3b3b;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    transition: transform 0.15s ease, background 0.2s ease;
}

.ljh-carousel-delete-btn:hover {
    background: #ff1f1f;
    transform: scale(1.05);
}

.ljh-carousel-delete-btn:active {
    transform: scale(0.92);
}


/* ==========================================================
   10. CAROUSEL SORT WRAPPER (admin + office)
   ---------------------------------------------------------- */

.ljh-carousel-sort-wrapper {
    margin-top: 24px;
}

.ljh-carousel-sort-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 12px;
    flex-wrap: wrap;
}

.ljh-carousel-sort-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--ljh-text-muted, #9fb3c8);
    letter-spacing: 0.4px;
    text-transform: uppercase;
}


/* ==========================================================
   11. CAROUSEL SORT MODE (drag & drop)
   ---------------------------------------------------------- */

.ljh-carousel-sort-mode {
    position: relative;
    display: flex;
    gap: 18px;
    padding: 18px 20px;
    margin-top: 12px;
    border-radius: 18px;
    overflow-x: auto;
    background: linear-gradient(
        180deg,
        rgba(255,255,255,0.06),
        rgba(255,255,255,0.02)
    );
    box-shadow:
        inset 0 2px 6px rgba(255,255,255,0.08),
        0 12px 30px rgba(0,0,0,0.35);
}

.ljh-carousel-sort-mode::before {
    content: "";
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,215,120,0.6),
        transparent
    );
}


/* ==========================================================
   12. SORT ICON (miniatyrbild + siffra-overlay)
   ---------------------------------------------------------- */

.ljh-sort-icon {
    position: relative;
    flex-shrink: 0;
    width: 140px;
    height: 70px;
    border-radius: 10px;
    background: linear-gradient(145deg, #0b1f3a, #112e55);
    border: 2px solid rgba(200,200,200,0.4);
    box-shadow:
        0 6px 14px rgba(0,0,0,0.35),
        inset 0 1px 2px rgba(255,255,255,0.1);
    cursor: grab;
    user-select: none;
    overflow: hidden;
    transition: transform 0.15s ease, border-color 0.2s ease;
}

.ljh-sort-icon:hover {
    transform: translateY(-2px);
    border-color: rgba(91,143,232,0.7);
}

.ljh-sort-icon.dragging {
    opacity: 0.4;
    transform: scale(0.95);
}

.ljh-sort-icon:active {
    cursor: grabbing;
}


/* 12.1 Miniatyrbild inuti sort-icon */

.ljh-sort-thumb {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    opacity: 0.85;
}


/* 12.2 Siffra-overlay nere till höger */

.ljh-sort-number {
    position: absolute;
    right: 6px;
    bottom: 6px;
    z-index: 2;
    min-width: 24px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(0,0,0,0.7);
    color: #dbe9ff;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}


/* 12.3 Liten bildikon uppe till vänster */

.ljh-sort-icon::after {
    content: "🖼";
    position: absolute;
    top: 4px;
    left: 6px;
    z-index: 2;
    font-size: 12px;
    opacity: 0.75;
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}


/* ==========================================================
   13. DROP ZONE (admin + office upload)
   ---------------------------------------------------------- */

.ljh-drop-zone {
    margin-top: 12px;
    padding: 20px 14px;
    border: 2px dashed rgba(255,255,255,0.2);
    border-radius: 12px;
    text-align: center;
    font-size: 14px;
    color: #9fb3c8;
    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        color 0.2s ease;
    cursor: pointer;
}

.ljh-drop-zone:hover {
    border-color: rgba(91,143,232,0.5);
    color: #c0d4e6;
}

.ljh-drop-zone.is-dragover {
    border-color: #5b8fe8;
    background: rgba(91,143,232,0.08);
    color: #dbe9ff;
}

.ljh-drop-zone.is-uploading {
    border-color: #60a5fa;
    color: #60a5fa;
    animation: ljh-drop-pulse 1.2s ease-in-out infinite;
}

@keyframes ljh-drop-pulse {
    0%, 100% { opacity: 0.7; }
    50%      { opacity: 1; }
}


/* ==========================================================
   14. START TODAY – CHECKBOX LAYOUT (admin)
   ---------------------------------------------------------- */

.ljh-date-with-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ljh-date-with-toggle input[type="date"] {
    flex: 1 1 180px;
    min-width: 0;
}

.ljh-checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.12);
    color: #c0d4e6;
    font-size: 14px;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.ljh-checkbox-inline:hover {
    background: rgba(91,143,232,0.08);
    border-color: rgba(91,143,232,0.4);
}

.ljh-checkbox-inline input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #5b8fe8;
}

.ljh-checkbox-inline.is-checked {
    background: rgba(91,143,232,0.14);
    border-color: rgba(91,143,232,0.6);
    color: #dbe9ff;
}

.ljh-date-with-toggle input[type="date"]:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}


/* ==========================================================
   15. SORT-MODE DELETE BUTTON
   ----------------------------------------------------------
   Visas vid hover på sort-icon.
   Två-stegs confirm: ✕ → ? → raderar.
   Säkrare än karusell-delete eftersom sort-mode är
   statisk och lättare att klicka exakt.
   ---------------------------------------------------------- */

.ljh-sort-delete-btn {
    position: absolute;
    z-index: 10;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 59, 59, 0.85);
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    pointer-events: auto;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    transition: transform 0.15s ease, background 0.2s ease;
    line-height: 1;
}

/* Visa vid hover på sort-icon */
.ljh-sort-icon:hover .ljh-sort-delete-btn {
    display: flex;
}

.ljh-sort-delete-btn:hover {
    background: #ff1f1f;
    transform: scale(1.1);
}

.ljh-sort-delete-btn:active {
    transform: scale(0.92);
}

/* Håll knappen synlig under confirm-fasen (✕ → ?) */
.ljh-sort-delete-btn.is-confirming {
    background: #b00020;
    transform: scale(1.1);
    display: flex;
}


/* ==========================================================
   16. ARCHIVE PANEL (admin only)
   ----------------------------------------------------------
   Visar soft-deletade slides.
   Restore: ett klick.
   Permanent delete: två-stegs confirm (✕ → ?).
   ========================================================== */

.ljh-archive-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: rgba(255, 140, 0, 0.7);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    margin-left: 8px;
}

.ljh-archive-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 4px 0;
}

.ljh-archive-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 140px;
    transition: opacity 0.3s ease;
}

.ljh-archive-thumb {
    width: 140px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    opacity: 0.6;
    border: 2px dashed rgba(255,255,255,0.2);
}

.ljh-archive-thumb-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.04);
    font-size: 24px;
    color: rgba(255,255,255,0.3);
}

.ljh-archive-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Restore-knapp */
.ljh-archive-restore-btn {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 8px;
}

/* Permanent delete-knapp */
.ljh-archive-delete-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 59, 59, 0.7);
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, background 0.2s ease;
}

.ljh-archive-delete-btn:hover {
    background: #ff1f1f;
    transform: scale(1.1);
}

.ljh-archive-delete-btn.is-confirming {
    background: #b00020;
    transform: scale(1.1);
}



