/**
 * Payments CSS - Styles pour le Système de Paiement
 * Support: Cards, PayPal, Mobile Money, Virement, COD, Crypto
 */

/* ==================== Payment Methods Grid ==================== */

#payment-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

/* ==================== Payment Method Card ==================== */

.payment-method-card {
    position: relative;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    background: white;
}

.payment-method-card:hover {
    border-color: #d4af37;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
    transform: translateY(-2px);
}

.payment-method-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.payment-method-card input[type="radio"]:checked + label {
    background: linear-gradient(135deg, #fdfbf7 0%, #fef9ee 100%);
    border-left: 4px solid #d4af37;
}

.payment-method-card label {
    display: flex;
    align-items: center;
    padding: 20px;
    cursor: pointer;
    gap: 16px;
    transition: all 0.3s ease;
}

.payment-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f5f5 0%, #e9e9e9 100%);
    border-radius: 50%;
    font-size: 28px;
    color: #333;
    transition: all 0.3s ease;
}

.payment-method-card:hover .payment-icon {
    background: linear-gradient(135deg, #d4af37 0%, #c19d2f 100%);
    color: white;
    transform: rotate(5deg) scale(1.05);
}

.payment-method-card input[type="radio"]:checked + label .payment-icon {
    background: linear-gradient(135deg, #d4af37 0%, #c19d2f 100%);
    color: white;
}

.payment-info {
    flex: 1;
}

.payment-info h4 {
    margin: 0 0 6px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.payment-info p {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.payment-fee {
    display: inline-block;
    margin-top: 6px;
    padding: 4px 10px;
    background: #fff3cd;
    color: #856404;
    font-size: 12px;
    border-radius: 12px;
    font-weight: 500;
}

/* ==================== Payment Forms ==================== */

#payment-form-container {
    margin: 30px 0;
    min-height: 200px;
}

.payment-form {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 30px;
    animation: slideDown 0.4s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.payment-form h4 {
    margin: 0 0 24px 0;
    font-size: 20px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.payment-form h4::before {
    content: '';
    width: 4px;
    height: 24px;
    background: #d4af37;
    border-radius: 2px;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.form-group input::placeholder {
    color: #999;
}

/* ==================== Card Number Formatting ==================== */

#card-number {
    letter-spacing: 2px;
    font-family: 'Courier New', monospace;
}

#card-cvv {
    letter-spacing: 2px;
    font-family: 'Courier New', monospace;
}

/* ==================== Bank Details ==================== */

.bank-details {
    background: #f8f9fa;
    border: 2px dashed #d4af37;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.bank-details p {
    margin: 8px 0;
    font-size: 14px;
    color: #333;
}

.bank-details strong {
    color: #d4af37;
    min-width: 120px;
    display: inline-block;
}

/* ==================== COD Info ==================== */

.cod-info {
    display: flex;
    align-items: start;
    gap: 16px;
    background: #e7f3ff;
    border-left: 4px solid #0066cc;
    padding: 20px;
    border-radius: 8px;
}

.cod-info i {
    font-size: 24px;
    color: #0066cc;
    margin-top: 2px;
}

.cod-info p {
    margin: 0;
    font-size: 14px;
    color: #333;
    line-height: 1.6;
}

/* ==================== Crypto Address ==================== */

#crypto-address {
    margin-top: 16px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #d4af37;
}

#crypto-address code {
    display: block;
    padding: 12px;
    background: white;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    word-break: break-all;
    color: #d4af37;
    margin-top: 8px;
}

/* ==================== Help Text ==================== */

.help-text {
    margin-top: 16px;
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #d4af37;
}

/* ==================== PayPal Button ==================== */

.paypal-button {
    margin-top: 20px;
}

#paypal-button-container {
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #0070ba;
}

/* ==================== Mobile Money Providers ==================== */

#mobile-provider {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

/* ==================== Payment Summary ==================== */

.payment-summary {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 24px;
    position: sticky;
    top: 20px;
}

.payment-summary h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: #333;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f0;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    font-size: 15px;
    color: #666;
}

.summary-line:not(:last-child) {
    border-bottom: 1px solid #f0f0f0;
}

#payment-fee {
    color: #856404;
}

#grand-total {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 2px solid #d4af37;
    font-size: 18px;
}

.total-price {
    color: #d4af37;
    font-weight: 700;
}

/* ==================== Payment Processing ==================== */

.payment-processing {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.processing-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    max-width: 400px;
}

.processing-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f0f0f0;
    border-top-color: #d4af37;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.processing-content h3 {
    margin: 0 0 10px 0;
    color: #333;
}

.processing-content p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* ==================== Payment Success/Error ==================== */

.payment-result {
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    animation: slideDown 0.5s ease;
}

.payment-result.success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 2px solid #28a745;
}

.payment-result.error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 2px solid #dc3545;
}

.payment-result i {
    font-size: 64px;
    margin-bottom: 20px;
}

.payment-result.success i {
    color: #28a745;
}

.payment-result.error i {
    color: #dc3545;
}

.payment-result h3 {
    margin: 0 0 12px 0;
    font-size: 24px;
}

.payment-result p {
    margin: 0;
    font-size: 16px;
    color: #666;
}

.transaction-id {
    display: inline-block;
    margin-top: 16px;
    padding: 10px 20px;
    background: white;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

/* ==================== Responsive ==================== */

@media (max-width: 768px) {
    #payment-methods {
        grid-template-columns: 1fr;
    }
    
    .payment-method-card label {
        padding: 16px;
    }
    
    .payment-icon {
        width: 48px;
        height: 48px;
        font-size: 24px;
    }
    
    .payment-info h4 {
        font-size: 16px;
    }
    
    .payment-info p {
        font-size: 13px;
    }
    
    .payment-form {
        padding: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .payment-summary {
        position: static;
        margin-top: 30px;
    }
}

/* ==================== Admin Payment Settings ==================== */

.payment-method-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.payment-method-toggle:hover {
    border-color: #d4af37;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.payment-method-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.payment-method-info i {
    font-size: 32px;
    color: #666;
}

.payment-method-info h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    color: #333;
}

.payment-method-info p {
    margin: 0;
    font-size: 13px;
    color: #666;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 60px;
    height: 32px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ccc;
    border-radius: 32px;
    transition: 0.3s;
}

.toggle-slider:before {
    content: '';
    position: absolute;
    height: 24px;
    width: 24px;
    left: 4px;
    bottom: 4px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background: #28a745;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(28px);
}

/* ==================== Config Form ==================== */

.payment-config {
    margin-top: 16px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #d4af37;
}

.config-field {
    margin-bottom: 16px;
}

.config-field:last-child {
    margin-bottom: 0;
}

.config-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.config-field input,
.config-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.config-field textarea {
    resize: vertical;
    min-height: 80px;
}

.save-config-btn {
    margin-top: 12px;
    padding: 8px 20px;
    background: #d4af37;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.save-config-btn:hover {
    background: #c19d2f;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(212, 175, 55, 0.3);
}

/* ==================== Transaction History ==================== */

.transaction-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.transaction-item:hover {
    border-color: #d4af37;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.transaction-details {
    flex: 1;
}

.transaction-id-badge {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #666;
    font-weight: 600;
}

.transaction-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 12px;
}

.transaction-status.pending {
    background: #fff3cd;
    color: #856404;
}

.transaction-status.completed {
    background: #d4edda;
    color: #155724;
}

.transaction-status.failed {
    background: #f8d7da;
    color: #721c24;
}

.transaction-status.cancelled {
    background: #e2e3e5;
    color: #383d41;
}
