/* Credit Management Pages Styles */
.test-container,
.purchase-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.current-credits {
    text-align: center;
    padding: 2rem;
    background: var(--background);
    border-radius: var(--radius);
    margin-bottom: 2rem;
    font-size: 1.25rem;
    font-weight: 500;
}

.credits-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: block;
    margin-top: 0.5rem;
}

.credit-packages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.package-card {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.package-card:hover,
.package-card.selected {
    border-color: var(--primary-color);
    background-color: #eff6ff;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.package-credits {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.package-label {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 1rem;
}

.package-price {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.package-details {
    font-size: 0.875rem;
    color: #64748b;
}

.add-credits-btn {
    width: 100%;
    padding: 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 1rem;
}

.add-credits-btn:hover:not(:disabled) {
    background-color: var(--primary-hover);
}

.add-credits-btn:disabled {
    background-color: #94a3b8;
    cursor: not-allowed;
}

.use-credits-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border);
}

.use-credits-section h2 {
    margin-bottom: 1.5rem;
    color: var(--text);
}

.credits-input-group {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.credits-input-wrapper {
    flex: 1;
}

.credits-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text);
}

.credits-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.credits-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.use-credits-btn {
    margin-top: 0;
    flex-shrink: 0;
    width: auto;
    min-width: 150px;
}

.message {
    padding: 1rem;
    border-radius: var(--radius);
    margin-top: 1rem;
    text-align: center;
    display: none;
}

.message.show {
    display: block;
}

.message.success {
    background-color: #dcfce7;
    color: #166534;
}

.message.error {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Transaction History Styles */
.transaction-history {
    margin-top: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.transaction-history h2 {
    margin-bottom: 1.5rem;
    color: var(--text);
}

.transaction-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.transaction-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: background-color 0.2s;
}

.transaction-item:hover {
    background-color: var(--background);
}

.transaction-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 1rem;
    flex-shrink: 0;
}

.transaction-icon.addition,
.transaction-icon.test_addition {
    background-color: #dcfce7;
    color: #166534;
}

.transaction-icon.usage {
    background-color: #fee2e2;
    color: #991b1b;
}

.transaction-icon.processing {
    background-color: #dbeafe;
    color: #1e40af;
}

.transaction-icon.default {
    background-color: var(--background);
    color: #64748b;
}

.transaction-details {
    flex: 1;
}

.transaction-type {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.transaction-info {
    color: #64748b;
    font-size: 0.875rem;
}

.transaction-info span+span {
    margin-left: 0.5rem;
}

.transaction-amount {
    font-weight: 600;
    margin-left: 1rem;
    font-size: 1.125rem;
}

.transaction-amount.addition,
.transaction-amount.test_addition {
    color: #166534;
}

.transaction-amount.usage {
    color: #991b1b;
}

.transaction-amount.processing {
    color: #1e40af;
}

.transaction-amount.default {
    color: #64748b;
}

.loading-transactions {
    text-align: center;
    color: #64748b;
    padding: 2rem;
}

/* Transactions Table */
.transactions-container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 1rem;
}

.transactions-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

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

.transactions-table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

.transactions-table tr:hover {
    background-color: var(--background);
}

.transaction-type.purchase {
    background-color: #dcfce7;
    color: #166534;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.transaction-type.usage {
    background-color: #fee2e2;
    color: #991b1b;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #64748b;
}

/* Credits Display Styles */
.credits-display {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background: var(--background);
    border-radius: var(--radius);
}

.credits-amount {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.credits-actions {
    display: grid;
    gap: 1rem;
    margin-top: 2rem;
}

.navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    gap: 1rem;
}

.button.secondary {
    background-color: white;
    border: 1px solid var(--border);
    color: var(--text);
}

.button.secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: var(--background);
}

/* Payment Form Styles */
#payment-form {
    margin-top: 2rem;
}

#card-element {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    background: white;
}

.purchase-btn {
    width: 100%;
    padding: 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.purchase-btn:hover:not(:disabled) {
    background-color: var(--primary-hover);
}

.purchase-btn:disabled {
    background-color: #94a3b8;
    cursor: not-allowed;
}

#payment-message {
    margin-top: 1rem;
}