/*
 * wpForo Advanced Attachments 3.2.0 — access.css
 * Panel de contrôle d'accès et partage par fichier
 */

/* ── Overlay ── */
.wpfa-access-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(4px);
    z-index: 99998;
}

/* ── Panel ── */
.wpfa-access-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(460px, 94vw);
    max-height: 88vh;
    background: var(--color-background-primary, #fff);
    border: 1px solid var(--color-border-tertiary, #e5e5e5);
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0,0,0,.18);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: system-ui, -apple-system, sans-serif;
}

.wpfa-ap-inner { display: flex; flex-direction: column; height: 100%; }

.wpfa-ap-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--color-border-tertiary, #e5e5e5);
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}
.wpfa-ap-close {
    background: none; border: none;
    font-size: 16px; cursor: pointer;
    color: #888; padding: 2px 8px; border-radius: 5px;
}
.wpfa-ap-close:hover { background: #f0f0f0; }

.wpfa-ap-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.wpfa-ap-filename {
    font-size: 12px;
    color: #666;
    background: #f5f5f5;
    border-radius: 6px;
    padding: 8px 12px;
    margin: 0;
    word-break: break-all;
}

/* ── Grille visibilité ── */
.wpfa-vis-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}
.wpfa-vis-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 4px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    background: #fafafa;
    cursor: pointer;
    font-size: 11px;
    text-align: center;
    transition: border-color .12s, background .12s;
}
.wpfa-vis-btn > span { font-size: 18px; line-height: 1; }
.wpfa-vis-btn > strong { font-size: 11px; font-weight: 600; color: #333; }
.wpfa-vis-btn > small { font-size: 9px; color: #888; display: none; }
.wpfa-vis-btn:hover  { border-color: #999; background: #f0f0f0; }
.wpfa-vis-btn.active { border-color: #3b82f6; background: #eff6ff; }

/* ── Groupes ── */
.wpfa-groups-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.wpfa-groups-wrap label {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: #f5f5f5;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
}

/* ── Lien de partage ── */
.wpfa-share-wrap { display: flex; flex-direction: column; gap: 8px; }

.wpfa-share-url-row {
    display: flex;
    gap: 6px;
}
.wpfa-share-url {
    flex: 1;
    padding: 7px 10px;
    border: 1px solid #ddd;
    border-radius: 7px;
    font-size: 11px;
    font-family: monospace;
    color: #3b82f6;
    min-width: 0;
    background: #f0f7ff;
}
.wpfa-copy-btn {
    padding: 7px 10px;
    border: 1px solid #ddd;
    border-radius: 7px;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 13px;
    flex-shrink: 0;
    transition: background .12s;
}
.wpfa-copy-btn:hover { background: #e5e5e5; }

.wpfa-share-wrap label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #555;
}
.wpfa-share-wrap label select,
.wpfa-share-wrap label input[type=number],
.wpfa-share-wrap label input[type=password] {
    flex: 1;
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 12px;
}

.wpfa-share-actions { display: flex; gap: 8px; }

.wpfa-dl-stats { font-size: 11px; color: #888; }

/* ── Boutons ── */
.wpfa-btn-primary {
    background: #3b82f6; color: #fff;
    border: none; border-radius: 7px;
    padding: 7px 14px; font-size: 12px;
    font-weight: 600; cursor: pointer;
    transition: background .12s;
}
.wpfa-btn-primary:hover { background: #2563eb; }
.wpfa-btn-danger {
    background: #ef4444; color: #fff;
    border: none; border-radius: 7px;
    padding: 7px 14px; font-size: 12px;
    font-weight: 600; cursor: pointer;
}
.wpfa-btn-danger:hover { background: #dc2626; }

.wpfa-ap-footer {
    padding: 12px 18px;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.wpfa-ap-saved { font-size: 12px; color: #16a34a; font-weight: 600; }

/* ── Badge visibilité dans le dialog WPFA ── */
.wpfa-vis-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    border-radius: 9999px;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    margin-left: 5px;
    white-space: nowrap;
}
.wpfa-access-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #f5f5f5;
    font-size: 11px;
    cursor: pointer;
    margin-left: 5px;
    transition: background .12s;
}
.wpfa-access-btn:hover { background: #e5e5e5; }

/* ── Commentaires inline (vidéo) ── */
.wpfa-mc-inline-panel {
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    margin-top: 6px;
    overflow: hidden;
    background: #fafafa;
}
.wpfa-mc-list    { padding: 8px 12px; display: flex; flex-direction: column; gap: 8px; max-height: 200px; overflow-y: auto; }
.wpfa-mc-loading { font-size: 12px; color: #888; text-align: center; padding: 10px; }
.wpfa-mc-empty   { font-size: 12px; color: #aaa; text-align: center; margin: 0; }
.wpfa-mc-item    { display: flex; gap: 7px; align-items: flex-start; }
.wpfa-mc-avatar  { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.wpfa-mc-content { flex: 1; min-width: 0; }
.wpfa-mc-meta    { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11px; color: #888; margin-bottom: 2px; }
.wpfa-mc-meta strong { color: #333; }
.wpfa-mc-ctx     { background: #e8f0fe; color: #3b5bdb; padding: 1px 5px; border-radius: 4px; font-size: 10px; }
.wpfa-mc-delete  { background: none; border: none; cursor: pointer; color: #ccc; font-size: 11px; padding: 0; }
.wpfa-mc-delete:hover { color: #ef4444; }
.wpfa-mc-share-link { color: #aaa; text-decoration: none; font-size: 11px; }
.wpfa-mc-share-link:hover { color: #3b82f6; }
.wpfa-mc-body    { font-size: 13px; color: #333; line-height: 1.5; word-break: break-word; }
.wpfa-mc-form    { display: flex; gap: 6px; align-items: flex-end; padding: 8px 12px; border-top: 1px solid #e5e5e5; }
.wpfa-mc-input   { flex: 1; border: 1px solid #ddd; border-radius: 6px; padding: 6px 10px; font-size: 12px; resize: none; font-family: inherit; }
.wpfa-mc-submit  { padding: 6px 12px; background: #3b82f6; color: #fff; border: none; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; flex-shrink: 0; }

/* ── Panel comments dans slider ── */
.wpfa-mc-panel {
    background: #f9fafb;
    border-top: 1px solid #e5e5e5;
    border-radius: 0 0 12px 12px;
    flex-direction: column;
    max-height: 280px;
}
.wpfa-mc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid #e5e5e5;
    font-size: 12px;
    font-weight: 600;
}
.wpfa-mc-title { color: #333; }
.wpfa-mc-close { background: none; border: none; color: #999; cursor: pointer; font-size: 14px; }

/* ── Toast ── */
#wpfa-toasts {
    position: fixed;
    bottom: 20px; right: 20px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: none;
}
.wpfa-toast {
    background: #1e293b;
    border-left: 3px solid #22c55e;
    color: #e2e8f0;
    padding: 9px 14px;
    border-radius: 7px;
    font-size: 12px;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity .2s, transform .2s;
    font-family: system-ui, sans-serif;
}
.wpfa-toast.show { opacity: 1; transform: none; }
