/**
 * All of the CSS for your public-facing functionality should be
 * included in this file.
 */

/* General Form Styles */
.os-form-row {
    margin-bottom: 15px;
    /* overflow: hidden; */ /* Removed to allow grid layout */
}
.os-form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}
.os-form-row input[type="text"],
.os-form-row input[type="email"],
.os-form-row input[type="tel"],
.os-form-row input[type="url"],
.os-form-row input[type="password"],
.os-form-row input[type="number"],
.os-form-row select,
.os-form-row textarea {
    width: 100%;

}
.os-form-row .required {
    color: red;
    font-weight: bold;
    margin-left: 3px;
}
.os-form-row p.description {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
}
.os-error {
    color: red;
    border: 1px solid red;
    padding: 10px;
    margin-bottom: 15px;
    background-color: #ffebeb;
}


/* Specific overrides for labels containing checkboxes/radios */
.os-form-row label.os-checkbox-label {
    display: inline-flex; /* Use flex to align box and text */
    align-items: center;
    font-weight: normal;
    cursor: pointer;
}

.os-form-row label.os-checkbox-label input[type="checkbox"] {
    width: auto; /* Override the 100% width for general inputs */
    margin-right: 8px;
}

/* Form action links (lost password, etc.) */
.os-form-row.os-form-links {
    margin-top: 15px;
    font-size: 0.9em;
}

.os-form-row.os-form-links a {
    margin-right: 10px;
}

.os-form-message {
    padding: 10px 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}
.os-form-message.os-error {
    color: #a94442;
    background-color: #f2dede;
    border-color: #ebccd1;
}
.os-form-message.os-success {
    color: #3c763d;
    background-color: #dff0d8;
    border-color: #d6e9c6;
}


/* Profile Form Styles */

.orgapress-saas-profile-form fieldset {
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 20px;
}
.orgapress-saas-profile-form legend {
    font-weight: bold;
    padding: 0 5px;
    font-size: 1.1em;
}
.orgapress-saas-profile-form table { /* WP profile page uses tables often */
    width: 100%;
    border: none;
    border-collapse: collapse; /* Ensure borders behave */
}
.orgapress-saas-profile-form th,
.orgapress-saas-profile-form td {
    padding: 8px 0; /* Adjust padding */
    border-bottom: 1px solid #f0f0f0; /* Light separator */
}
.orgapress-saas-profile-form tr:last-child th,
.orgapress-saas-profile-form tr:last-child td {
    border-bottom: none;
}
.orgapress-saas-profile-form th {
    text-align: left;
    padding-right: 10px;
    vertical-align: top;
    width: 150px; /* Adjust as needed */
}
.orgapress-saas-profile-form td {
    vertical-align: top;
}
.orgapress-saas-profile-form input[type="text"],
.orgapress-saas-profile-form input[type="email"],
.orgapress-saas-profile-form input[type="url"],
.orgapress-saas-profile-form input[type="password"],
.orgapress-saas-profile-form textarea,
.orgapress-saas-profile-form select {
    width: 100%;
    max-width: 400px; /* Limit width */
    padding: 8px;
    border: 1px solid #ccc;
    box-sizing: border-box;
    margin-bottom: 5px; /* Reduce margin */
}
.orgapress-saas-profile-form textarea {
    min-height: 80px;
}
.orgapress-saas-profile-form .description {
    font-size: 0.9em;
    color: #666;
    display: block;
    margin-top: 3px; /* Reduce margin */
    margin-bottom: 5px;
}
.orgapress-saas-profile-form .submit input[type="submit"] {
     padding: 10px 20px;
     cursor: pointer;
     margin-top: 15px;
}
.orgapress-saas-profile-success {
     color: green;
     border: 1px solid green;
     padding: 10px;
     margin-bottom: 15px;
     background-color: #e6ffe6;
}
.orgapress-saas-profile-error {
    color: red;
    border: 1px solid red;
    padding: 10px;
    margin-bottom: 15px;
    background-color: #ffebeb;
}


/* Account Dashboard Styles */
.orgapress-saas-account-dashboard .os-account-section {
    border: 1px solid #e5e5e5;

    padding: 25px;
    margin-bottom: 30px;
}


