/**
 * Verification Credits - Frontend Styles
 */

/* Variables */
:root {
    --vc-primary: #2271b1;
    --vc-success: #00a32a;
    --vc-danger: #d63638;
    --vc-warning: #dba617;
    --vc-gray: #666;
    --vc-light: #f8f9fa;
    --vc-border: #dcdcde;
}

/* Container principal */
.vc-verify-form-container,
.vc-bulk-verify-container {
    max-width: 600px;
    margin: 0 auto;
}

/* Affichage du solde */
.vc-balance-display {
    background: var(--vc-light);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.vc-balance-label {
    color: var(--vc-gray);
    margin-right: 10px;
}

.vc-balance-value {
    font-size: 24px;
    font-weight: bold;
    color: var(--vc-primary);
}

.vc-balance-unit {
    color: var(--vc-gray);
    margin-left: 5px;
}

/* Tabs */
.vc-verify-tabs {
    display: flex;
    border-bottom: 2px solid var(--vc-border);
    margin-bottom: 20px;
}

.vc-tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 16px;
    color: var(--vc-gray);
    transition: all 0.2s;
    position: relative;
}

.vc-tab-btn:hover {
    color: var(--vc-primary);
}

.vc-tab-btn.active {
    color: var(--vc-primary);
    font-weight: 600;
}

.vc-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--vc-primary);
}

.vc-tab-btn .vc-cost {
    font-size: 12px;
    color: var(--vc-gray);
    margin-left: 5px;
}

/* Contenu des tabs */
.vc-tab-content {
    display: none;
}

.vc-tab-content.active {
    display: block;
}

/* Formulaire */
.vc-verify-form,
.vc-bulk-form {
    padding: 20px 0;
}

.vc-form-group {
    margin-bottom: 20px;
}

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

