/* PPOB Frontend Styles */
.ppob-interface {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Balance Info */
.ppob-balance-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
}

.ppob-balance-info h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
}

.coin-balance {
    font-size: 24px;
    font-weight: bold;
}

.coin-balance small {
    display: block;
    font-size: 14px;
    opacity: 0.8;
    font-weight: normal;
}

/* Tabs */
.ppob-tabs {
    display: flex;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 20px;
    overflow-x: auto;
}

.ppob-tab {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    white-space: nowrap;
}

.ppob-tab:hover {
    background: rgba(0,0,0,0.05);
}

.ppob-tab.active {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    color: #007cba;
}

/* Tab Content */
.ppob-tab-content {
    display: none;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.ppob-tab-content.active {
    display: block;
}

/* Forms */
.ppob-form h4 {
    margin: 0 0 20px 0;
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #007cba;
}

.btn-check {
    width: 100%;
    margin-top: 10px;
    padding: 12px 20px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.btn-check:hover {
    background: #005a87;
}

/* Products Grid */
.ppob-products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.product-item {
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.product-item:hover {
    border-color: #007cba;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.product-item.selected {
    border-color: #007cba;
    background: #f0f8ff;
}

.product-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

.product-price {
    color: #007cba;
    font-weight: bold;
    font-size: 16px;
}

.product-coins {
    color: #666;
    font-size: 12px;
    margin-top: 4px;
}

/* Customer Info */
.customer-info {
    margin-top: 15px;
}

.info-box {
    background: #1e1e2e;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}

/* Buttons */
.btn-primary {
    background: #007cba;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.btn-primary:hover {
    background: #005a87;
}

.btn-cancel {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    margin-right: 10px;
}

.btn-confirm {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

/* Transaction History */
.ppob-history {
    margin-top: 30px;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.ppob-history h4 {
    margin: 0 0 20px 0;
    color: #333;
}

.transaction-item {
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 12px;
    transition: box-shadow 0.3s ease;
}

.transaction-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.transaction-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 10px;
}

.transaction-title {
    flex: 1;
}

.transaction-title strong {
    color: #333;
}

.transaction-type {
    background: #e9ecef;
    color: #495057;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 8px;
}

.transaction-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-success { background: #d4edda; color: #155724; }
.status-failed { background: #f8d7da; color: #721c24; }
.status-pending { background: #fff3cd; color: #856404; }
.status-processing { background: #d1ecf1; color: #0c5460; }

.transaction-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
    font-size: 13px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
}

.detail-row span:first-child {
    color: #666;
}

.detail-row span:last-child {
    color: #333;
    font-weight: 500;
}

/* Modal */
.ppob-modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #0f0f17;
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #333;
}

.modal-actions {
    text-align: right;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e1e5e9;
}

/* Loading & States */
.loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.ppob-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    margin: 10px 0;
}

.ppob-success {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 6px;
    margin: 10px 0;
}

.ppob-no-data {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

/* Balance Widget */
.ppob-balance-widget {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.balance-amount {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
}

.balance-rupiah {
    font-size: 14px;
    opacity: 0.8;
}

.valid-phone {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25) !important;
}

.invalid-phone {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

/* Phone input styling */
#pulsa-number, #data-number {
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

/* Phone input placeholder and helper text */
.phone-helper {
    font-size: 12px;
    color: #6c757d;
    margin-top: 4px;
}

.phone-helper.valid {
    color: #28a745;
}

.phone-helper.invalid {
    color: #dc3545;
}

/* Responsive */
@media (max-width: 768px) {
    .ppob-interface {
        padding: 15px;
    }
    
    .ppob-tabs {
        flex-direction: column;
    }
    
    .ppob-tab {
        text-align: center;
        margin-bottom: 2px;
    }
    
    .ppob-products {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 8px;
    }
    
    .transaction-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .transaction-status {
        margin-top: 8px;
    }
    
    .transaction-details {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 20px;
        width: calc(100% - 40px);
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.ppob-tab-content.active {
    animation: fadeIn 0.3s ease;
}

.transaction-item {
    animation: fadeIn 0.3s ease;
}

/* Custom Scrollbar */
.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}