/* ================================================================
   vouchers.css  –  Module 30: Credit Vouchers
   CSS namespace: .vch-*
   ================================================================ */

/* ── Rate banner ─────────────────────────────────────────────── */
.vch-rate-banner {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 10px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #a5b4fc;
    font-size: 0.875rem;
    margin-bottom: 20px;
}

.vch-rate-icon {
    font-size: 20px;
    flex-shrink: 0;
}

/* ── Top two-column grid ─────────────────────────────────────── */
.vch-top-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .vch-top-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Card ────────────────────────────────────────────────────── */
.vch-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 14px;
    padding: 24px;
}

.vch-card--full {
    width: 100%;
}

.vch-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.vch-card-icon {
    font-size: 22px;
    color: #6366f1;
}

.vch-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0;
    flex: 1;
}

.vch-card-sub {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0 0 20px;
    line-height: 1.5;
}

.vch-count-badge {
    background: rgba(99, 102, 241, 0.18);
    color: #818cf8;
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ── Quick amount buttons ────────────────────────────────────── */
.vch-quick-amounts {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.vch-amount-btn {
    flex: 1;
    min-width: 44px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 9px;
    color: #94a3b8;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 9px 6px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}

.vch-amount-btn:hover {
    border-color: #6366f1;
    color: #c7d2fe;
    background: rgba(99, 102, 241, 0.08);
}

.vch-amount-btn--active {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.16);
    color: #a5b4fc;
}

/* ── Field + Amount input ────────────────────────────────────── */
.vch-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.vch-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.vch-amount-input-wrap {
    display: flex;
    align-items: center;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.15s;
}

.vch-amount-input-wrap:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.vch-amount-prefix {
    padding: 0 12px;
    color: #64748b;
    font-size: 0.95rem;
    background: #1e293b;
    border-right: 1px solid #334155;
    height: 40px;
    display: flex;
    align-items: center;
}

.vch-amount-input {
    background: transparent;
    border: none;
    color: #e2e8f0;
    font-size: 0.9rem;
    padding: 0 12px;
    height: 40px;
    width: 100%;
    outline: none;
}

/* ── Credits preview ─────────────────────────────────────────── */
.vch-credits-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 9px;
    padding: 10px 14px;
    color: #a5b4fc;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.vch-credits-preview .material-symbols-outlined {
    font-size: 20px;
    color: #6366f1;
}

/* ── Purchase button ─────────────────────────────────────────── */
.vch-btn-purchase {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #6366f1;
    color: #fff;
    border: none;
    border-radius: 9px;
    padding: 11px 20px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    width: 100%;
}

.vch-btn-purchase:hover:not(:disabled) {
    background: #4f46e5;
}

.vch-btn-purchase:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ── Purchase success ────────────────────────────────────────── */
.vch-purchase-success {
    text-align: center;
    padding: 8px 0;
}

.vch-success-icon {
    width: 52px;
    height: 52px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}

.vch-success-icon .material-symbols-outlined {
    font-size: 26px;
    color: #22c55e;
}

.vch-success-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0 0 4px;
}

.vch-success-credits {
    font-size: 2rem;
    font-weight: 800;
    color: #22c55e;
    margin: 6px 0 2px;
}

.vch-success-amount {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0 0 18px;
}

