/**
 * Credits Tab - Dashboard Utilisateur
 * Styles pour l'onglet Crédits du tableau de bord
 */

/* ================================================
   SOLDE CRÉDITS - HEADER CARD
   ================================================ */

.kl-credits-balance-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 25px 30px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    border: 2px solid #fbbf24;
    box-shadow: 0 8px 32px rgba(251, 191, 36, 0.15);
    margin-bottom: 30px;
}

.kl-credits-balance-card.kl-credits-balance-centered {
    justify-content: center;
}

.kl-credits-balance-header {
    display: flex;
    align-items: center;
    gap: 20px;
}

.kl-credits-balance-icon {
    font-size: 3rem;
    filter: drop-shadow(0 4px 8px rgba(251, 191, 36, 0.4));
}

.kl-credits-balance-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.kl-credits-balance-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.kl-credits-balance-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: #fbbf24;
    line-height: 1;
}

.kl-credits-balance-unit {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.kl-credits-buy-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #1a1a2e;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3);
}

.kl-credits-buy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(251, 191, 36, 0.4);
    color: #1a1a2e;
}

/* ================================================
   SECTIONS
   ================================================ */

.kl-credits-section {
    background: var(--kl-bg-card, #1e293b);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid var(--kl-border, rgba(255, 255, 255, 0.1));
}

.kl-credits-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.kl-credits-rate,
.kl-quests-reset,
.kl-section-subtitle {
    font-size: 0.8rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5);
    margin-left: auto;
}

.kl-quests-reset {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
    padding: 4px 10px;
    border-radius: 20px;
}

/* ================================================
   PACKS DE CRÉDITS
   ================================================ */

.kl-credits-packs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.kl-credit-pack {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 15px;
    padding-top: 25px; /* Espace pour le badge */
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.3s ease;
    min-height: 180px; /* Hauteur minimale uniforme */
}

.kl-credit-pack .kl-pack-buy-btn {
    margin-top: auto; /* Pousse le bouton vers le bas */
}

.kl-credit-pack:hover {
    border-color: rgba(251, 191, 36, 0.5);
    background: rgba(251, 191, 36, 0.05);
    transform: translateY(-3px);
}

.kl-credit-pack.kl-pack-popular {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.kl-credit-pack.kl-pack-best {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.kl-credit-pack.kl-pack-starter {
    border-color: #64748b;
    background: rgba(100, 116, 139, 0.1);
}

.kl-credit-pack.kl-pack-pro {
    border-color: #f97316;
    background: rgba(249, 115, 22, 0.1);
}

.kl-credit-pack.kl-pack-ultimate {
    border-color: #a855f7;
    background: rgba(168, 85, 247, 0.1);
}

.kl-pack-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 20px;
    white-space: nowrap;
}

.kl-pack-starter .kl-pack-badge {
    background: #64748b;
    color: #fff;
}

.kl-pack-popular .kl-pack-badge {
    background: #3b82f6;
    color: #fff;
}

.kl-pack-best .kl-pack-badge {
    background: #22c55e;
    color: #fff;
}

.kl-pack-pro .kl-pack-badge {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: #fff;
}

.kl-pack-ultimate .kl-pack-badge {
    background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
    color: #fff;
}

.kl-pack-amount {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
}

.kl-pack-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fbbf24;
}

.kl-pack-savings {
    font-size: 0.8rem;
    color: #22c55e;
    font-weight: 600;
}

.kl-pack-buy-btn {
    width: 100%;
    padding: 10px 15px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #1a1a2e;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.kl-pack-buy-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
}

.kl-credits-payment-info {
    text-align: center;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
}

/* ================================================
   QUÊTES HEBDOMADAIRES
   ================================================ */

.kl-quests-locked {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 20px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
}

.kl-quests-locked-icon {
    font-size: 2rem;
}

.kl-quests-locked-text strong {
    display: block;
    color: #ef4444;
    margin-bottom: 8px;
}

.kl-quests-locked-text p {
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 10px 0;
    font-size: 0.9rem;
}

.kl-quests-locked-text ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.kl-quests-locked-text li {
    padding: 5px 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.kl-quest-req {
    color: #fbbf24;
    font-weight: 500;
}

.kl-quests-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kl-quest-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.kl-quest-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.kl-quest-item.kl-quest-completed {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
}

.kl-quest-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.kl-quest-info {
    flex: 1;
    min-width: 0;
}

.kl-quest-name {
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
}

.kl-quest-desc {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
}

.kl-quest-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.kl-quest-progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.kl-quest-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.kl-quest-completed .kl-quest-progress-fill {
    background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
}

.kl-quest-progress-text {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    min-width: 50px;
    text-align: right;
}

.kl-quest-reward {
    font-size: 1rem;
    font-weight: 600;
    color: #fbbf24;
    white-space: nowrap;
}

.kl-quest-claim-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.kl-quest-claim-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
}

.kl-quests-cap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.kl-quests-cap-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.kl-quests-cap-value {
    font-weight: 600;
    color: #fbbf24;
}

/* ================================================
   BADGES AVEC RÉCOMPENSES
   ================================================ */

.kl-badge-rewards-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kl-badge-reward-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

.kl-badge-reward-item.kl-badge-unlocked {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
}

.kl-badge-reward-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.kl-badge-reward-info {
    flex: 1;
    min-width: 0;
}

.kl-badge-reward-name {
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

.kl-badge-reward-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.kl-badge-reward-progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.kl-badge-reward-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #a855f7 0%, #6366f1 100%);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.kl-badge-unlocked .kl-badge-reward-progress-fill {
    background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
}