#os-billing-address-section .os-address-display-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

#os-billing-address-section .os-address-col p {
    margin: 0 0 10px 0;
    line-height: 1.6;
}

.os-account-section-content.os-2-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

@media (max-width: 768px) {
    .os-account-section-content.os-2-col-grid {
        grid-template-columns: 1fr;
    }
}

.os-account-section .os-grid-col {
    /* styles for columns */
}

#os-subscription-details .subscription-price {
    color: #666;
    margin-bottom: 20px;
}

#os-subscription-details .upgrade-button {
    background-color: #557da1;
    color: white;
    padding: 12px 25px;
    text-decoration: none;
    border-radius: 25px;
    display: inline-block;
    border: none;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}
#os-subscription-details .upgrade-button:hover {
    background-color: #446582;
}


#os-subscription-details .feature-list {
    list-style: none;
    padding: 0;
    margin-top: 20px;
}

#os-subscription-details .feature-list li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    color: #555;
}

#os-subscription-details .feature-list li::before {
    content: '✓';
    color: #28a745; /* Green checkmark */
    font-weight: bold;
    margin-right: 10px;
    font-size: 1.2em;
}

.os-billing-info .bill-item {
    margin-bottom: 20px;
}

.os-billing-info .bill-item .amount {
    font-size: 1.5em;
    font-weight: bold;
    display: inline;
}

.os-billing-info .bill-item .date, .os-billing-info .bill-item .view-bill-link {
    color: #666;
    margin-left: 10px;
}

#os-payment-details .payment-method-card {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f9f9f9;
}
#os-payment-details .payment-method-card .card-info {
    font-family: monospace;
}
#os-payment-details .payment-method-card .card-logo {
    font-size: 0.8em;
    font-weight: bold;
    background-color: #333;
    color: white;
    padding: 4px 8px;
    border-radius: 3px;
    text-transform: uppercase;
}
#os-payment-details .delete-link {
    display: block;
    margin-top: 15px;
    color: #a00;
    text-decoration: none;
    font-size: 0.9em;
}
#os-payment-details .delete-link:hover {
    text-decoration: underline;
}

#os-billing-address .address-field input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    background-color: #f5f5f5; /* Read-only look */
    border-radius: 3px;
    margin-bottom: 10px;
    box-sizing: border-box;
}
#os-billing-address .address-field label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9em;
    color: #555;
}
#os-billing-address .address-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
}
#os-billing-address .address-grid-3 .address-field {
    margin-bottom: 0;
}

#os-billing-history table,
#os-active-subscriptions table {
    width: 100%;
    border-collapse: collapse;
}

#os-billing-history th, #os-billing-history td,
#os-active-subscriptions th, #os-active-subscriptions td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}
#os-billing-history th,
#os-active-subscriptions th {
    font-weight: bold;
    color: #555;
}

#os-active-subscriptions td small {
    color: #666;
    font-size: 0.9em;
}
#os-billing-history .actions-menu a.os-download-link {
    text-decoration: none;
    font-size: 1.4em;
    color: #557da1;
}

#os-billing-history .actions-menu a.os-download-link .dashicons {
    line-height: inherit;
}

/* Member Directory Styles */
.orgapress-saas-member-directory {
    margin-bottom: 20px;
}
.orgapress-saas-member-directory-filters { /* Optional filters */
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f9f9f9;
    border: 1px solid #eee;
}
.orgapress-saas-member-card {
    border: 1px solid #e0e0e0;
    padding: 15px;
    margin-bottom: 15px;
    overflow: hidden; /* Clear floats */
}
.orgapress-saas-member-card img.avatar { /* Profile picture */
    float: left;
    margin-right: 15px;
    max-width: 80px; /* Adjust size */
    height: auto;
    border-radius: 50%; /* Make it round */
}
.orgapress-saas-member-details {
    /* float: left; */ /* Or use flexbox/grid */
}
.orgapress-saas-member-details h4 {
    margin-top: 0;
    margin-bottom: 5px;
}
.orgapress-saas-member-details p {
    margin: 0 0 5px 0;
    font-size: 0.95em;
}
.orgapress-saas-member-details .member-field {
    margin-bottom: 3px;
}
.orgapress-saas-member-details .field-label {
    font-weight: bold;
}

