/* 💳 Gestion Pro — Styles Abonnement & Freemium */

/* ══════════════════════════════════════════
   MODAL UPGRADE
   ══════════════════════════════════════════ */

#upgrade-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

#upgrade-modal.visible {
    opacity: 1;
    pointer-events: all;
}

.upgrade-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.upgrade-dialog {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 36px 32px 28px;
    max-width: 440px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.3s ease;
}

#upgrade-modal.visible .upgrade-dialog {
    transform: translateY(0) scale(1);
}

.upgrade-close {
    position: absolute;
    top: 12px; right: 14px;
    background: none; border: none;
    font-size: 24px; color: #999;
    cursor: pointer; padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}
.upgrade-close:hover {
    background: #f0f0f0;
    color: #333;
}

.upgrade-icon {
    font-size: 42px;
    margin-bottom: 10px;
}

.upgrade-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.upgrade-reason {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
    padding: 0 10px;
}

.upgrade-price {
    margin-bottom: 2px;
}
.upgrade-amount {
    font-size: 2.4rem;
    font-weight: 800;
    color: #1a1a2e;
}
.upgrade-period {
    font-size: 0.9rem;
    color: #999;
    font-weight: 400;
}

.upgrade-annual {
    font-size: 13px;
    color: var(--accent, #0984E3);
    font-weight: 600;
    margin-bottom: 20px;
}

.upgrade-features {
    list-style: none;
    text-align: left;
    padding: 16px;
    margin: 0 0 20px;
    background: #f8f9fa;
    border-radius: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.upgrade-features li {
    font-size: 13px;
    padding: 5px 0;
    color: #444;
    border-bottom: 1px solid #eee;
}
.upgrade-features li:last-child { border: none; }

.upgrade-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.upgrade-btn-primary {
    width: 100%;
    padding: 14px 20px;
    background: var(--accent, #0984E3);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.upgrade-btn-primary:hover {
    background: var(--accent-dark, #0652DD);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(9, 132, 227, 0.35);
}

.upgrade-btn-annual {
    width: 100%;
    padding: 12px 20px;
    background: transparent;
    color: var(--accent, #0984E3);
    border: 2px solid var(--accent, #0984E3);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.upgrade-btn-annual:hover {
    background: var(--accent, #0984E3);
    color: white;
}

.upgrade-note {
    font-size: 11px;
    color: #aaa;
    margin-top: 14px;
}


/* ══════════════════════════════════════════
   BADGES DE LIMITE
   ══════════════════════════════════════════ */

.limit-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(0, 184, 148, 0.15);
    color: #00B894;
    margin-left: 8px;
    vertical-align: middle;
}

.limit-badge.limit-warning {
    background: rgba(253, 203, 110, 0.25);
    color: #F39C12;
}

.limit-badge.limit-reached {
    background: rgba(225, 112, 85, 0.15);
    color: #E17055;
    animation: pulse-limit 1.5s infinite;
}

@keyframes pulse-limit {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Indicateur freemium dans les headers de section */
.free-limit-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #FFF3CD, #FFF8E1);
    border: 1px solid #FFE082;
    border-radius: 8px;
    font-size: 13px;
    color: #856404;
    margin-bottom: 16px;
}

.free-limit-banner button {
    margin-left: auto;
    padding: 5px 14px;
    background: var(--accent, #0984E3);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
}
.free-limit-banner button:hover {
    background: var(--accent-dark, #0652DD);
}


/* ══════════════════════════════════════════
   SECTION PARAMÈTRES — ABONNEMENT
   ══════════════════════════════════════════ */

.settings-subscription {
    background: white;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e0e0e0;
    margin-bottom: 20px;
}

.settings-subscription h3 {
    font-size: 16px;
    margin-bottom: 16px;
    color: #1a1a2e;
}

.sub-status {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.sub-plan-badge {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}
.sub-plan-badge.free {
    background: #f0f0f0;
    color: #666;
}
.sub-plan-badge.pro {
    background: linear-gradient(135deg, var(--accent, #0984E3), var(--accent-dark, #0652DD));
    color: white;
}

.sub-details strong {
    font-size: 15px;
    display: block;
    margin-bottom: 2px;
}
.sub-details p {
    font-size: 13px;
    color: #888;
    margin: 0;
}

/* Usage bars */
.sub-usage {
    margin-bottom: 20px;
}
.sub-usage h4 {
    font-size: 13px;
    color: #888;
    margin-bottom: 12px;
    font-weight: 600;
}

.usage-item {
    margin-bottom: 10px;
}
.usage-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
}
.usage-track {
    width: 100%;
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
}
.usage-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

/* Boutons settings */
.upgrade-btn-settings,
.manage-btn-settings {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: all 0.2s;
}

.upgrade-btn-settings {
    background: var(--accent, #0984E3);
    color: white;
}
.upgrade-btn-settings:hover {
    background: var(--accent-dark, #0652DD);
    transform: translateY(-1px);
}

.manage-btn-settings {
    background: #f0f0f0;
    color: #555;
}
.manage-btn-settings:hover {
    background: #e0e0e0;
}


/* ══════════════════════════════════════════
   NOTIFICATION SUCCÈS UPGRADE
   ══════════════════════════════════════════ */

.upgrade-success-notif {
    position: fixed;
    top: 80px; left: 50%;
    transform: translateX(-50%) translateY(-20px);
    z-index: 10001;
    opacity: 0;
    transition: all 0.4s ease;
    pointer-events: none;
}

.upgrade-success-notif.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: all;
}

.notif-content {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #00B894;
    min-width: 340px;
    max-width: 500px;
}

.notif-icon { font-size: 28px; }

.notif-content strong {
    display: block;
    font-size: 14px;
    color: #1a1a2e;
    margin-bottom: 2px;
}
.notif-content p {
    font-size: 12px;
    color: #888;
    margin: 0;
}

.notif-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #ccc;
    cursor: pointer;
    padding: 4px;
    margin-left: auto;
}
.notif-close:hover { color: #666; }


/* ══════════════════════════════════════════
   FEATURE LOCK OVERLAY
   ══════════════════════════════════════════ */

.feature-locked {
    position: relative;
    pointer-events: none;
    opacity: 0.5;
    filter: grayscale(0.3);
}

.feature-lock-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: inherit;
    pointer-events: all;
    cursor: pointer;
}

.lock-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
    font-size: 13px;
    font-weight: 600;
    color: #555;
}
.lock-badge span { font-size: 16px; }


/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */

@media (max-width: 480px) {
    .upgrade-dialog {
        padding: 24px 20px 20px;
        max-width: 95%;
    }
    .upgrade-amount { font-size: 2rem; }
    .upgrade-features { padding: 12px; }
    .notif-content { min-width: auto; margin: 0 12px; }
    .free-limit-banner { flex-wrap: wrap; }
    .free-limit-banner button { margin-left: 0; width: 100%; margin-top: 8px; }
}
