/* Custom My Account Styles */
.mstech-custom-account-container {
    display: flex;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; /* Modern font stack */
    color: #212529; /* Darker text for light theme */
    margin: 0 auto; 
    background-color: #F8F9FA; /* Light gray page background */
    min-height: calc(100vh - 0px); /* Adjust 0px if you have a fixed header/footer */
    overflow: hidden; /* Keeps child elements contained */
}
.mstech-account-nav {
    width: 280px; /* Slightly wider nav */
    background-color: #FFFFFF; /* White sidebar */
    padding: 35px 0;
    color: #495057; /* Default text color for nav */
    border-right: 1px solid #DEE2E6; /* Light border separator */
}
.mstech-account-nav .user-info {
    text-align: center;
    padding-bottom: 30px;
    margin-bottom: 15px;
    border-bottom: 1px solid #DEE2E6; /* Light border */
}
.mstech-account-nav .user-info img {
    width: 85px;
    height: 85px;
    border-radius: 50%;
    margin-bottom: 15px;
    border: 3px solid #DEE2E6; /* Light border */
}
.mstech-account-nav .user-info p {
    margin: 0;
    font-weight: 500;
    font-size: 1.15em; /* Slightly larger */
    color: #212529; /* Darker name color */
}
.mstech-account-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.mstech-account-nav ul li a, .mstech-account-nav ul li span {
    display: block;
    padding: 10px 25px; /* Increased padding */
    color: #343A40; /* Dark gray link color */
    text-decoration: none;
    font-size: 1.05em; /* Slightly larger font */
    transition: background-color 0.2s ease, color 0.2s ease, border-left-color 0.2s ease;
    border-left: 5px solid transparent; /* Thicker border indicator */
    font-weight: 500; /* Slightly bolder for clarity */
}
.mstech-account-nav ul li a:hover, .mstech-account-nav ul li span:hover {
    background-color: #F8F9FA; /* Very light gray hover */
    color: #007BFF; /* Accent blue for text */
    border-left-color: #007BFF; /* Accent blue for border */
}
.mstech-account-nav ul li.active a, .mstech-account-nav ul li.active span {
    background-color: #E7F3FF; /* Light blue background for active */
    color: #007BFF; /* Accent blue for text */
    font-weight: 600;
    border-left-color: #007BFF; /* Accent blue for border */
}
.mstech-account-nav ul li.sub-menu-item a {
    padding-left: 55px; /* Indent sub-items more */
    font-size: 1em;
    color: #495057; /* Darker gray for sub-items */
}
 .mstech-account-nav ul li.sub-menu-item.active a {
     background-color: #D4E8FF; /* Slightly darker light blue for active sub-item */
     color: #0056B3; /* Darker blue text */
}
.mstech-account-nav .nav-section-title {
    padding: 12px 35px;
    font-size: 0.85em; /* Smaller section title */
    color: #6C757D; /* Muted gray for section titles */
    text-transform: uppercase;
    letter-spacing: 0.8px; /* Wider letter spacing */
    margin-top: 20px;
    font-weight: 600;
}

.nav-section-title{
    background: #D4E8FF;
}

.mstech-account-content {
    flex-grow: 1;
    padding: 45px; /* Increased padding */
    background-color: #FFFFFF; /* White content background */
    overflow-y: auto; /* Added for independent scrollbar */
    max-height: calc(100vh - 0px); /* Adjust 0px based on actual fixed header height */
}
.mstech-account-content h2 {
    font-size: 28px; /* Adjusted size */
    color: #212529; /* Dark heading color */
    margin-top: 0;
    margin-bottom: 35px;
    border-bottom: 1px solid #DEE2E6; /* Light border */
    padding-bottom: 20px;
    font-weight: 600;
}

/* Account Details Form Styling - Two Column Responsive Grid */
.mstech-account-details-form-container .woocommerce-EditAccountForm fieldset {
    border: 1px solid #DEE2E6;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px; 
}

.mstech-account-details-form-container .woocommerce-EditAccountForm fieldset legend {
    font-weight: 600;
    padding: 0 10px;
    margin-left: 0;
    font-size: 1.2em;
    color: #343A40;
    width: auto;
    border-bottom: none;
}