/* Restriction Messages */
.orgapress-saas-login-prompt,
.orgapress-saas-restriction-message {
    border: 1px solid #f0ad4e; /* Warning color */
    padding: 15px;
    margin: 15px 0;
    background-color: #fcf8e3;
    color: #8a6d3b;
    clear: both;
}
.orgapress-saas-login-prompt a,
.orgapress-saas-restriction-message a {
    color: #8a6d3b;
    font-weight: bold;
    text-decoration: underline;
}


/* Checkout Form Specific Styles */
.os-checkout-form .os-checkout-main {
    padding-right: 30px; /* Add space if using columns */
}
.os-checkout-sidebar {
    background-color: #f8f8f8;
    border: 1px solid #e5e5e5;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px; /* Add margin if sidebar appears below main on mobile */
}

.os-checkout-step {
    display: flex;
    margin-bottom: 30px;
    border-bottom: 1px dashed #eee;
    padding-bottom: 20px;
}
.os-checkout-step-number {
    background-color: #557da1; /* Use theme color */
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    font-weight: bold;
    margin-right: 15px;
    flex-shrink: 0; /* Prevent shrinking */
}
.os-checkout-step-content {
    flex-grow: 1;
}
.os-checkout-step-content h2 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.4em;
}

/* Grid for Billing Address */
.os-form-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr); /* 6 columns for more flexibility */
    gap: 15px; /* Space between grid items */
}
.os-form-row.os-form-row-full { grid-column: span 6; }
.os-form-row.os-form-row-half { grid-column: span 3; }
.os-form-row.os-form-row-third { grid-column: span 2; }
.os-form-row.os-form-row-two-thirds { grid-column: span 4; }

/* 2-column grid for register form */
.os-form-grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}


/* Fallback for non-grid browsers or simpler layout */
@supports not (display: grid) {
    .os-form-row { overflow: hidden; margin-left: -1%; margin-right: -1%; }
    .os-form-row-full { width: 98%; float: left; margin: 0 1% 15px 1%; }
    .os-form-row-half { width: 48%; float: left; margin: 0 1% 15px 1%; }
    .os-form-row-third { width: 31.33%; float: left; margin: 0 1% 15px 1%; }
     .os-form-row-two-thirds { width: 64.66%; float: left; margin: 0 1% 15px 1%; }
    .os-form-row::after { content: ""; display: table; clear: both; }
}


/* Payment Methods */
ul.os-payment-methods {
    list-style: none;
    padding: 0;
    margin: 0;
}
li.os-payment-method {
    margin-bottom: 10px;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 3px;
    background-color: #fff;
}
li.os-payment-method label {
    font-weight: bold;
    display: inline-block; /* Keep label next to radio */
    margin-left: 8px;
    cursor: pointer;
}
li.os-payment-method input[type="radio"] {
     margin-right: 5px;
}
.os-payment-description {
    margin-top: 15px;
    padding: 15px;
    background-color: #f9f9f9;
    border-top: 1px dotted #ddd;
}
.os-payment-description .os-form-row {
    margin-bottom: 10px;
}
.os-payment-description p:last-child {
    margin-bottom: 0;
}
.os-payment-description fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

