/**
 * WooCommerce Metered Billing - My Account Styles
 */

/* General Styles */
.wmb-meter-usage,
.wmb-billing,
.wmb-auto-pay {
    max-width: 1200px;
}

.wmb-card,
.wmb-info-card,
.wmb-balance-card,
.wmb-summary-card {
    background: #ffffff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Usage Overview */
.wmb-usage-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.wmb-card h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

.wmb-value {
    font-size: 36px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 8px;
    line-height: 1;
}

.wmb-unit {
    font-size: 14px;
    color: #666;
    font-weight: normal;
    margin-left: 8px;
}

.wmb-date,
.wmb-comparison,
.wmb-confidence {
    font-size: 14px;
    color: #666;
    margin-top: 8px;
}

.wmb-status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.wmb-under-base {
    background: #e8f5e8;
    color: #2e7d32;
}

.wmb-over-base {
    background: #fff3e0;
    color: #f57c00;
}

.wmb-confidence-high {
    color: #2e7d32;
}

.wmb-confidence-medium {
    color: #f57c00;
}

.wmb-confidence-low {
    color: #d32f2f;
}

.wmb-no-data {
    font-size: 16px;
    color: #999;
    font-style: italic;
}

/* Usage Progress */
.wmb-usage-progress {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.wmb-progress-bar {
    width: 100%;
    height: 20px;
    background: #e1e1e1;
    border-radius: 10px;
    overflow: hidden;
    margin: 15px 0;
    position: relative;
}

.wmb-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #8bc34a);
    transition: width 0.3s ease;
    border-radius: 10px;
}

.wmb-progress-fill.wmb-over-limit {
    background: linear-gradient(90deg, #ff9800, #f44336);
}

.wmb-progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
}

.wmb-overage-notice {
    margin-top: 10px;
    padding: 8px 12px;
    background: #fff3e0;
    color: #f57c00;
    border-radius: 4px;
    font-size: 14px;
}

/* Tables */
.wmb-rates-table,
.wmb-meter-details,
.wmb-readings-table,
.wmb-orders-table,
.wmb-autopay-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.wmb-rates-table td,
.wmb-meter-details td,
.wmb-readings-table th,
.wmb-readings-table td,
.wmb-orders-table th,
.wmb-orders-table td,
.wmb-autopay-table th,
.wmb-autopay-table td {
    padding: 12px;
    border-bottom: 1px solid #e1e1e1;
    text-align: left;
}

.wmb-rates-table td:first-child,
.wmb-meter-details td:first-child {
    font-weight: 500;
    color: #555;
    width: 40%;
}

.wmb-readings-table th,
.wmb-orders-table th,
.wmb-autopay-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.wmb-readings-table-wrapper,
.wmb-orders-table-wrapper,
.wmb-autopay-table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e1e1e1;
}

.wmb-na {
    color: #999;
    font-style: italic;
}

/* Status Badges */
.wmb-status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wmb-status-active {
    background: #e8f5e8;
    color: #2e7d32;
}

.wmb-status-inactive,
.wmb-status-disconnected {
    background: #ffebee;
    color: #c62828;
}

.wmb-status-processing,
.wmb-status-pending {
    background: #fff3e0;
    color: #f57c00;
}

.wmb-status-completed,
.wmb-status-paid {
    background: #e8f5e8;
    color: #2e7d32;
}

.wmb-status-failed,
.wmb-status-cancelled {
    background: #ffebee;
    color: #c62828;
}

/* Billing Page */
.wmb-current-balance {
    margin-bottom: 30px;
}

.wmb-balance-due .wmb-balance-amount {
    font-size: 48px;
    font-weight: bold;
    color: #d32f2f;
    margin: 15px 0;
}

.wmb-balance-good .wmb-balance-amount {
    font-size: 48px;
    font-weight: bold;
    color: #2e7d32;
    margin: 15px 0;
}

.wmb-balance-actions {
    margin-top: 15px;
}

.wmb-pay-all-btn,
.wmb-pay-btn {
    background: #2e7d32 !important;
    color: white !important;
    border: none !important;
    padding: 10px 20px !important;
    border-radius: 4px !important;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s ease;
}

.wmb-pay-all-btn:hover,
.wmb-pay-btn:hover {
    background: #1b5e20 !important;
}

.wmb-view-btn,
.wmb-download-btn {
    background: #1976d2 !important;
    color: white !important;
    border: none !important;
    padding: 8px 16px !important;
    border-radius: 4px !important;
    cursor: pointer;
    font-size: 12px;
    text-decoration: none !important;
    margin-left: 5px;
}