.mstech-account-details-form-container .woocommerce-EditAccountForm p.form-row {
    margin-bottom: 15px;
    padding: 0;
}

.mstech-account-details-form-container .woocommerce-EditAccountForm p.form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #343A40;
}

.mstech-account-details-form-container .woocommerce-EditAccountForm input[type="text"],
.mstech-account-details-form-container .woocommerce-EditAccountForm input[type="email"],
.mstech-account-details-form-container .woocommerce-EditAccountForm input[type="password"],
.mstech-account-details-form-container .woocommerce-EditAccountForm input[type="tel"], 
.mstech-account-details-form-container .woocommerce-EditAccountForm input[type="url"], 
.mstech-account-details-form-container .woocommerce-EditAccountForm textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #CED4DA;
    border-radius: 4px;
    box-sizing: border-box;
    line-height: normal;
}

.mstech-account-details-form-container .woocommerce-EditAccountForm input:focus,
.mstech-account-details-form-container .woocommerce-EditAccountForm textarea:focus {
    border-color: #007BFF;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

.mstech-account-details-form-container .woocommerce-EditAccountForm {
    display: grid;
    grid-template-columns: 1fr; 
    gap: 0 20px; /* Column gap only, row gap will be managed by field margins */
}

.mstech-account-details-form-container .woocommerce-EditAccountForm > div.clear {
    display: none;
}

/* Define grid areas for clarity (optional but good practice) */
@media (min-width: 992px) {
    .mstech-account-details-form-container .woocommerce-EditAccountForm {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "firstname passwordfieldset"
            "lastname passwordfieldset"
            "displayname passwordfieldset"
            "email passwordfieldset"
            "savebutton savebutton";
        gap: 20px; /* Gap for rows and columns */
    }

    .mstech-account-details-form-container .woocommerce-EditAccountForm p.woocommerce-form-row--first { 
        grid-area: firstname;
    }
    .mstech-account-details-form-container .woocommerce-EditAccountForm p.woocommerce-form-row--last { 
        grid-area: lastname;
    }
    /* Display Name and Email are typically woocommerce-form-row--wide.
       We need to ensure they are explicitly placed. 
       The default form-edit-account.php has: first, last, (clear), display, email, (clear), fieldset 
       If your structure is different, these direct child selectors might need adjustment or more specific classes.
    */
    .mstech-account-details-form-container .woocommerce-EditAccountForm > p.woocommerce-form-row:nth-of-type(3) { 
        grid-area: displayname;
    }
    .mstech-account-details-form-container .woocommerce-EditAccountForm > p.woocommerce-form-row:nth-of-type(4) { 
        grid-area: email;
    }

    .mstech-account-details-form-container .woocommerce-EditAccountForm > fieldset {
        grid-area: passwordfieldset;
        margin-bottom: 0; 
        display: flex; 
        flex-direction: column;
        justify-content: space-between; /* Distribute space if fieldset is taller */
    }
    .mstech-account-details-form-container .woocommerce-EditAccountForm > fieldset > p {
        margin-bottom: 15px;
    }
     .mstech-account-details-form-container .woocommerce-EditAccountForm > fieldset > p:last-child {
        margin-bottom: 0; 
    }

    .mstech-account-details-form-container .woocommerce-EditAccountForm > p:has(button[name="save_account_details"]) {
        grid-area: savebutton;
        margin-top: 0; /* Gap is handled by grid */
    }
}

.mstech-account-details-form-container .woocommerce-EditAccountForm .woocommerce-Button {
    padding: 12px 25px;
    font-size: 1.05em;
}

.mstech-account-details-form-container .woocommerce-EditAccountForm > p:has(button[name="save_account_details"]) {
    text-align: left; 
}


/* Styles for Dashboard Content */
.mstech-dashboard {
    padding: 20px;
}

.mstech-dashboard h2 {
    margin-top: 0;
    margin-bottom: 30px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.mstech-dashboard-section {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.mstech-dashboard-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2em;
    color: #333;
}

.mstech-admin-message-content {
    background-color: #f9f9f9;
    border-left: 4px solid #0073aa; /* WordPress blue */
    padding: 15px;
    margin-bottom: 10px;
}

.mstech-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.mstech-user-points .mstech-points-value,
.mstech-active-licenses .mstech-licenses-count {
    font-size: 1.8em;
    font-weight: bold;
    color: #0073aa;
    margin-top: 0;
    margin-bottom: 10px;
}

.mstech-dashboard-section p {
    margin-bottom: 10px;
}

.mstech-dashboard-section p:last-child {
    margin-bottom: 0;
}

.mstech-quick-links ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.mstech-quick-links ul li {
    margin-bottom: 8px;
}

.mstech-quick-links ul li a {
    text-decoration: none;
    color: #0073aa;
}

.mstech-quick-links ul li a:hover {
    text-decoration: underline;
    color: #0056B3;
}

.mstech-dashboard-section p {
    margin-bottom: 10px;
    line-height: 1.6;
}

.mstech-dashboard-section .mstech-button {
    margin-top: 10px;
}


/* Modernized Software Licenses Section - Light Theme Adjustments */
.mstech-my-serials-container { font-family: inherit; }
.mstech-order-section { 
    background-color: #FFFFFF; /* White background for cards/sections */
    border: 1px solid #DEE2E6; /* Consistent light border */
    border-radius: 8px; 
    margin-bottom: 35px; 
    padding: 0px; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.03); /* Subtle shadow */
}
.mstech-order-section h3 { 
    font-size: 22px; /* Larger order title */
    color: #212529; /* Darker heading */
    margin-top: 0; 
    margin-bottom: 25px; 
    border-bottom: 1px solid #E9ECEF; /* Lighter border */
    padding-bottom: 15px; 
    font-weight: 500;
}
.mstech-serial-card { 
    background-color: #FFFFFF; 
    border: 1px solid #E9ECEF; /* Consistent light border */
    border-radius: 6px; 
    margin-bottom: 25px; 
    padding: 25px; 
    box-shadow: 0 3px 8px rgba(0,0,0,0.04); /* Softer card shadow */
    transition: box-shadow 0.25s ease, transform 0.25s ease; 
}
.mstech-serial-card:hover { 
    box-shadow: 0 6px 15px rgba(0,0,0,0.07); /* Enhanced hover shadow */
    transform: translateY(-3px); /* Slight lift on hover */
}
.mstech-serial-card-header h5 { 
    font-size: 19px; /* Slightly larger software name */
    color: #007BFF; /* Accent blue for software name */
    margin-top: 0; 
    margin-bottom: 18px; 
    font-weight: 600; 
}
.mstech-serial-card-body p { 
    margin: 10px 0; 
    line-height: 1.75; /* Improved line height */
    font-size: 15px; /* Slightly larger text */
    color: #495057; /* Standard text color */
}
.mstech-serial-card-body p strong { 
    color: #212529; /* Darker strong text */
    font-weight: 600;
}
.mstech-download-button { 
    display: inline-block; 
    background-color: #007BFF; /* Primary blue */
    color: white !important; 
    padding: 12px 22px; /* Larger button */
    text-decoration: none; 
    border-radius: 6px; /* More rounded */
    font-size: 15px; 
    font-weight: 500; 
    margin-top: 18px; 
    transition: background-color 0.2s ease, transform 0.2s ease; 
    text-align: center; 
    border: none; /* Remove border if any */
}
.mstech-download-button:hover { 
    background-color: #0056B3; /* Darker blue on hover */
    color: white !important; 
    transform: translateY(-2px); /* Slight lift on hover */
}
.mstech-no-serials-found { 
    text-align: center; 
    font-size: 17px; /* Larger text */
    color: #6C757D; /* Muted gray */
    padding: 30px 20px; 
    background-color: #F8F9FA; /* Light gray background */
    border-radius: 8px; 
    border: 1px dashed #DEE2E6; /* Dashed light border */
    margin-top: 20px;
}

/* Accordion styles for Software Licenses Order Sections - Light Theme Adjustments */
/* General accordion item structure, also used by My Software Licenses */
.mstech-account-content .mstech-order-item {
    border: 1px solid #DEE2E6;
    border-radius: 8px;
    margin-bottom: 20px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
    overflow: hidden; /* Important for border-radius and containing children */
}

.mstech-account-content .mstech-order-item .mstech-order-item-header {
    cursor: pointer;
    padding: 15px 20px; /* Adjusted padding */
    background-color: #F8F9FA;
    transition: background-color 0.2s ease;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #DEE2E6; /* Separator for closed state */
}

.mstech-account-content .mstech-order-item.is-open .mstech-order-item-header {
    background-color: #F1F3F5;
    border-bottom-color: transparent; /* Remove bottom border when open */
}

.mstech-account-content .mstech-order-item .mstech-order-item-header:hover {
    background-color: #E9ECEF;
}

.mstech-account-content .mstech-order-item .mstech-order-item-header h4 {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #343A40;
}

.mstech-account-content .mstech-order-item .mstech-order-item-header .toggle-icon {
    font-size: 20px;
    font-weight: bold;
    color: #495057;
    transition: transform 0.3s ease;
}

.mstech-account-content .mstech-order-item.is-open .mstech-order-item-header .toggle-icon {
    transform: rotate(45deg);
}

.mstech-account-content .mstech-order-item .mstech-order-item-header .toggle-icon::before {
    content: '+';
}

.mstech-account-content .mstech-order-item.is-open .mstech-order-item-header .toggle-icon::before {
    content: '\00D7'; /* Multiplication sign (X) */
}

/* Content area of the accordion */
.mstech-account-content .mstech-order-item .mstech-order-item-content {
    padding: 20px; /* Ensure adequate padding */
    background-color: #ffffff;
    border-top: 1px solid #DEE2E6; /* Separator line when open */
    /* max-height, overflow, transition are handled by JS */
}

/* Specific to licenses accordion if needed, but general styles should cover it */
.mstech-licenses-by-order-accordion .mstech-order-item-content {
    /* If more specific padding or styles are needed for license content */
    padding: 20px; /* Consistent padding */
}

/* Styling for individual serial items within the accordion content */
.mstech-serial-item-details {
    margin-bottom: 15px;
    padding: 15px; /* Padding for the inner box */
    border: 1px solid #E9ECEF; /* Border for the inner box */
    border-radius: 6px;
    background-color: #F8F9FA; /* Light background for each serial detail */
    font-size: 0.95em;
}
.mstech-serial-item-details:last-child {
    margin-bottom: 0;
}

.mstech-serial-item-details h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.05em; /* Adjusted from 1.1em to be slightly smaller */
    color: #007BFF;
    font-weight: 600;
}