.vc-form-group input[type="email"],
.vc-form-group input[type="tel"],
.vc-form-group input[type="text"],
.vc-form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--vc-border);
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.vc-form-group input:focus,
.vc-form-group textarea:focus {
    border-color: var(--vc-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.vc-form-group textarea {
    resize: vertical;
    min-height: 150px;
    font-family: monospace;
}

/* Bouton submit */
.vc-submit-btn {
    width: 100%;
    padding: 15px 30px;
    background: var(--vc-primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.vc-submit-btn:hover:not(:disabled) {
    background: #135e96;
}

.vc-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Message crédits insuffisants */
.vc-insufficient-notice {
    text-align: center;
    color: var(--vc-danger);
    margin-top: 10px;
}

/* Loading */
.vc-loading {
    text-align: center;
    padding: 30px;
    color: var(--vc-gray);
}

.vc-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--vc-border);
    border-top-color: var(--vc-primary);
    border-radius: 50%;
    animation: vc-spin 0.8s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

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

/* Résultat */
.vc-result-container {
    margin-top: 30px;
    padding: 20px;
    border-radius: 8px;
    background: var(--vc-light);
}

.vc-result-container h4 {
    margin: 0 0 15px;
    color: #333;
}

.vc-result-content {
    padding: 15px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid var(--vc-border);
}

.vc-result-valid {
    border-left: 4px solid var(--vc-success);
}

.vc-result-invalid {
    border-left: 4px solid var(--vc-danger);
}

.vc-result-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.vc-result-item:last-child {
    border-bottom: none;
}

.vc-result-label {
    font-weight: 500;
    color: var(--vc-gray);
}

.vc-result-value {
    font-weight: 600;
}

.vc-result-value.valid { color: var(--vc-success); }
.vc-result-value.invalid { color: var(--vc-danger); }

/* Bulk verification */
.vc-bulk-info {
    background: var(--vc-light);
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.vc-bulk-info p {
    margin: 5px 0;
}

.vc-cost-per-item {
    font-size: 12px;
    color: var(--vc-gray);
}

/* Progress bar */
.vc-bulk-progress {
    margin: 20px 0;
}

.vc-progress-bar {
    height: 20px;
    background: #eee;
    border-radius: 10px;
    overflow: hidden;
}

.vc-progress-fill {
    height: 100%;
    background: var(--vc-primary);
    transition: width 0.3s;
}

.vc-progress-text {
    text-align: center;
    margin-top: 10px;
    color: var(--vc-gray);
}

/* Bulk results */
.vc-bulk-results {
    margin-top: 30px;
}

.vc-bulk-summary {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.vc-bulk-summary-item {
    padding: 15px;
    background: var(--vc-light);
    border-radius: 6px;
    text-align: center;
}

.vc-bulk-actions {
    margin-bottom: 15px;
}

.vc-bulk-results-table {
    width: 100%;
    border-collapse: collapse;
}

.vc-bulk-results-table th,
.vc-bulk-results-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid var(--vc-border);
}

.vc-bulk-results-table th {
    background: var(--vc-light);
    font-weight: 600;
}

/* Tableaux historique */
.vc-history-table {
    width: 100%;
    border-collapse: collapse;
}

.vc-history-table th,
.vc-history-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--vc-border);
}

.vc-history-table th {
    background: var(--vc-light);
    font-weight: 600;
    color: #333;
}

.vc-history-table tr:hover {
    background: #fafafa;
}

/* Badges */
.vc-type-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
}

.vc-type-email {
    background: #e3f2fd;
    color: #1565c0;
}

.vc-type-phone {
    background: #fff3e0;
    color: #e65100;
}

.vc-result-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.vc-result-badge.vc-result-valid {
    background: #d4edda;
    color: #155724;
}

.vc-result-badge.vc-result-invalid {
    background: #f8d7da;
    color: #721c24;
}

.vc-result-badge.vc-result-unknown {
    background: #e2e3e5;
    color: #383d41;
}

.vc-result-badge.vc-result-error {
    background: #fff3cd;
    color: #856404;
}

/* Export button */
.vc-export-btn {
    background: #fff;
    border: 1px solid var(--vc-border);
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.vc-export-btn:hover {
    background: var(--vc-light);
}

/* Credit packs */
.vc-buy-credits-container h4 {
    margin-bottom: 20px;
}

.vc-packs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.vc-pack-card {
    background: #fff;
    border: 1px solid var(--vc-border);
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    transition: box-shadow 0.2s;
}

.vc-pack-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.vc-pack-card h5 {
    margin: 0 0 10px;
    color: #333;
}

.vc-pack-units {
    font-size: 24px;
    font-weight: bold;
    color: var(--vc-primary);
    margin: 10px 0;
}

.vc-pack-price {
    color: var(--vc-gray);
    margin-bottom: 15px;
}

.vc-add-to-cart {
    width: 100%;
}

/* Custom price field */
.vc-custom-price-field {
    margin: 20px 0;
    padding: 20px;
    background: var(--vc-light);
    border-radius: 8px;
}

.vc-price-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.vc-currency {
    font-size: 18px;
    font-weight: bold;
}

.vc-conversion-info {
    font-size: 13px;
    color: var(--vc-gray);
    margin-top: 10px;
}

.vc-units-preview {
    margin-top: 10px;
    font-size: 16px;
}

/* Login required */
.vc-login-required {
    text-align: center;
    padding: 40px;
    background: var(--vc-light);
    border-radius: 8px;
}

/* Balance inline */
.vc-balance-inline {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Responsive */
@media (max-width: 600px) {
    .vc-verify-tabs {
        flex-direction: column;
    }
    
    .vc-tab-btn {
        border-bottom: 1px solid var(--vc-border);
    }
    
    .vc-tab-btn.active::after {
        display: none;
    }
    
    .vc-bulk-summary {
        flex-direction: column;
    }
    
    .vc-packs-grid {
        grid-template-columns: 1fr;
    }
    
    .vc-history-table {
        display: block;
        overflow-x: auto;
    }
}

/* ============================================
   MODAL ACHAT CREDITS
   ============================================ */
.vc-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.vc-modal {
    background: #fff;
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    animation: vcModalIn 0.3s ease;
}

@keyframes vcModalIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.vc-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.vc-modal-close:hover {
    color: #333;
    background: #f0f0f0;
}

.vc-modal h2 {
    margin: 0 0 25px;
    font-size: 24px;
    color: #1a1a2e;
    text-align: center;
}

.vc-modal-calculator {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 25px;
}

.vc-modal-calculator .vc-calc-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.vc-modal-calculator .vc-calc-input {
    flex: 1;
}

.vc-modal-calculator .vc-calc-input label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.vc-modal-calculator .vc-calc-input input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    transition: border-color 0.2s;
}

.vc-modal-calculator .vc-calc-input input:focus {
    border-color: #667eea;
    outline: none;
}

.vc-modal-calculator .vc-calc-equals {
    font-size: 24px;
    color: #999;
}

.vc-modal-calculator .vc-calc-result {
    text-align: center;
}

.vc-modal-calculator .vc-calc-result span {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #667eea;
}

.vc-modal-calculator .vc-calc-result small {
    color: #666;
    font-size: 13px;
}

.vc-modal-calculator .vc-calc-slider {
    margin-bottom: 25px;
}

.vc-modal-calculator .vc-calc-slider input[type="range"] {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    margin-bottom: 10px;
}

.vc-modal-calculator .vc-calc-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.vc-modal-calculator .vc-calc-marks {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #999;
}

.vc-modal-calculator .vc-volume-discounts {
    margin-bottom: 25px;
}

.vc-modal-calculator .vc-volume-discounts p {
    text-align: center;
    margin: 0 0 15px;
    font-size: 14px;
    color: #333;
}

.vc-modal-calculator .vc-discount-grid {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.vc-modal-calculator .vc-discount-item {
    background: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.vc-modal-calculator .vc-discount-item.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    transform: scale(1.05);
}

.vc-modal-calculator .vc-discount-amount {
    display: block;
    font-weight: 600;
    font-size: 14px;
}

.vc-modal-calculator .vc-discount-bonus {
    font-size: 12px;
    color: #22c55e;
}

.vc-modal-calculator .vc-discount-item.active .vc-discount-bonus {
    color: #fff;
}

.vc-modal-calculator .vc-btn-buy-now {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    border: none;
    padding: 16px 30px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

.vc-modal-calculator .vc-btn-buy-now:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

.vc-modal-calculator .vc-btn-buy-now #vc-modal-buy-amount {
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 6px;
}

.vc-modal-calculator .vc-buy-info {
    text-align: center;
    margin-top: 15px;
    font-size: 13px;
    color: #888;
}

/* Bouton Recharger dans le header */
.vc-btn-buy-credits {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-left: 15px;
}

.vc-btn-buy-credits:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

/* Ajustement header pour le bouton */
.vc-balance-box {
    display: flex;
    align-items: center;
    gap: 15px;
}

@media (max-width: 600px) {
    .vc-modal {
        padding: 20px;
        margin: 10px;
    }
    
    .vc-modal-calculator .vc-calc-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .vc-modal-calculator .vc-discount-grid {
        flex-direction: column;
    }
    
    .vc-btn-buy-credits {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
        justify-content: center;
    }
    
    .vc-balance-box {
        flex-wrap: wrap;
    }
}
