/**
 * AHIT Wallet & Membership Frontend Styles
 *
 * @package AHIT\Wallet
 */

/* ==========================================================================
   Wallet Dashboard
   ========================================================================== */

.ahit-wallet-dashboard {
    max-width: 1200px;
    margin: 0 auto;
}

.wallet-section {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.wallet-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2em;
    font-weight: 600;
}

/* ==========================================================================
   Balance Cards
   ========================================================================== */

.wallet-balance-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    margin-bottom: 30px;
}

.wallet-balance-section h3 {
    color: white;
    margin-bottom: 20px;
}

.balance-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 15px;
}

.balance-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.balance-label {
    font-size: 0.9em;
    opacity: 0.8;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.balance-amount {
    font-size: 2em;
    font-weight: bold;
    line-height: 1.2;
}

.balance-note {
    text-align: center;
    opacity: 0.8;
}

/* ==========================================================================
   Membership Level
   ========================================================================== */

.membership-section {
    background: #f8f9fa;
    border-left: 4px solid #28a745;
}

.membership-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e9ecef;
}

.level-name {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
}

.level-bronze .level-name { color: #cd7f32; }
.level-silver .level-name { color: #c0c0c0; }
.level-gold .level-name { color: #ffd700; }

.benefits-list {
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
}

.benefits-list li {
    padding: 5px 0;
    position: relative;
    padding-left: 20px;
}

.benefits-list li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
}

.discount-info,
.bonus-info {
    display: inline-block;
    background: #e8f5e8;
    color: #155724;
    padding: 5px 10px;
    border-radius: 4px;
    margin-right: 10px;
    font-size: 0.9em;
}

.bonus-info {
    background: #fff3cd;
    color: #856404;
}

/* ==========================================================================
   Quick Actions
   ========================================================================== */

.wallet-actions {
    text-align: center;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.action-buttons .button {
    min-width: 150px;
    padding: 12px 24px;
    font-size: 1em;
}

/* ==========================================================================
   Topup Form
   ========================================================================== */

.ahit-wallet-topup-form {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.bonus-info {
    background: #d1ecf1;
    color: #0c5460;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
}

.preset-amounts {
    margin-bottom: 20px;
}

.preset-amounts label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
}

.preset-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.preset-amount {
    background: white;
    border: 2px solid #ddd;
    border-radius: 6px;
    padding: 10px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.preset-amount:hover {
    border-color: #007cba;
    background: #f0f8ff;
}

.preset-amount.selected {
    border-color: #007cba;
    background: #007cba;
    color: white;
}

.amount-input {
    margin-bottom: 20px;
}

.amount-input label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.amount-input input {
    width: 100%;
    max-width: 200px;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1.1em;
}

.amount-limits {
    display: block;
    margin-top: 5px;
    color: #666;
}

.bonus-preview {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.bonus-calculation {
    display: grid;
    gap: 10px;
}

.bonus-calculation > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bonus-calculation .label {
    font-weight: 500;
}

.bonus-calculation .value {
    font-weight: 600;
    color: #007cba;
}

.total-credits-display {
    border-top: 1px solid #eee;
    padding-top: 10px;
    margin-top: 5px;
}

.gateway-selection {
    margin-bottom: 20px;
}

.gateway-selection label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.gateway-selection select {
    width: 100%;
    max-width: 300px;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 4px;
}

/* ==========================================================================
   Transactions Table
   ========================================================================== */

.transactions-table-wrapper {
    overflow-x: auto;
    margin-bottom: 20px;
}

.transactions-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.transactions-table th,
.transactions-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.transactions-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.transactions-table tr:hover {
    background: #f8f9fa;
}

.type-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
}

.type-deposit { background: #d4edda; color: #155724; }
.type-spend { background: #f8d7da; color: #721c24; }
.type-refund { background: #d1ecf1; color: #0c5460; }
.type-bonus { background: #fff3cd; color: #856404; }
.type-adjust { background: #e2e3e5; color: #383d41; }
.type-expiry { background: #f5c6cb; color: #721c24; }

.amount.positive {
    color: #28a745;
    font-weight: 600;
}

.amount.negative {
    color: #dc3545;
    font-weight: 600;
}

.view-all-transactions {
    text-align: center;
}

.no-transactions {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

/* ==========================================================================
   Topups List
   ========================================================================== */

.topups-list {
    display: grid;
    gap: 15px;
}

.topup-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
}

.topup-info {
    flex: 1;
}

.topup-amount {
    font-size: 1.1em;
    margin-bottom: 5px;
}

.topup-amount strong {
    color: #333;
}

.topup-amount small {
    color: #666;
    margin-left: 10px;
}

.topup-date {
    color: #666;
    font-size: 0.9em;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
}

.view-all-topups {
    text-align: center;
}

.status-completed { background: #d4edda; color: #155724; }
.status-pending { background: #fff3cd; color: #856404; }
.status-failed { background: #f8d7da; color: #721c24; }
.status-cancelled { background: #e2e3e5; color: #383d41; }

/* ==========================================================================
   Wallet Payment Gateway
   ========================================================================== */

.ahit-wallet-payment-fields {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
    margin: 10px 0;
}

.wallet-balance {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 15px;
}

.wallet-full-payment,
.wallet-partial-payment {
    margin-bottom: 10px;
}

.wallet-full-payment input,
.wallet-partial-payment input {
    margin-right: 8px;
}

.wallet-full-payment label,
.wallet-partial-payment label {
    cursor: pointer;
    font-weight: 500;
}

/* ==========================================================================
   Shortcodes
   ========================================================================== */

.ahit-wallet-balance-shortcode {
    display: inline-block;
}

.balance-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.balance-info > div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.balance-info label {
    font-weight: 600;
    min-width: 100px;
}

.ahit-wallet-login-required {
    background: #fff3cd;
    color: #856404;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #ffeaa7;
    text-align: center;
}

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

@media (max-width: 768px) {
    .balance-cards {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .preset-buttons {
        justify-content: center;
    }
    
    .topup-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .transactions-table {
        font-size: 0.9em;
    }
    
    .transactions-table th,
    .transactions-table td {
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .wallet-section {
        padding: 15px;
    }
    
    .balance-amount {
        font-size: 1.5em;
    }
    
    .preset-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .bonus-calculation > div {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}
