/* --- Loading Spinner --- */
.wtc-loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #0073ea; /* WordPress blue */
    animation: wtc-spin 1s ease-in-out infinite;
    -webkit-animation: wtc-spin 1s ease-in-out infinite;
    margin: 0 5px -5px 5px;
}

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

/* --- Modal Styles --- */
#wtc-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100000;
}

#wtc-modal-wrap {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    z-index: 100001;
    width: 90%;
    max-width: 600px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
}

#wtc-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

#wtc-modal-header h2 {
    margin: 0;
    font-size: 1.25em;
}

#wtc-modal-close {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    color: #888;
}

#wtc-modal-close:hover {
    color: #333;
}

#wtc-modal-content {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
    background: #fdfdfd;
}

#wtc-modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 15px 20px;
    border-top: 1px solid #eee;
    background: #f9f9f9;
}

#wtc-modal-footer .button {
    margin-left: 10px;
}

/* --- Modal Summary --- */
#wtc-modal-summary {
    padding: 15px 20px;
    border-top: 2px solid #eee;
    background: #fff;
    text-align: right;
}
#wtc-total-summary {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
}
#wtc-total-summary .spinner {
    visibility: hidden; /* Hide spinner by default */
    margin: 0 0 -4px 5px;
}
#wtc-total-summary.loading .spinner {
    visibility: visible;
}

/* --- Modal Items List (FOR TABLE LAYOUT) --- */
#wtc-modal-items-list table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.wtc-modal-item {
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
}
.wtc-modal-item:last-child {
    border-bottom: none;
}

.wtc-item-details {
    padding: 10px 15px;
    vertical-align: top;
    width: 50%;
}
.wtc-item-name {
    font-weight: 600;
    display: block;
    margin-bottom: 5px;
}
.wtc-item-price-context {
    font-size: 0.9em;
    color: #555;
}

.wtc-item-actions {
    padding: 10px 15px;
    vertical-align: top;
    text-align: right;
}
.wtc-item-actions label {
    font-weight: 600;
    margin: 0 0 5px;
    display: block;
}
.wtc-item-actions input[type="number"] {
    width: 70px;
    text-align: center;
    padding: 5px;
}

.wtc-item-fee-preview {
    padding: 10px 15px;
    background: #f0f5fb; /* Light blue */
    font-size: 0.9em;
    font-weight: 600;
    color: #333;
    vertical-align: top;
    text-align: right;
    width: 30%;
}
.wtc-item-fee-preview span {
    display: block;
    text-align: right;
}
.wtc-item-fee-preview .wtc-fee-amount {
    color: #b00; /* Red for fee */
}


/* --- Info Modal --- */
#wtc-info-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100010;
}
#wtc-info-modal-wrap {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    z-index: 100011;
    width: 90%;
    max-width: 400px;
    padding: 25px;
    text-align: center;
}
#wtc-info-modal-message {
    font-size: 1.1em;
    margin: 0 0 20px;
}

#wtc-info-modal-actions {
    display: flex;
    justify-content: space-around;
    gap: 10px;
}
#wtc-info-modal-actions .button {
    margin: 0;
}
.wtc-info-modal-ok {
    display: flex;
    justify-content: center;
}

/* --- Button Statuses --- */
.wtc-status {
    font-weight: 600;
    color: black;
    margin-right: 10px;
}
.wtc-status-pending {
    font-weight: 600;
    color: #ffa500;
    margin-right: 10px;
}
.wtc-status-processed {
    color: #777;
    font-weight: 600;
}
.wtc-withdraw-request {
    font-size: 0.9em !important;
    border-color: #a00 !important;
    line-height: 1.5;
    text-decoration: none;
    vertical-align: middle;
}
.wtc-withdraw-request:hover {
    color: #fff !important;
    background: #a00 !important;
}
.woocommerce-page .button.wtc-withdraw-request, .woocommerce-page .button.wtc-open-modal {
    float: none;
}

/* --- Requests Table on Order Details --- */
.wtc-requests-table {
    margin-bottom: 20px;
    width: 100%;
    border: 1px solid #e5e5e5;
    border-collapse: collapse;
}
.wtc-requests-table th, 
.wtc-requests-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e5e5;
}
/* Status Badges */
.wtc-status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
}
.wtc-status-badge.status-requested {
    background-color: #fff8e5;
    color: #f39c12;
    border: 1px solid #f39c12;
}
.wtc-status-badge.status-approved {
    background-color: #e8f5e9;
    color: #27ae60;
    border: 1px solid #27ae60;
}
.wtc-status-badge.status-rejected {
    background-color: #ffebee;
    color: #c0392b;
    border: 1px solid #c0392b;
}
.wtc-status-badge.status-withdrawn {
    background-color: #f5f5f5;
    color: #7f8c8d;
    border: 1px solid #95a5a6;
}
/* Amounts */
.wtc-fee {
    color: #c0392b;
    font-size: 0.9em;
}
.wtc-refund {
    color: #27ae60;
    font-weight: 600;
}

/* --- Pending Item Row (for mobile/simple view) --- */
.wtc-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px; 
}

/* Make buttons responsive on small screens */
@media (max-width: 768px) {
    .wtc-action-buttons {
        align-items: stretch;
    }
    .wtc-action-buttons .button,
    .wtc-action-buttons .wtc-withdraw-request {
        margin: 5px 0 0 0 !important;
        width: 100%;
        box-sizing: border-box;
        text-align: center;
    }
    /* Stack table cells on mobile */
    .wtc-modal-item {
        display: block;
    }
    .wtc-item-details,
    .wtc-item-actions,
    .wtc-item-fee-preview {
        display: block;
        width: 100%;
        box-sizing: border-box;
        text-align: left;
        padding: 10px 15px;
    }
    .wtc-item-actions {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .wtc-item-actions label {
        margin: 0;
    }
    .wtc-item-fee-preview {
        text-align: right;
    }
}

/* --- YOUR CUSTOM ADDITIONS --- */
a.tec-tickets__wallet-plus-component-pdf-button-link, #top .my_account_orders a.button {
    padding: 15px!important;
    margin-bottom: 0!important;
}