.wmb-view-btn:hover,
.wmb-download-btn:hover {
    background: #1565c0 !important;
    color: white !important;
}

.wmb-order-actions {
    white-space: nowrap;
}

.wmb-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.wmb-summary-card h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.wmb-summary-value {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
}

.wmb-help-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.wmb-help-item h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #333;
}

.wmb-help-item p {
    margin: 0;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

/* Auto-Pay Page */
.wmb-autopay-info {
    margin-bottom: 30px;
}

.wmb-autopay-benefits ul {
    margin: 10px 0 0 20px;
    padding: 0;
}

.wmb-autopay-benefits li {
    margin-bottom: 5px;
    color: #555;
}

.wmb-form-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e1e1e1;
}

.wmb-form-section:last-child {
    border-bottom: none;
}

.wmb-form-section h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #333;
}

/* Toggle Switch */
.wmb-toggle-field {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.wmb-toggle {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    margin-right: 15px;
}

.wmb-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.wmb-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 34px;
}

.wmb-toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.wmb-toggle input:checked + .wmb-toggle-slider {
    background-color: #2e7d32;
}

.wmb-toggle input:checked + .wmb-toggle-slider:before {
    transform: translateX(26px);
}

.wmb-toggle-label {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
}

.wmb-status-active {
    color: #2e7d32;
}

.wmb-status-inactive {
    color: #f57c00;
}

.wmb-status-icon {
    margin-right: 5px;
    font-weight: bold;
}

/* Payment Methods */
.wmb-payment-methods {
    display: grid;
    gap: 15px;
}

.wmb-payment-method {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 2px solid #e1e1e1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wmb-payment-method:hover {
    border-color: #1976d2;
}

.wmb-payment-method input[type="radio"] {
    margin-right: 15px;
}

.wmb-payment-method input[type="radio"]:checked + .wmb-method-details {
    color: #1976d2;
}

.wmb-payment-method:has(input:checked) {
    border-color: #1976d2;
    background: #f3f8ff;
}

.wmb-method-details {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wmb-method-info {
    display: flex;
    flex-direction: column;
}

.wmb-method-type {
    font-weight: 600;
    margin-bottom: 4px;
}

.wmb-method-details-text {
    font-size: 14px;
    color: #666;
}

.wmb-default-badge {
    background: #e8f5e8;
    color: #2e7d32;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

.wmb-no-payment-methods {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Process Steps */
.wmb-process-steps {
    display: grid;
    gap: 20px;
}

.wmb-step {
    display: flex;
    align-items: flex-start;
    padding: 20px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #1976d2;
}

.wmb-step-number {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    background: #1976d2;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 15px;
    font-size: 14px;
}

.wmb-step-content h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #333;
}

.wmb-step-content p {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

/* Form Actions */
.wmb-form-actions {
    text-align: center;
    padding-top: 20px;
}

.wmb-save-autopay {
    background: #2e7d32 !important;
    color: white !important;
    border: none !important;
    padding: 12px 30px !important;
    border-radius: 4px !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    cursor: pointer;
}

.wmb-save-autopay:hover {
    background: #1b5e20 !important;
}

.wmb-save-autopay:disabled {
    background: #ccc !important;
    cursor: not-allowed;
}

/* FAQ */
.wmb-faq-item {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e1e1e1;
}

.wmb-faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.wmb-faq-item h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #333;
}

.wmb-faq-item p {
    margin: 0;
    color: #666;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 768px) {
    .wmb-usage-cards {
        grid-template-columns: 1fr;
    }
    
    .wmb-summary-cards {
        grid-template-columns: 1fr;
    }
    
    .wmb-help-content {
        grid-template-columns: 1fr;
    }
    
    .wmb-value {
        font-size: 28px;
    }
    
    .wmb-balance-due .wmb-balance-amount,
    .wmb-balance-good .wmb-balance-amount {
        font-size: 36px;
    }
    
    .wmb-readings-table,
    .wmb-orders-table,
    .wmb-autopay-table {
        font-size: 12px;
    }
    
    .wmb-readings-table th,
    .wmb-readings-table td,
    .wmb-orders-table th,
    .wmb-orders-table td,
    .wmb-autopay-table th,
    .wmb-autopay-table td {
        padding: 8px 6px;
    }
    
    .wmb-order-actions {
        display: flex;
        flex-direction: column;
        gap: 5px;
    }
    
    .wmb-view-btn,
    .wmb-download-btn,
    .wmb-pay-btn {
        margin: 0;
        width: 100%;
        text-align: center;
    }
}