/* My Account */
.monty-esim-my-account {
    margin: 20px 0;
}

.monty-esim-my-account h2 {
    margin-bottom: 20px;
    color: #333;
}

/* Order Details */
.monty-order-details {
    margin: 20px 0;
    padding: 20px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.monty-order-details h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

.monty-order-details table {
    width: 100%;
    border-collapse: collapse;
}

.monty-order-details th,
.monty-order-details td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.monty-order-details th {
    background-color: #f0f0f0;
    font-weight: 600;
}

/* Consumption Data */
.monty-consumption-data {
    margin: 20px 0;
    padding: 20px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.monty-consumption-data h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

.monty-consumption-item {
    margin-bottom: 15px;
    padding: 15px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.monty-consumption-item h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
}

.monty-consumption-item p {
    margin: 5px 0;
    color: #666;
}

/* Top-up Options */
.monty-topup-options {
    margin: 20px 0;
    padding: 20px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.monty-topup-options h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

.monty-topup-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.monty-topup-item button {
    background-color: #0073aa;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
}

.monty-topup-item button:hover {
    background-color: #005177;
}

/* Responsive */
@media (max-width: 768px) {
    .monty-esim-lookup {
        padding: 15px;
    }
    
    .monty-order-details,
    .monty-consumption-data,
    .monty-topup-options {
        padding: 15px;
    }
    
    .monty-topup-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .monty-topup-item button {
        margin-top: 10px;
        width: 100%;
    }
}

/* QR Code Modal */
.monty-modal {
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.monty-modal-content {
    background-color: #fff;
    margin: auto;
    padding: 30px;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.monty-modal-close {
    position: absolute;
    right: 15px;
    top: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.monty-modal-close:hover,
.monty-modal-close:focus {
    color: #333;
    text-decoration: none;
}

.monty-modal-content h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.monty-qr-container {
    text-align: center;
    margin-bottom: 20px;
}

.monty-qr-container img {
    max-width: 250px;
    width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.monty-qr-info {
    text-align: center;
    margin-bottom: 20px;
}

.monty-qr-iccid {
    font-size: 12px;
    color: #666;
    word-break: break-all;
    margin-bottom: 10px;
}

.monty-qr-instructions {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.monty-qr-actions {
    text-align: center;
}

.monty-qr-actions .button {
    display: inline-block;
    background-color: #0073aa;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 3px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
}

.monty-qr-actions .button:hover {
    background-color: #005177;
    color: #fff;
}

/* eSIM Card Actions */
.monty-esim-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.monty-esim-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.monty-esim-header h3 {
    margin: 0;
    color: #333;
}

.monty-esim-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.monty-status-active {
    background-color: #d4edda;
    color: #155724;
}

.monty-status-expired {
    background-color: #f8d7da;
    color: #721c24;
}

.monty-status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.monty-status-suspended {
    background-color: #e2e3e5;
    color: #383d41;
}

.monty-status-unknown {
    background-color: #e2e3e5;
    color: #383d41;
}

.monty-esim-details {
    margin-bottom: 15px;
}

.monty-esim-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.monty-esim-row .monty-label {
    color: #666;
    font-weight: 500;
}

.monty-esim-row .monty-value {
    color: #333;
}

.monty-data-usage {
    flex: 1;
    text-align: right;
}

.monty-progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}

.monty-progress {
    height: 100%;
    background-color: #0073aa;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.monty-usage-text {
    font-size: 12px;
    color: #666;
}

.monty-esim-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.monty-esim-actions .button {
    padding: 8px 16px;
    font-size: 14px;
}

.monty-show-qr-btn {
    background-color: #28a745;
    color: #fff;
    border-color: #28a745;
}

.monty-show-qr-btn:hover {
    background-color: #218838;
    border-color: #1e7e34;
    color: #fff;
}

/* =========================================
   eSIM Orders Table Styles
   ========================================= */

/* Custom orders table in My Account */
.woocommerce-account .monty-orders-table {
    margin-bottom: 30px;
}

.woocommerce-account .monty-orders-table table {
    width: 100%;
    border-collapse: collapse;
}

.woocommerce-account .monty-orders-table th,
.woocommerce-account .monty-orders-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.woocommerce-account .monty-orders-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.woocommerce-account .monty-orders-table tr:hover {
    background-color: #f8f9fa;
}

/* eSIM Info Column */
.monty-order-esim-info {
    font-size: 13px;
}

.monty-order-esim-info .esim-label {
    color: #666;
    font-size: 11px;
    text-transform: uppercase;
    display: block;
    margin-bottom: 2px;
}

.monty-order-esim-info .esim-value {
    color: #333;
    font-weight: 500;
}

/* Order Status Badges */
.monty-order-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.monty-badge-completed {
    background-color: #d4edda;
    color: #155724;
}

.monty-badge-processing {
    background-color: #cce5ff;
    color: #004085;
}

.monty-badge-pending {
    background-color: #fff3cd;
    color: #856404;
}

.monty-badge-failed,
.monty-badge-cancelled {
    background-color: #f8d7da;
    color: #721c24;
}

.monty-badge-refunded {
    background-color: #e2e3e5;
    color: #383d41;
}

/* Topup Button */
.monty-btn-topup {
    display: inline-block;
    background-color: #28a745;
    color: #fff !important;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.monty-btn-topup:hover {
    background-color: #218838;
    color: #fff;
}

.monty-btn-topup:disabled,
.monty-btn-topup.disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* =========================================
   eSIM Order Details Styles
   ========================================= */

.monty-order-details-esim {
    margin: 20px 0;
}

.monty-order-details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.monty-order-details-header h2 {
    margin: 0;
    color: #333;
}

.monty-order-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.monty-order-meta-item {
    font-size: 13px;
}

.monty-order-meta-item .meta-label {
    color: #666;
    display: block;
    margin-bottom: 2px;
}

.monty-order-meta-item .meta-value {
    color: #333;
    font-weight: 500;
}

/* eSIM Details Card */
.monty-esim-details-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.monty-esim-details-card h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
}

.monty-esim-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.monty-esim-detail-item {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.monty-esim-detail-item .detail-label {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.monty-esim-detail-item .detail-value {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

/* QR Code Section */
.monty-order-qr-section {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.monty-order-qr-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

.monty-order-qr-image {
    max-width: 200px;
    margin: 0 auto 15px;
}

.monty-order-qr-image img {
    width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.monty-order-qr-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Installation Instructions */
.monty-installation-instructions {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.monty-installation-instructions h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

.monty-installation-instructions ol,
.monty-installation-instructions ul {
    margin: 0;
    padding-left: 20px;
}

.monty-installation-instructions li {
    margin-bottom: 10px;
    color: #555;
    line-height: 1.6;
}

/* =========================================
   Topup Modal Styles
   ========================================= */

.monty-topup-modal {
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
}

.monty-topup-modal.active {
    display: flex;
}

.monty-topup-modal-content {
    background: #fff;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.monty-topup-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.monty-topup-modal-header h3 {
    margin: 0;
    color: #333;
}

.monty-topup-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.monty-topup-modal-close:hover {
    color: #333;
}

.monty-topup-modal-body {
    padding: 20px;
}

.monty-topup-iccid-info {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 13px;
}

.monty-topup-iccid-info strong {
    color: #333;
}

.monty-topup-options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.monty-topup-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.monty-topup-option:hover {
    border-color: #0073aa;
    background: #f0f8ff;
}

.monty-topup-option.selected {
    border-color: #0073aa;
    background: #e6f2ff;
}

.monty-topup-option-details {
    flex: 1;
}

.monty-topup-option-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.monty-topup-option-specs {
    font-size: 13px;
    color: #666;
}

.monty-topup-option-price {
    font-size: 18px;
    font-weight: 600;
    color: #28a745;
}

.monty-topup-modal-footer {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.monty-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.monty-btn-primary {
    background-color: #0073aa;
    color: #fff;
}

.monty-btn-primary:hover {
    background-color: #005177;
}

.monty-btn-secondary {
    background-color: #e0e0e0;
    color: #333;
}

.monty-btn-secondary:hover {
    background-color: #ccc;
}

/* Loading State */
.monty-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #666;
}

.monty-loading::before {
    content: '';
    width: 24px;
    height: 24px;
    border: 3px solid #ddd;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: monty-spin 0.8s linear infinite;
    margin-right: 10px;
}

@keyframes monty-spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .monty-order-details-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .monty-esim-details-grid {
        grid-template-columns: 1fr;
    }
    
    .monty-topup-option {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .monty-topup-modal-footer {
        flex-direction: column;
    }
    
    .monty-btn {
        width: 100%;
    }
}