.kl-badge-reward-progress-text {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    min-width: 60px;
    text-align: right;
}

.kl-badge-reward-amount {
    font-size: 1rem;
    font-weight: 600;
    color: #a855f7;
    white-space: nowrap;
}

.kl-badge-unlocked .kl-badge-reward-amount {
    color: #22c55e;
}

/* ================================================
   INFO - À QUOI SERVENT LES CRÉDITS
   ================================================ */

.kl-credits-info-section {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-color: rgba(59, 130, 246, 0.2);
}

.kl-credits-uses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.kl-credits-use-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.kl-credits-use-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.kl-credits-use-info strong {
    display: block;
    color: #fff;
    margin-bottom: 4px;
}

.kl-credits-use-info p {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.4;
}

/* ================================================
   RESPONSIVE
   ================================================ */

@media (max-width: 768px) {
    .kl-credits-balance-card {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .kl-credits-balance-header {
        flex-direction: column;
        gap: 10px;
    }

    .kl-credits-balance-amount {
        font-size: 2rem;
    }

    .kl-credits-buy-btn {
        width: 100%;
        justify-content: center;
    }

    .kl-credits-packs-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .kl-quest-item {
        flex-wrap: wrap;
    }

    .kl-quest-reward {
        width: 100%;
        text-align: right;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .kl-credits-uses-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .kl-credits-packs-grid {
        grid-template-columns: 1fr;
    }

    .kl-pack-amount {
        font-size: 1.1rem;
    }

    .kl-pack-price {
        font-size: 1.2rem;
    }
}

/* ================================================
   QUÊTE CLAIM BUTTON & ÉTATS
   ================================================ */

.kl-quest-claim-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.kl-quest-claim-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
}

.kl-quest-claim-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.kl-quest-claimed {
    color: #22c55e;
    font-weight: 600;
    font-size: 0.9rem;
}

/* ================================================
   NOTIFICATIONS TOAST
   ================================================ */

.kl-credits-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.95rem;
    z-index: 10000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.kl-credits-notification.kl-notif-visible {
    transform: translateY(0);
    opacity: 1;
}

.kl-notif-success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
}

.kl-notif-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
}

.kl-notif-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
}

/* ================================================
   MODALE SUCCÈS PAIEMENT
   ================================================ */

.kl-payment-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.kl-payment-modal-overlay.kl-modal-visible {
    opacity: 1;
    visibility: visible;
}

.kl-payment-modal {
    position: relative;
    max-width: 420px;
    width: 90%;
    transform: scale(0.8) translateY(20px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.kl-modal-visible .kl-payment-modal {
    transform: scale(1) translateY(0);
}

.kl-payment-modal-content {
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 24px;
    padding: 40px 35px;
    text-align: center;
    border: 2px solid rgba(251, 191, 36, 0.3);
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.5),
        0 0 60px rgba(251, 191, 36, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.kl-payment-modal-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: kl-icon-bounce 0.6s ease-out 0.2s both;
}

@keyframes kl-icon-bounce {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.kl-payment-modal-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 10px 0;
    animation: kl-fade-up 0.5s ease-out 0.3s both;
}

.kl-payment-modal-text {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 30px 0;
    animation: kl-fade-up 0.5s ease-out 0.4s both;
}

@keyframes kl-fade-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.kl-payment-modal-credits {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 25px;
    background: rgba(251, 191, 36, 0.1);
    border: 2px solid rgba(251, 191, 36, 0.3);
    border-radius: 16px;
    margin-bottom: 30px;
    animation: kl-fade-up 0.5s ease-out 0.5s both;
}

.kl-payment-modal-credits-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.kl-payment-modal-credits-amount {
    font-size: 3.5rem;
    font-weight: 800;
    color: #fbbf24;
    line-height: 1;
    text-shadow: 0 4px 20px rgba(251, 191, 36, 0.4);
}

.kl-payment-modal-credits-amount.kl-credits-pulse {
    animation: kl-credits-pulse 0.5s ease-out;
}

@keyframes kl-credits-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.kl-payment-modal-credits-unit {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.kl-payment-modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 40px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #1a1a2e;
    font-weight: 700;
    font-size: 1.1rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(251, 191, 36, 0.3);
    animation: kl-fade-up 0.5s ease-out 0.6s both;
}

.kl-payment-modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(251, 191, 36, 0.4);
}

.kl-payment-modal-btn:active {
    transform: translateY(0);
}

/* ================================================
   CONFETTIS
   ================================================ */

.kl-payment-confetti {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.kl-confetti-piece {
    position: absolute;
    top: -10px;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    animation: kl-confetti-fall linear forwards;
    opacity: 0;
}

@keyframes kl-confetti-fall {
    0% {
        opacity: 1;
        transform: translateY(0) rotate(0deg) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(400px) rotate(720deg) scale(0.5);
    }
}

/* Variations de confettis */
.kl-confetti-piece:nth-child(odd) {
    width: 8px;
    height: 12px;
    border-radius: 50%;
}

.kl-confetti-piece:nth-child(3n) {
    width: 6px;
    height: 6px;
}

/* ================================================
   RESPONSIVE MODALE
   ================================================ */

@media (max-width: 480px) {
    .kl-payment-modal-content {
        padding: 30px 25px;
    }

    .kl-payment-modal-icon {
        font-size: 3rem;
    }

    .kl-payment-modal-title {
        font-size: 1.5rem;
    }

    .kl-payment-modal-credits-amount {
        font-size: 2.5rem;
    }

    .kl-payment-modal-btn {
        width: 100%;
        padding: 14px 30px;
    }
}