/* ── Code block (generated voucher code) ────────────────────── */
.vch-code-block {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.vch-code-text {
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 1.15rem;
    font-weight: 700;
    color: #a5b4fc;
    letter-spacing: 0.12em;
}

.vch-copy-btn {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 7px;
    color: #818cf8;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}

.vch-copy-btn:hover {
    background: rgba(99, 102, 241, 0.22);
    color: #c7d2fe;
}

.vch-copy-btn .material-symbols-outlined {
    font-size: 17px;
}

.vch-code-hint {
    font-size: 0.75rem;
    color: #475569;
    margin: 0 0 16px;
}

/* ── "Purchase Another" / generic reset button ───────────────── */
.vch-btn-new {
    background: transparent;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 8px 18px;
    cursor: pointer;
    transition: all 0.15s;
    margin-top: 6px;
}

.vch-btn-new:hover {
    border-color: #6366f1;
    color: #c7d2fe;
}

/* ── Code input ──────────────────────────────────────────────── */
.vch-code-input {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #a5b4fc;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 1rem;
    letter-spacing: 0.1em;
    padding: 10px 14px;
    width: 100%;
    box-sizing: border-box;
    text-transform: uppercase;
    outline: none;
    transition: border-color 0.15s;
}

.vch-code-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.vch-code-input::placeholder {
    color: #334155;
    letter-spacing: 0.05em;
}

.vch-code-format-hint {
    font-size: 0.75rem;
    color: #475569;
}

/* ── Redeem button ───────────────────────────────────────────── */
.vch-btn-redeem {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #059669;
    color: #fff;
    border: none;
    border-radius: 9px;
    padding: 11px 20px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    width: 100%;
    margin-top: 6px;
}

.vch-btn-redeem:hover:not(:disabled) {
    background: #047857;
}

.vch-btn-redeem:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ── Redeem success ──────────────────────────────────────────── */
.vch-redeem-success {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 14px;
    color: #86efac;
}

.vch-redeem-check {
    font-size: 28px;
    color: #22c55e;
    flex-shrink: 0;
}

.vch-redeem-desc {
    font-size: 0.8rem;
    color: #64748b;
    margin: 4px 0 0;
}

/* ── Error banner ────────────────────────────────────────────── */
.vch-error-banner {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #f87171;
    font-size: 0.875rem;
    margin-bottom: 16px;
}

.vch-error-banner .material-symbols-outlined {
    font-size: 18px;
    flex-shrink: 0;
}

/* ── Table ───────────────────────────────────────────────────── */
.vch-table-wrap {
    overflow-x: auto;
    margin-top: 8px;
}

.vch-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.vch-table th {
    text-align: left;
    padding: 10px 14px;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid #334155;
    white-space: nowrap;
}

.vch-table td {
    padding: 12px 14px;
    color: #cbd5e1;
    border-bottom: 1px solid #1e293b;
    vertical-align: middle;
}

.vch-row:last-child td {
    border-bottom: none;
}

.vch-row:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* ── Code cell (table) ───────────────────────────────────────── */
.vch-code-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vch-code-value {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.8rem;
    color: #a5b4fc;
    letter-spacing: 0.08em;
}

.vch-copy-sm {
    background: transparent;
    border: none;
    color: #475569;
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    transition: color 0.12s;
}

.vch-copy-sm:hover {
    color: #818cf8;
}

.vch-copy-sm .material-symbols-outlined {
    font-size: 15px;
}

.vch-credits-cell {
    font-weight: 700;
    color: #a5b4fc;
}

.vch-date-cell {
    color: #64748b;
    font-size: 0.8rem;
    white-space: nowrap;
}

/* ── Status badges ───────────────────────────────────────────── */
.vch-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.vch-status--active { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.vch-status--redeemed { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.vch-status--expired { background: rgba(239, 68, 68, 0.12); color: #f87171; }
.vch-status--cancelled { background: rgba(100, 116, 139, 0.15); color: #94a3b8; }

/* ── Loading ─────────────────────────────────────────────────── */
.vch-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 0;
    color: #64748b;
    font-size: 0.875rem;
}

/* ── Empty state ─────────────────────────────────────────────── */
.vch-empty {
    text-align: center;
    padding: 48px 0;
    color: #475569;
}

.vch-empty-icon {
    font-size: 52px;
    color: #1e293b;
    display: block;
    margin-bottom: 12px;
}

.vch-empty p {
    font-size: 0.875rem;
    margin: 0;
}

/* ── Pagination ──────────────────────────────────────────────── */
.vch-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #1e293b;
}

.vch-page-btn {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #94a3b8;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
}

.vch-page-btn:hover:not(:disabled) {
    background: #334155;
    color: #e2e8f0;
}

.vch-page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.vch-page-info {
    font-size: 0.825rem;
    color: #94a3b8;
}

/* ── Spinner ─────────────────────────────────────────────────── */
.vch-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: vch-spin 0.6s linear infinite;
    display: inline-block;
}

@keyframes vch-spin {
    to { transform: rotate(360deg); }
}