/* Checkout Sidebar */
.os-checkout-summary-box .os-order-summary { margin-bottom: 20px; }
.os-checkout-summary-box .os-order-summary h3 { margin-top: 0; font-size: 1.2em; border-bottom: 1px solid #eee; padding-bottom: 8px; margin-bottom: 10px;}
.os-checkout-summary-box #os-summary-level-name { font-weight: bold; margin-bottom: 5px; font-size: 1.1em; }
.os-checkout-summary-box #os-summary-level-price-display { color: #555; margin-bottom: 15px; }
.os-checkout-summary-box .os-order-summary hr { border: 0; border-top: 1px solid #eee; margin: 15px 0;}
.os-checkout-summary-box .os-order-summary p { margin: 8px 0; display: flex; justify-content: space-between; }
.os-checkout-summary-box .os-order-summary p.os-total { font-weight: bold; font-size: 1.1em; border-top: 1px solid #ddd; padding-top: 10px; margin-top:10px; }
.os-checkout-summary-box .os-order-summary .value { font-weight: bold; }
.os-checkout-summary-box .os-order-summary .os-upgrade-note { font-size: 0.9em; color: #555; display: block; justify-content: flex-start; margin-top: 10px;}
.os-checkout-summary-box .os-order-summary .os-back-link { display: block; margin-top: 15px; text-align: center; }


/* Checkout Terms/Submit */
.os-checkout-terms { margin-top: 20px; }
.os-checkout-terms label { font-weight: normal; }
.os-checkout-submit { margin-top: 20px; padding-top: 20px; border-top: 1px solid #eee;}
#os-checkout-errors { text-align: left; margin-bottom: 15px; }
#os-checkout-submit-button {
    padding: 12px 25px;
    font-size: 1.1em;
    cursor: pointer;
    width: 100%; /* Make button full width */
    /* Add theme button styles */
    background-color: #557da1;
    color: white;
    border: none;
    border-radius: 3px;
}
#os-checkout-submit-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Stripe Element Placeholder */
#stripe-card-element {
    border: 1px solid #ccc;
    padding: 10px 12px;
    border-radius: 3px;
    background-color: white;
}
#stripe-card-errors {
    color: red;
    margin-top: 8px;
    font-size: 0.9em;
}

/* Password Strength Meter */
.password-strength-meter {
    margin-top: 5px;
    padding: 3px 5px;
    font-size: 0.9em;
    border-radius: 3px;
    text-align: center;
}
.password-strength-meter.short,
.password-strength-meter.bad {
    background-color: #f2dede;
    border: 1px solid #ebccd1;
    color: #a94442;
}
.password-strength-meter.good {
    background-color: #fcf8e3;
    border: 1px solid #faebcc;
    color: #8a6d3b;
}
.password-strength-meter.strong {
    background-color: #dff0d8;
    border: 1px solid #d6e9c6;
    color: #3c763d;
}


/* Order Confirmation Modal */
.os-modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 99999; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgb(0,0,0); /* Fallback color */
    background-color: rgba(0,0,0,0.6); /* Black w/ opacity */
}

.os-modal-content {
    background-color: #fefefe;
    margin: 10% auto; /* 10% from the top and centered */
    padding: 20px 30px 30px;
    border: 1px solid #888;
    width: 80%; /* Could be more or less, depending on screen size */
    max-width: 700px;
    position: relative;
    border-radius: 5px;
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
}

.os-modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 5px;
    right: 15px;
}

.os-modal-close:hover,
.os-modal-close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

#os-order-confirmation-content .os-loading-indicator {
    text-align: center;
    font-size: 1.2em;
    padding: 40px 0;
    color: #555;
}

/* Modal Content Details */
#os-order-confirmation-content h3 {
    text-align: center;
    color: #4CAF50; /* Green success color */
    margin-top: 0;
    font-size: 1.5em;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 20px;
}
#os-order-confirmation-content h4 {
    margin-top: 25px;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.os-order-overview {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    background: #f9f9f9;
    border: 1px solid #eee;
    padding: 15px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}
.os-order-overview li {
    flex-basis: 48%;
    margin-bottom: 8px;
}

.os-order-details-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}
.os-order-details-table th, .os-order-details-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}
.os-order-details-table thead th {
    background-color: #f2f2f2;
}
.os-order-details-table tfoot th {
    text-align: right;
    border: none;
    font-weight: bold;
}
.os-order-details-table tfoot td {
     border: none;
}
.os-order-details-table tfoot tr:last-child th,
.os-order-details-table tfoot tr:last-child td {
    font-size: 1.1em;
    border-top: 2px solid #000;
}

.os-customer-details address {
    border-left: 3px solid #eee;
    padding-left: 15px;
    font-style: normal;
    line-height: 1.6;
}

/* Profile Tables */
.os-profile-orders-table,
.os-profile-billing-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.95em;
    border: 1px solid #e0e0e0;
}

.os-profile-orders-table th,
.os-profile-orders-table td,
.os-profile-billing-table th,
.os-profile-billing-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.os-profile-orders-table thead th,
.os-profile-billing-table thead th {
    background-color: #f9f9f9;
    font-weight: bold;
    border-bottom-width: 2px;
    border-bottom-color: #e0e0e0;
}

