/* assets/popup.css — PMPro Gift Articles frontend popup */

/* ── Bouton déclencheur ───────────────────────────────────────────────── */
.pmga-trigger-wrap {
    margin: 32px 0 8px;
    display: flex;
    justify-content: flex-start;
}
.pmga-gift-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #4f46e5;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    transition: background .2s, transform .15s, box-shadow .2s;
    box-shadow: 0 2px 8px rgba(79,70,229,.25);
}
.pmga-gift-btn:hover {
    background: #4338ca;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(79,70,229,.35);
}
.pmga-gift-btn:active { transform: translateY(0); }
.pmga-btn-icon { display: flex; align-items: center; }
.pmga-btn-quota {
    font-size: 12px;
    font-weight: 400;
    opacity: .75;
    background: rgba(255,255,255,.15);
    padding: 2px 8px;
    border-radius: 20px;
    margin-left: 4px;
}
.pmga-gift-btn.pmga-btn--disabled {
    background: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* ── Overlay ──────────────────────────────────────────────────────────── */
.pmga-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 12, 41, .55);
    backdrop-filter: blur(3px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
}
.pmga-overlay.pmga-overlay--visible {
    opacity: 1;
    pointer-events: all;
}

/* ── Popup ────────────────────────────────────────────────────────────── */
.pmga-popup {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    overflow: hidden;
    transform: translateY(16px) scale(.97);
    transition: transform .3s cubic-bezier(.22,.68,0,1.2);
}
.pmga-overlay--visible .pmga-popup {
    transform: translateY(0) scale(1);
}

/* Header */
.pmga-popup__header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 22px 22px 16px;
    border-bottom: 1px solid #f3f4f6;
}
.pmga-popup__header-icon {
    width: 44px; height: 44px;
    background: #eef2ff;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    color: #4f46e5;
}
.pmga-popup__header-icon svg { width: 22px; height: 22px; }
.pmga-popup__header-text { flex: 1; min-width: 0; }
.pmga-popup__header-text h2 {
    margin: 0 0 3px;
    font-size: 17px;
    font-weight: 600;
    color: #111827;
    line-height: 1.3;
}
.pmga-popup__article-title {
    margin: 0;
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pmga-popup__close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #9ca3af;
    border-radius: 6px;
    display: flex;
    transition: color .15s, background .15s;
    flex-shrink: 0;
}
.pmga-popup__close svg { width: 18px; height: 18px; }
.pmga-popup__close:hover { color: #374151; background: #f3f4f6; }

/* Quota bar */
.pmga-quota-bar-wrap { padding: 16px 22px 0; }
.pmga-quota-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
}
.pmga-quota-bar-label { color: #6b7280; }
.pmga-quota-bar-count { font-weight: 500; color: #374151; }
.pmga-quota-bar {
    height: 6px;
    background: #e5e7eb;
    border-radius: 6px;
    position: relative;
    overflow: visible;
}
.pmga-quota-bar__fill {
    height: 100%;
    background: #4f46e5;
    border-radius: 6px;
    transition: width .5s cubic-bezier(.4,0,.2,1);
    min-width: 0;
}
.pmga-quota-bar__fill--full { background: #ef4444; }
.pmga-quota-bar__tick {
    position: absolute;
    top: -2px;
    width: 2px; height: 10px;
    background: #fff;
    transform: translateX(-50%);
    border-radius: 1px;
}

/* Tabs */
.pmga-tabs {
    display: flex;
    gap: 4px;
    padding: 16px 22px 0;
}
.pmga-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all .15s;
}
.pmga-tab:hover { background: #f3f4f6; color: #374151; }
.pmga-tab--active {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #4f46e5;
}

/* Panels */
.pmga-panel {
    padding: 18px 22px 6px;
    display: none;
}
.pmga-panel--active { display: block; }
.pmga-panel__desc { margin: 0 0 14px; font-size: 13px; color: #6b7280; line-height: 1.5; }

/* Input */
.pmga-input-group { margin-bottom: 14px; }
.pmga-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 5px;
}
.pmga-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #111827;
    font-family: inherit;
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}
.pmga-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.pmga-input--link { padding-right: 44px; font-size: 12px; color: #6b7280; cursor: text; }

/* Action button */
.pmga-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px;
    background: #4f46e5;
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background .2s;
    margin-bottom: 16px;
}
.pmga-action-btn:hover { background: #4338ca; }
.pmga-action-btn:disabled { background: #9ca3af; cursor: not-allowed; }

/* Link result */
.pmga-link-result { position: relative; margin-bottom: 16px; }
.pmga-copy-btn {
    position: absolute;
    right: 8px; top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    transition: color .15s;
}
.pmga-copy-btn:hover { color: #4f46e5; }

/* Exhausted state */
.pmga-exhausted {
    text-align: center;
    padding: 20px 0;
    color: #6b7280;
}
.pmga-exhausted svg { color: #d1d5db; margin-bottom: 10px; }
.pmga-exhausted p { margin: 0 0 4px; font-size: 14px; }
.pmga-exhausted__reset { font-size: 12px; color: #9ca3af; }

/* Feedback */
.pmga-feedback {
    margin: 0 22px 18px;
    font-size: 13px;
    border-radius: 8px;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s, padding .3s;
}
.pmga-feedback--visible {
    padding: 10px 14px;
    max-height: 80px;
}
.pmga-feedback--success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.pmga-feedback--error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
