/* Mondo Course Credits Frontend Styles */

/* My Account - Credits Dashboard */
.woocommerce-MyAccount-content .mcc-credits-dashboard {
    width: 100%; 
    box-sizing: border-box; 
    padding: 0; 
    display: block; 
    clear: both; 
}

.mcc-notice { 
    margin-bottom: 1.5em !important; 
    padding: 1em 1.5em !important; 
    clear: both; 
    box-sizing: border-box; 
}
.mcc-notice .button.mcc-inline-button { 
    margin-left: 10px;
    vertical-align: middle;
    padding: 4px 8px !important; 
    font-size: 0.9em !important;
    line-height: 1.5 !important;
}

.mcc-balance-summary {
    font-size: 1.2em;
    margin-top: 1em; 
    margin-bottom: 1.5em;
    padding: 15px; 
    background-color: #f8f9fa; 
    border-left: 5px solid #0073aa; 
    border-radius: 3px;
    box-sizing: border-box; 
    clear: both;
}

.woocommerce-MyAccount-content .mcc-table-wrapper {
    display: block; 
    clear: both; 
    overflow-x: auto !important; 
    -webkit-overflow-scrolling: touch; 
    max-width: 100%; 
    width: 100%; 
    box-sizing: border-box; 
    margin-bottom: 2em;
}

.mcc_credit_blocks_table,
.mcc_credit_log_table {
    width: 100%; 
    min-width: 720px; /* Ensures table has enough space for columns, forcing scroll on wrapper if needed */
    border-collapse: collapse; 
}

/* General cell styling */
.mcc_credit_blocks_table th, .mcc_credit_blocks_table td,
.mcc_credit_log_table th, .mcc_credit_log_table td {
    text-align: left;
    padding: 10px 12px; 
    border: 1px solid #e9ecef; 
    vertical-align: middle;
    font-size: 0.95em; 
    box-sizing: border-box; 
    word-break: break-word; 
}

/* Header specific styling */
.mcc_credit_blocks_table th,
.mcc_credit_log_table th {
    background-color: #e9ecef; 
    font-weight: 600; 
    color: #333;
    white-space: nowrap; 
}

/* --- Column Width Tuning using specific classes --- */

/* For "Credit Blocks" Table */
.mcc-th-granted, .mcc-td-granted { width: 8%; min-width: 75px; }
.mcc-th-remaining, .mcc-td-remaining { width: 9%; min-width: 85px; text-align: center !important; }
.mcc-td-remaining strong { font-size: 1.1em; }
.mcc-th-status, .mcc-td-status { width: 13%; min-width: 110px; white-space: nowrap; }
.mcc-th-expiry-date, .mcc-td-expiry-date { width: 13%; min-width: 110px; white-space: nowrap; }
.mcc-th-grant-date, .mcc-td-grant-date { width: 13%; min-width: 110px; white-space: nowrap; }
.mcc-th-notes, .mcc-td-notes { width: 24%; min-width: 150px; } 
.mcc-th-source, .mcc-td-source { width: 20%; min-width: 120px; }


/* For "Recent Credit Activity" Table */
.mcc-th-log-date, .mcc-td-log-date { 
    width: 22%; /* Increased percentage */
    min-width: 130px; /* Increased min-width */
    white-space: nowrap;
}
.mcc-th-log-activity, .mcc-td-log-activity { 
    width: 23%; 
    min-width: 130px; 
}
.mcc-th-log-credits, .mcc-td-log-credits { 
    width: 10%; 
    min-width: 70px; 
    text-align: center !important;
}
.mcc-th-log-details, .mcc-td-log-details { 
    width: 45%; /* Reduced percentage slightly */
    min-width: 200px; 
}


.mcc-td-wrap { 
    word-break: break-word;
    white-space: normal !important;
}

/* Credit Block Status Styling (remains the same) */
.mcc_credit_blocks_table .mcc-block-active td {}
.mcc_credit_blocks_table .mcc-block-frozen td { color: #6c757d; background-color: #f8f9fa; }
.mcc_credit_blocks_table .mcc-block-frozen strong { color: #6c757d; }
.mcc_credit_blocks_table .mcc-block-expired td,
.mcc_credit_blocks_table .mcc-block-used td { color: #adb5bd; text-decoration: line-through; background-color: #fdfdfd; }
.mcc_credit_blocks_table .mcc-block-expired strong,
.mcc_credit_blocks_table .mcc-block-used strong { color: #adb5bd; }

/* Redeem Button & CTA Styling (remains the same) */
.mcc-redeem-section, 
.mcc-no-credits-cta,
.mcc-already-redeemed,
.mcc-redeem-cta-logged-out {
    margin-top: 15px;
    margin-bottom: 15px;
    padding: 15px;
    border: 1px solid #dee2e6;
    background-color: #f8f9fa;
    border-radius: 4px;
    box-sizing: border-box;
}
.mcc-redeem-section p, 
.mcc-no-credits-cta p,
.mcc-already-redeemed p,
.mcc-redeem-cta-logged-out p {
    margin-top: 0;
    margin-bottom: 10px;
}

.mcc-error { color: #dc3545; font-weight: bold; } 
.mcc-price-hidden-redeemable { font-style: italic; color: #007bff; font-size: 0.9em; display: block; margin: 5px 0; } 


/* Responsive Table Styling (Stacking on small screens - remains largely the same) */
@media screen and (max-width: 768px) {
    .woocommerce-MyAccount-content .mcc-table-wrapper {
        border: none; 
        overflow-x: visible; 
    }
    .woocommerce-MyAccount-content .mcc-table-wrapper table.shop_table {
        min-width: 100%; 
    }

    .woocommerce-MyAccount-content .mcc-table-wrapper table.shop_table thead {
        display: none; 
    }

    .woocommerce-MyAccount-content .mcc-table-wrapper table.shop_table tr {
        display: block;
        margin-bottom: 1.5em; 
        border: 1px solid #dee2e6;
        box-shadow: 0 1px 3px rgba(0,0,0,0.05);
        border-radius: 3px;
        padding: 0; 
    }
     .woocommerce-MyAccount-content .mcc-table-wrapper table.shop_table td {
        display: block;
        text-align: right !important; 
        padding-left: 45% !important; 
        padding-top: 10px;
        padding-bottom: 10px;
        padding-right: 10px;
        position: relative;
        border: none; 
        border-bottom: 1px dotted #e9ecef; 
        min-height: 2.5em; 
    }
    .woocommerce-MyAccount-content .mcc-table-wrapper table.shop_table td:last-child {
        border-bottom: 0;
    }

    .woocommerce-MyAccount-content .mcc-table-wrapper table.shop_table td:before {
        content: attr(data-title); 
        position: absolute;
        left: 10px; 
        top: 10px; 
        width: 40%; 
        padding-right: 10px; 
        white-space: normal; 
        text-align: left !important; 
        font-weight: bold;
        color: #495057; 
    }
}
