/* ============================================
   CREDIT SYSTEM - FRONTEND STYLES
   ============================================ */

/* Credit Balance Display in Navbar */
.credits-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: #1a1a1a;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    font-size: 14px;
    margin-right: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #333;
}

.credits-display:hover {
    background: #000;
    border-color: #555;
    transform: translateY(-1px);
}

.credits-icon {
    display: none;
    /* Hidden per user request */
    font-size: 18px;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.credits-balance {
    font-size: 16px;
    font-weight: 700;
}

.credits-balance::before {
    content: 'Crédits: ';
    font-weight: 500;
    opacity: 0.8;
    margin-right: 4px;
}

.credits-limit {
    opacity: 0.8;
    font-size: 13px;
}

.credits-low {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.credits-empty {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    animation: shake 0.5s;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* Insufficient Credits Modal */
.credits-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.credits-modal.show {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.credits-modal-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    text-align: center;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.credits-modal-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.credits-modal h2 {
    color: #1a1a1a;
    margin-bottom: 16px;
    font-size: 28px;
}

.credits-modal p {
    color: #666;
    margin-bottom: 12px;
    font-size: 16px;
    line-height: 1.6;
}

.credits-modal .credit-info {
    background: #f3f4f6;
    padding: 20px;
    border-radius: 12px;
    margin: 24px 0;
}

.credits-modal .credit-info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 15px;
}

.credits-modal .credit-info-row:last-child {
    margin-bottom: 0;
    padding-top: 12px;
    border-top: 2px solid #e5e7eb;
    font-weight: 700;
    color: #dc2626;
}

.credits-modal .modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.credits-modal .btn-upgrade {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.credits-modal .btn-upgrade:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.credits-modal .btn-cancel {
    flex: 1;
    background: #f3f4f6;
    color: #666;
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.credits-modal .btn-cancel:hover {
    background: #e5e7eb;
}

/* Credit Cost Badge */
.credit-cost {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    margin-left: 4px;
    opacity: 0.9;
}

.credit-cost-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f3f4f6;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    margin-left: 8px;
}

.credit-cost-badge .cost-icon {
    font-size: 14px;
}

/* Button with credit cost */
.btn-with-cost {
    position: relative;
}

.btn-with-cost::after {
    content: attr(data-cost) ' crédits';
    position: absolute;
    top: -8px;
    right: -8px;
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .credits-display {
        padding: 8px 14px;
        font-size: 13px;
        margin-right: 12px;
        gap: 6px;
    }

    .credits-balance {
        font-size: 14px;
    }

    .credits-balance::before {
        content: 'Crédits: ';
    }

    .credits-limit {
        font-size: 12px;
    }

    .credits-modal-content {
        padding: 30px 20px;
    }

    .credits-modal h2 {
        font-size: 24px;
    }

    .credits-modal .modal-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .credits-display {
        padding: 6px 10px;
        font-size: 12px;
        margin-right: 8px;
    }

    .credits-balance {
        font-size: 13px;
    }

    .credits-balance::before {
        content: 'C: ';
        /* Shortened for mobile */
    }

    .credits-limit {
        font-size: 11px;
    }
}