.mstech-serial-item-details p {
    margin: 5px 0;
    line-height: 1.6;
    color: #495057;
}

.mstech-serial-item-details p strong {
    color: #212529;
}

.mstech-serial-item-details a {
    color: #0056b3;
    text-decoration: none;
}

.mstech-serial-item-details a:hover {
    text-decoration: underline;
}

/* Notice styling within accordion */
.mstech-no-licenses-in-order-notice {
    padding: 0; /* Remove padding if wc_print_notice adds its own */
}
.mstech-no-licenses-in-order-notice .woocommerce-message,
.mstech-no-licenses-in-order-notice .woocommerce-info,
.mstech-no-licenses-in-order-notice .woocommerce-error,
.mstech-no-licenses-in-order-notice .woocommerce-notice {
    margin: 0 0 15px 0; /* Add some bottom margin if it's the only content */
    padding: 15px;
    border-radius: 4px;
}
.mstech-no-licenses-in-order-notice .woocommerce-notice:last-child {
    margin-bottom: 0;
}

/* REMOVE EMPTY RULESETS */
/* .woocommerce-account .woocommerce-MyAccount-content table.shop_table.subscriptions {} */
/* .woocommerce-account .woocommerce-MyAccount-content table.shop_table.subscriptions th, */
/* .woocommerce-account .woocommerce-MyAccount-content table.shop_table.subscriptions td {} */

/* Ensure the file ends cleanly if these were the last rules */