/**
 * LatePoint Credits - Frontend Styles
 */

/* Compact Single Line Credits Display */
.lpc-credits-line {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 15px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
}

.lpc-credits-line i {
    color: #6366f1;
    font-size: 16px;
}

.lpc-credits-label {
    color: #64748b;
    font-weight: 500;
}

.lpc-credits-balance {
    font-weight: 700;
    color: #1f2937;
}

.lpc-credits-balance.lpc-has-credits {
    color: #10b981;
}

.lpc-credits-balance.lpc-no-credits {
    color: #9ca3af;
}

/* Dashboard Widget (Full - kept for compatibility) */
.lpc-dashboard-widget {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.lpc-widget-header {
    padding: 18px 20px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
}

.lpc-widget-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lpc-widget-header i {
    font-size: 18px;
}

.lpc-widget-content {
    padding: 20px;
}

/* Balance Card */
.lpc-balance-card {
    text-align: center;
    padding: 25px;
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-radius: 10px;
    margin-bottom: 20px;
}

.lpc-balance-label {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
}

.lpc-balance-amount {
    font-size: 36px;
    font-weight: 700;
    color: #1f2937;
}

.lpc-balance-amount.lpc-has-credits {
    color: #10b981;
}

.lpc-balance-amount.lpc-no-credits {
    color: #9ca3af;
}

.lpc-balance-note {
    font-size: 12px;
    color: #6b7280;
    margin-top: 10px;
}

/* Transactions List */
.lpc-widget-history h4 {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 15px 0;
    font-weight: 500;
}

.lpc-transactions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lpc-transaction-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
    transition: background 0.15s;
}

.lpc-transaction-item:hover {
    background: #f3f4f6;
}

.lpc-transaction-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.lpc-item-credit .lpc-transaction-icon {
    background: #d1fae5;
    color: #10b981;
}

.lpc-item-debit .lpc-transaction-icon {
    background: #fee2e2;
    color: #ef4444;
}

.lpc-transaction-details {
    flex: 1;
}

.lpc-transaction-type {
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
}

.lpc-transaction-date {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 2px;
}

.lpc-transaction-amount {
    font-weight: 600;
    font-size: 15px;
}

.lpc-transaction-amount.lpc-positive {
    color: #10b981;
}

.lpc-transaction-amount.lpc-positive::before {
    content: '+';
}

.lpc-transaction-amount.lpc-negative {
    color: #ef4444;
}

.lpc-view-all-history {
    margin-top: 15px;
}

.lpc-no-history {
    text-align: center;
    padding: 20px;
    color: #9ca3af;
}

/* Remaining credits on booking confirmation */
.lpc-confirmation-credits {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    margin-top: 12px;
    background: #f0fdf4;
    border-radius: 8px;
    font-size: 14px;
}

.lpc-confirmation-credits i {
    color: #10b981;
    font-size: 16px;
}

.lpc-confirmation-credits-label {
    color: #6b7280;
    font-weight: 500;
}

.lpc-confirmation-credits-value {
    font-weight: 700;
    font-size: 15px;
}

.lpc-confirmation-credits-value.lpc-has-credits {
    color: #10b981;
}

.lpc-confirmation-credits-value.lpc-no-credits {
    color: #9ca3af;
}

/* Summary panel credits (side panel during booking flow) */
.lpc-summary-credits {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 20px 15px 10px 15px;
    margin-top: 10px;
    background: #f0fdf4;
    border-radius: 8px;
    font-size: 13px;
}

.lpc-summary-credits i {
    color: #10b981;
    font-size: 15px;
}

.lpc-summary-credits-label {
    color: #6b7280;
    font-weight: 500;
}

.lpc-summary-credits-value {
    font-weight: 700;
    color: #10b981;
    margin-left: auto;
}

/* Price Breakdown Credit Row */
.latepoint-price-breakdown .credit-discount,
.os-price-breakdown .credit-discount {
    color: #10b981;
}

.latepoint-price-breakdown .credit-discount .lp-price-breakdown-value,
.os-price-breakdown .credit-discount .os-price-breakdown-value {
    color: #10b981;
    font-weight: 600;
}

/* Customer Credits Full Page */
.lpc-customer-credits-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.lpc-page-header {
    margin-bottom: 25px;
}

.lpc-page-header h2 {
    margin: 0;
    font-size: 24px;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lpc-page-header i {
    color: #6366f1;
}

.lpc-balance-section {
    margin-bottom: 30px;
}

.lpc-balance-card-large {
    text-align: center;
    padding: 40px 30px;
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-radius: 16px;
}

.lpc-balance-amount-large {
    font-size: 48px;
    font-weight: 700;
    color: #9ca3af;
    margin: 15px 0;
}

.lpc-balance-amount-large.lpc-has-credits {
    color: #10b981;
}

.lpc-balance-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    color: #6b7280;
}

.lpc-balance-info i {
    color: #6366f1;
}

.lpc-history-section h3 {
    font-size: 18px;
    color: #1f2937;
    margin: 0 0 20px 0;
}

/* History List */
.lpc-history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lpc-history-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.15s;
}

.lpc-history-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.lpc-history-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.lpc-history-credit .lpc-history-icon {
    background: #d1fae5;
    color: #10b981;
}

.lpc-history-debit .lpc-history-icon {
    background: #fee2e2;
    color: #ef4444;
}

.lpc-history-info {
    flex: 1;
    min-width: 0;
}

.lpc-history-type {
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 3px;
}

.lpc-history-date {
    font-size: 13px;
    color: #9ca3af;
}

.lpc-history-notes {
    font-size: 12px;
    color: #6b7280;
    margin-top: 5px;
    font-style: italic;
}

.lpc-history-amounts {
    text-align: right;
    flex-shrink: 0;
}

.lpc-history-amount {
    font-weight: 600;
    font-size: 16px;
}

.lpc-history-amount.lpc-positive {
    color: #10b981;
}

.lpc-history-amount.lpc-positive::before {
    content: '+';
}

.lpc-history-amount.lpc-negative {
    color: #ef4444;
}

.lpc-history-balance {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 3px;
}

.lpc-load-more-wrapper {
    text-align: center;
    margin-top: 25px;
}

.lpc-load-more-btn .lpc-remaining {
    font-size: 12px;
    opacity: 0.7;
    margin-left: 5px;
}

.lpc-empty-history {
    text-align: center;
    padding: 50px 20px;
    background: #fff;
    border-radius: 12px;
}

.lpc-empty-icon {
    font-size: 48px;
    color: #d1d5db;
    margin-bottom: 15px;
}

.lpc-empty-history p {
    color: #6b7280;
    margin: 0;
}

.lpc-no-transactions {
    text-align: center;
    padding: 30px;
    color: #9ca3af;
}

/* Modal (Frontend) */
.lpc-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lpc-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.lpc-modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.lpc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
}

.lpc-modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.lpc-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.15s;
}

.lpc-modal-close:hover {
    color: #fff;
}

.lpc-modal-body {
    padding: 20px;
    overflow-y: auto;
}

/* Responsive */
@media (max-width: 600px) {
    .lpc-balance-amount-large {
        font-size: 36px;
    }

    .lpc-history-item {
        flex-wrap: wrap;
    }

    .lpc-history-amounts {
        width: 100%;
        text-align: left;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid #f3f4f6;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
}
