/* ============================================================
   Pawa-Downloader — Frontend CSS
   ============================================================ */

.pd-card {
    max-width: 680px;
    margin: 32px auto;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,.10), 0 1px 4px rgba(0,0,0,.06);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    position: relative;
}

/* ── En-tête ──────────────────────────────────────────────── */
.pd-card__header {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    padding: 28px 28px 20px;
    background: linear-gradient(135deg, #6C47FF 0%, #9747FF 100%);
    color: #fff;
}

.pd-card__icon {
    flex-shrink: 0;
    width: 56px; height: 56px;
    background: rgba(255,255,255,.15);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
}
.pd-icon-svg {
    width: 32px; height: 32px; stroke: #fff;
}
.pd-icon-svg--pdf   { stroke: #fff; }
.pd-icon-svg--excel { stroke: #4ade80; }
.pd-icon-svg--word  { stroke: #60a5fa; }
.pd-icon-svg--video { stroke: #f472b6; }
.pd-icon-svg--audio { stroke: #fb923c; }
.pd-icon-svg--image { stroke: #34d399; }

.pd-card__meta { flex: 1; min-width: 0; }
.pd-card__title {
    font-size: 20px; font-weight: 700; color: #fff;
    margin: 0 0 8px; line-height: 1.3;
}
.pd-card__desc {
    font-size: 14px; color: rgba(255,255,255,.85);
    margin: 0 0 12px; line-height: 1.5;
}
.pd-card__tags { display: flex; flex-wrap: wrap; gap: 8px; }

.pd-tag {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 20px;
    font-size: 12px; font-weight: 600;
    background: rgba(255,255,255,.15); color: #fff;
}
.pd-tag svg { flex-shrink: 0; }

/* ── Corps ────────────────────────────────────────────────── */
.pd-card__body {
    padding: 24px 28px 28px;
}

/* ── Téléchargement gratuit ───────────────────────────────── */
.pd-free { text-align: center; }
.pd-free__badge {
    display: inline-block; background: #dcfce7; color: #15803d;
    border-radius: 20px; padding: 4px 14px; font-size: 13px;
    font-weight: 700; margin-bottom: 16px;
}

/* ── Boutons ──────────────────────────────────────────────── */
.pd-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 13px 28px; border-radius: 10px; font-size: 15px;
    font-weight: 700; cursor: pointer; border: none; text-decoration: none;
    transition: all .2s; font-family: inherit;
}
.pd-btn--download, .pd-btn--free {
    background: linear-gradient(135deg, #6C47FF, #9747FF);
    color: #fff; width: 100%;
}
.pd-btn--download:hover, .pd-btn--free:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(108,71,255,.35);
    color: #fff;
}
.pd-btn--download:active, .pd-btn--free:active { transform: translateY(0); }
.pd-btn--download:disabled, .pd-btn--free:disabled {
    opacity: .6; cursor: not-allowed; transform: none;
}

.pd-btn--whatsapp {
    background: #25D366; color: #fff;
    width: 100%; margin-bottom: 20px;
}
.pd-btn--whatsapp:hover {
    background: #1ebe5b; transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37,211,102,.35); color: #fff;
}

.pd-btn--verify {
    background: #1e293b; color: #fff;
    padding: 12px 20px;
}
.pd-btn--verify:hover { background: #0f172a; transform: translateY(-1px); }
.pd-btn--verify:disabled { opacity:.6; cursor:not-allowed; transform:none; }

/* ── Payant ───────────────────────────────────────────────── */
.pd-paid__price-box {
    display: flex; align-items: center; justify-content: space-between;
    background: #fef9ee; border: 1px solid #fed7aa;
    border-radius: 10px; padding: 14px 18px; margin-bottom: 16px;
}
.pd-paid__label { font-size: 13px; color: #78350f; font-weight: 600; }
.pd-paid__amount {
    font-size: 26px; font-weight: 800; color: #92400e;
}
.pd-paid__amount small { font-size: 13px; font-weight: 600; margin-left: 4px; }

/* ── Code secret ──────────────────────────────────────────── */
.pd-paid__code-section {
    border-top: 1px solid #f1f5f9;
    padding-top: 20px;
    margin-top: 4px;
}
.pd-paid__code-hint {
    display: flex; align-items: flex-start; gap: 8px;
    font-size: 13px; color: #475569; margin: 0 0 12px;
    line-height: 1.5;
}
.pd-paid__code-hint svg { flex-shrink: 0; margin-top: 2px; stroke: #94a3b8; }

.pd-paid__code-form { display: flex; gap: 10px; }
.pd-code-input {
    flex: 1; padding: 12px 16px; border: 2px solid #e2e8f0;
    border-radius: 10px; font-size: 16px; font-family: monospace;
    letter-spacing: 2px; color: #1e293b; transition: border-color .2s;
    outline: none;
}
.pd-code-input:focus { border-color: #6C47FF; box-shadow: 0 0 0 3px rgba(108,71,255,.12); }
.pd-code-input.pd-shake { animation: pd-shake .4s ease; }
@keyframes pd-shake {
    0%,100% { transform:translateX(0); }
    20%      { transform:translateX(-6px); }
    40%      { transform:translateX(6px); }
    60%      { transform:translateX(-4px); }
    80%      { transform:translateX(4px); }
}

/* ── Messages ─────────────────────────────────────────────── */
.pd-message {
    margin-top: 12px; font-size: 14px; font-weight: 600;
    min-height: 20px; line-height: 1.5;
}
.pd-message--success { color: #15803d; }
.pd-message--error   { color: #dc2626; }
.pd-message--info    { color: #2563eb; }

/* ── Loader ───────────────────────────────────────────────── */
.pd-loader {
    position: absolute; inset: 0;
    background: rgba(255,255,255,.9); backdrop-filter: blur(4px);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 14px; border-radius: 16px; z-index: 10;
    font-size: 14px; font-weight: 600; color: #475569;
}
.pd-loader__spinner {
    width: 40px; height: 40px;
    border: 4px solid #e2e8f0;
    border-top-color: #6C47FF;
    border-radius: 50%;
    animation: pd-spin .8s linear infinite;
}
@keyframes pd-spin { to { transform: rotate(360deg); } }

/* ── Lecteur YouTube ──────────────────────────────────────── */
.pd-card__video {
    position: relative;
    background: #000;
    overflow: hidden;
}

.pd-yt-player {
    position: relative;
    width: 100%;
}

/* Façade (avant le clic) */
.pd-yt-facade {
    position: relative;
    display: block;
    width: 100%;
    cursor: pointer;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #000;
}

.pd-yt-thumb {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease, filter .3s;
    filter: brightness(.85);
}
.pd-yt-facade:hover .pd-yt-thumb {
    transform: scale(1.03);
    filter: brightness(.7);
}

.pd-yt-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.5) 0%, transparent 50%);
    pointer-events: none;
}

/* Bouton play YouTube */
.pd-yt-play {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: none; border: none; cursor: pointer; padding: 0;
    transition: transform .2s;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,.4));
}
.pd-yt-facade:hover .pd-yt-play { transform: translate(-50%, -50%) scale(1.12); }
.pd-yt-facade:focus { outline: 3px solid #6C47FF; outline-offset: 2px; }

/* Badge "Vidéo de démonstration" */
.pd-yt-badge {
    position: absolute;
    bottom: 12px; left: 12px;
    background: rgba(0,0,0,.65);
    color: #fff; font-size: 12px; font-weight: 700;
    padding: 5px 12px; border-radius: 20px;
    backdrop-filter: blur(4px);
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* iFrame après le clic */
.pd-yt-iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: none;
}

/* ── Photo de couverture ──────────────────────────────────── */
.pd-card__cover {
    position: relative;
    overflow: hidden;
    max-height: 340px;
    background: #0f172a;
}
.pd-card__cover .pd-cover-img {
    width: 100%; display: block;
    object-fit: cover; max-height: 340px;
    transition: transform .35s ease;
}
.pd-card__cover .pd-cover-img--clickable {
    cursor: zoom-in;
}
.pd-card__cover .pd-cover-img--clickable:hover {
    transform: scale(1.02);
}
.pd-cover-gallery-hint {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(0,0,0,.65) 0%, transparent 100%);
    color: #fff; font-size: 13px; font-weight: 600;
    padding: 20px 16px 10px;
    display: flex; align-items: center; gap: 6px;
    pointer-events: none;
}

/* ── Galerie miniatures ───────────────────────────────────── */
.pd-card__gallery {
    padding: 14px 18px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
}
.pd-gallery-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}
@media (max-width:500px) { .pd-gallery-grid { grid-template-columns: repeat(4, 1fr); } }

.pd-gallery-thumb {
    position: relative; aspect-ratio: 1;
    border-radius: 6px; overflow: hidden;
    cursor: pointer; background: #e2e8f0;
}
.pd-gallery-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .25s;
    display: block;
}
.pd-gallery-thumb:hover img { transform: scale(1.08); }
.pd-gallery-thumb:focus { outline: 2px solid #6C47FF; outline-offset: 2px; }
.pd-gallery-thumb--hidden { display: none; }

.pd-gallery-more {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.55);
    color: #fff; font-size: 18px; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px;
}

/* ── Lightbox ─────────────────────────────────────────────── */
.pd-lightbox {
    position: fixed; inset: 0; z-index: 999999;
    display: flex; align-items: center; justify-content: center;
}
.pd-lightbox__backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.92);
    cursor: pointer;
}
.pd-lightbox__stage {
    position: relative; z-index: 1;
    max-width: min(92vw, 1200px);
    max-height: 90vh;
    display: flex; align-items: center; justify-content: center;
}
.pd-lightbox__img {
    max-width: min(92vw, 1200px);
    max-height: 86vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 24px 80px rgba(0,0,0,.5);
    transition: opacity .2s;
    display: block;
}
.pd-lightbox__img.pd-lb-fade { opacity: 0; }

.pd-lightbox__loader {
    position: absolute;
    width: 40px; height: 40px;
    border: 4px solid rgba(255,255,255,.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: pd-spin .8s linear infinite;
    display: none;
}
.pd-lightbox__loader.pd-lb-loading { display: block; }

.pd-lightbox__close,
.pd-lightbox__nav {
    position: fixed; z-index: 2;
    background: rgba(255,255,255,.12);
    border: none; border-radius: 50%;
    width: 52px; height: 52px;
    color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(6px);
    transition: background .2s, transform .2s;
}
.pd-lightbox__close:hover,
.pd-lightbox__nav:hover {
    background: rgba(255,255,255,.25);
    transform: scale(1.1);
}
.pd-lightbox__close { top: 20px; right: 20px; }
.pd-lightbox__prev  { left: 16px; top: 50%; transform: translateY(-50%); }
.pd-lightbox__next  { right: 16px; top: 50%; transform: translateY(-50%); }
.pd-lightbox__prev:hover { transform: translateY(-50%) scale(1.1); }
.pd-lightbox__next:hover { transform: translateY(-50%) scale(1.1); }

.pd-lightbox__counter {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
    color: rgba(255,255,255,.8); font-size: 14px; font-weight: 600;
    background: rgba(0,0,0,.4); padding: 6px 16px; border-radius: 20px;
    backdrop-filter: blur(4px); z-index: 2;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Empêcher le scroll quand le lightbox est ouvert */
body.pd-lightbox-open { overflow: hidden; }

@media (max-width:600px) {
    .pd-lightbox__prev  { left: 8px; }
    .pd-lightbox__next  { right: 8px; }
    .pd-lightbox__close { top: 12px; right: 12px; width: 44px; height: 44px; }
}


@media (max-width: 600px) {
    .pd-card__header { flex-direction: column; gap: 12px; padding: 20px; }
    .pd-card__body   { padding: 20px; }
    .pd-card__title  { font-size: 17px; }
    .pd-paid__code-form { flex-direction: column; }
    .pd-btn--verify { width: 100%; }
}