.os-profile-orders-table tbody tr:hover,
.os-profile-billing-table tbody tr:hover {
    background-color: #f5f5f5;
}

.os-profile-orders-table td a,
.os-profile-billing-table td a {
    text-decoration: none;
    font-weight: bold;
}
.os-profile-orders-table td a:hover,
.os-profile-billing-table td a:hover {
    text-decoration: underline;
}


/* Responsive Adjustments */
/* Remove flex adjustments as they are no longer in the same container */
@media (max-width: 768px) {
     .os-form-grid {
         grid-template-columns: 1fr; /* Stack billing fields on smaller screens */
     }
     .os-form-grid-2-col {
        grid-template-columns: 1fr;
     }
     .os-form-row.os-form-row-half,
     .os-form-row.os-form-row-third,
     .os-form-row.os-form-row-two-thirds {
         grid-column: span 1; /* Make all grid items full width */
     }
}

/* Profile Form New Layout */
.orgapress-saas-profile-form .os-account-section {
    border: 1px solid #e5e5e5;
    padding: 25px;
    margin-bottom: 30px;
}
.orgapress-saas-profile-form .os-account-section h2 {
    font-size: 1.8em;
    font-weight: bold;
    margin-top: 0;
    margin-bottom: 25px;
}

.orgapress-saas-profile-form .os-form-row > label,
.os-billing-info-label, .os-subscription-label, .os-payment-label, .os-billing-label {
    font-size: 0.8em;
    font-weight: bold;
    color: #557da1; /* A blue-grey color from screenshot */
    text-transform: uppercase;
    margin-bottom: 10px;
    display: block;
}


/*
 * Membership List on Profile Page (Account Dashboard)
 * --------------------------------------------------
 */



.os-memberships-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 15px; /* space between cards */
}

.os-membership-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* Better for varying content height */
    padding: 20px;
    border: 1px solid #e0e0e0;
}

.os-membership-card-main {
    flex-grow: 1;
}

.os-membership-level-title {
    background-color: #f3f4f6;
    padding: 5px 10px;
    border-radius: 6px;
    display: inline-block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #111827;
}

.os-membership-level-description {
    font-size: 0.95em;
    margin-bottom: 8px;
    line-height: 1.5;
}

.os-membership-level-price {
    font-weight: bold;
    margin-bottom: 15px;
    font-size: 1.1em;
}



.os-membership-card-aside {
    flex-shrink: 0;
    margin-left: 20px;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.os-status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
    text-transform: capitalize;
    letter-spacing: 0.5px;
}

.os-status-active {
    background-color: #d1fae5;
    color: #065f46;
}

.os-status-expired,
.os-status-cancelled {
    background-color: #fee2e2;
    color: #991b1b;
}

.os-status-pending {
    background-color: #fef9c3;
    color: #854d0e;
}

.os-status-inactive {
    background-color: #e5e7eb;
    color: #374151;
}

.os-cancellation-item .button,
.os-membership-card-aside .orgapress-saas-cancel-subscription.button {
    background-color: #ef4444; /* Red color */
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s;
    font-size: 0.9em;
}

.os-cancellation-item .button:hover,
.os-membership-card-aside .orgapress-saas-cancel-subscription.button:hover {
    background-color: #dc2626; /* Darker red */
}

.os-cancellation-pending-notice {
    font-style: italic;
    color: #6b7280;
    font-size: 0.9em;
    max-width: 200px;
}

.os-memberships-actions {
    margin-top: 25px;
    text-align: center;
}

.os-memberships-actions .button {
    background-color: #4f46e5;
    color: #fff;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    font-size: 1em;
    display: inline-block;
}

.os-memberships-actions .button:hover {
    background-color: #4338ca;
}

/* User Menu Link Styles */
/* This ensures the icon and text inside our dynamic menu links are aligned correctly. */
.menu-item a em {
    display: inline-flex;
    align-items: center;
    vertical-align: middle; /* Better alignment with text */
}

/* User Menu Link Styles */
/* This ensures the icon and text inside our dynamic menu links are aligned correctly. */
.menu-item a em {
    display: inline-flex;
    align-items: center;
    vertical-align: middle; /* Better alignment with text */
}