/**
 * MMAX Admin Styles
 * 
 * Styles for the admin interface of MemberMagix plugin.
 * 
 * @package MemberMagix
 */

/* Member Management Stats Grid */
.mmax-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.mmax-stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mmax-stat-card h3 {
    margin: 0 0 10px 0;
}

.mmax-stat-card h3.total-members {
    color: #2563eb;
}

.mmax-stat-card h3.terms-accepted {
    color: #059669;
}

.mmax-stat-card h3.terms-not-accepted {
    color: #dc2626;
}

.mmax-stat-card p {
    font-size: 24px;
    font-weight: bold;
    margin: 0;
}

/* Member Management Actions */
.mmax-actions {
    margin: 20px 0;
}

/* User Info and Terms Status Cards */
.mmax-user-info,
.mmax-terms-status {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.mmax-terms-status p.terms-accepted {
    color: green;
}

.mmax-terms-status p.terms-not-accepted {
    color: red;
}

.mmax-terms-status form {
    margin-top: 20px;
}

/* Status Icons */
.mmax-status-icon.success {
    color: green;
}

.mmax-status-icon.error {
    color: red;
}

.mmax-status-icon.neutral {
    color: #666;
}

/* Test File Styles (Development Only) */
.mmax-test-container {
    max-width: 400px;
    border: 1px solid #ddd;
    padding: 10px;
    margin: 10px 0;
}

/* ===== DASHBOARD TAB ===== */
.mmax-dashboard {
    max-width: 820px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.mmax-dashboard-hero {
    background: linear-gradient(135deg, #113C46 0%, #1A4F5C 100%);
    border-radius: 16px;
    padding: 32px 36px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    color: #fff;
}

.mmax-dashboard-hero-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    background: rgba(229, 167, 61, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mmax-dashboard-hero-icon .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
    color: #E5A73D;
}

.mmax-dashboard-hero-text h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.01em;
}

.mmax-dashboard-hero-meta {
    margin: 4px 0 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

.mmax-dashboard-hero-meta .mmax-tier-badge {
    display: inline-block;
    background: rgba(229, 167, 61, 0.2);
    color: #F2CA6D;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 9999px;
    margin-left: 6px;
    vertical-align: middle;
}

.mmax-dashboard-tagline {
    margin: 0 0 24px;
}

.mmax-dashboard-tagline-headline {
    margin: 0 0 4px;
    font-size: 17px;
    font-weight: 700;
    color: #1F1F1F;
    letter-spacing: -0.01em;
}

.mmax-dashboard-tagline p {
    margin: 0;
    font-size: 14px;
    color: #1F1F1F;
    opacity: 0.65;
    line-height: 1.65;
}

.mmax-dashboard-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #2BB5A0;
    margin: 0 0 12px;
}

.mmax-steps-list {
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
}

.mmax-steps-list li {
    display: flex;
    gap: 16px;
    background: #fff;
    border: 1px solid #EBE3D8;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 10px;
}

.mmax-step-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: #D4F0EA;
    color: #2BB5A0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}

.mmax-step-body h4 {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: #1F1F1F;
}

.mmax-step-body p {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    color: #1F1F1F;
    opacity: 0.65;
}

.mmax-step-body code {
    background: #D4F0EA;
    color: #1A6B60;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 12px;
}

.mmax-quick-links {
    background: #fff;
    border: 1px solid #EBE3D8;
    border-radius: 14px;
    padding: 20px;
}

.mmax-quick-links h3 {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: #1F1F1F;
}

.mmax-quick-links-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
}

.mmax-quick-links-list .button {
    border-radius: 8px;
}

/* Content Protection Meta Box */
.mmax-protection-settings {
    /* Dynamic display controlled by JavaScript */
}

.mmax-protection-settings.hidden {
    display: none;
}

/* ===== UPGRADE TAB ===== */

/* Container — matches .mmax-dashboard layout */
.mmax-upgrade {
    max-width: 820px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.mmax-upgrade-header {
    margin-bottom: 24px;
}

.mmax-upgrade-header h2 {
    font-size: 17px;
    font-weight: 700;
    color: #1F1F1F;
    margin: 0 0 4px;
    letter-spacing: -0.01em;
}

.mmax-upgrade-header p {
    font-size: 14px;
    color: #1F1F1F;
    opacity: 0.65;
    line-height: 1.65;
    margin: 0;
}

/* Section labels — matches .mmax-dashboard-section-title */
.mmax-upgrade-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #2BB5A0;
    margin: 0 0 12px;
}

.mmax-billing-toggle-wrap {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: #F5F3EF;
    border-radius: 8px;
    padding: 4px;
    width: fit-content;
}

.mmax-billing-toggle {
    background: transparent;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: #1F1F1F;
    opacity: 0.5;
    transition: all 0.15s;
}

.mmax-billing-toggle.active {
    background: #fff;
    color: #1F1F1F;
    opacity: 1;
    box-shadow: 0 1px 3px rgba(45, 60, 50, 0.08);
}

.mmax-save-badge {
    font-size: 11px;
    color: #2BB5A0;
    font-weight: 600;
}

.mmax-plan-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 680px;
    margin: 0 0 32px;
}

.mmax-plan-card {
    background: #fff;
    border: 1px solid #EBE3D8;
    border-radius: 14px;
    padding: 28px 24px;
    text-align: center;
}

.mmax-plan-card-featured {
    border-color: #E5A73D;
    box-shadow: 0 0 0 1px #E5A73D, 0 8px 32px rgba(229, 167, 61, 0.08);
}

.mmax-plan-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1F1F1F;
    margin: 0 0 12px;
}

.mmax-price-amount {
    font-size: 32px;
    font-weight: 700;
    color: #1F1F1F;
}

.mmax-price-period {
    font-size: 14px;
    color: #1F1F1F;
    opacity: 0.45;
}

.mmax-plan-includes {
    font-size: 13px;
    color: #1F1F1F;
    opacity: 0.5;
    margin: 12px 0 4px;
}

.mmax-feature-list {
    list-style: none;
    padding: 0;
    margin: 16px 0 20px;
    text-align: left;
}

.mmax-feature-list li {
    font-size: 13px;
    color: #1F1F1F;
    opacity: 0.75;
    padding: 4px 0 4px 22px;
    position: relative;
}

.mmax-feature-list li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: #2BB5A0;
    font-weight: 700;
    opacity: 1;
}

.mmax-plan-select {
    width: 100%;
    padding: 10px 16px !important;
    font-size: 14px !important;
}

/* Manual key activation */
.mmax-manual-activate {
    max-width: 680px;
    background: #fff;
    border: 1px solid #EBE3D8;
    border-radius: 14px;
    padding: 20px 24px;
}

.mmax-manual-activate p {
    margin: 0 0 10px;
    font-size: 13px;
    color: #1F1F1F;
    opacity: 0.5;
}

.mmax-manual-activate-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.mmax-manual-activate-form .regular-text {
    flex: 1;
    max-width: 360px;
}

/* Checkout view */
.mmax-checkout-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.mmax-checkout-plan-name {
    font-size: 16px;
    font-weight: 600;
    color: #1F1F1F;
}

.mmax-checkout-plan-name::before {
    content: "Upgrading to ";
}

#mmax-checkout {
    max-width: 600px;
    min-height: 300px;
}

.mmax-checkout-footer {
    font-size: 12px;
    color: #1F1F1F;
    opacity: 0.4;
    margin-top: 16px;
    max-width: 600px;
}

/* Center states (checkout loading, activating) */
.mmax-state-center {
    text-align: center;
    padding: 60px 20px;
}

.mmax-state-center .spinner {
    margin: 0 auto 12px;
}

.mmax-state-center p {
    font-size: 15px;
    color: #1F1F1F;
    opacity: 0.5;
}

/* Welcome screen */
.mmax-welcome-box {
    max-width: 520px;
    margin: 0;
    text-align: left;
    padding: 40px 0;
}

.mmax-welcome-icon {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #2BB5A0;
    margin-bottom: 12px;
}

.mmax-welcome-box h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1F1F1F;
    margin: 0 0 8px;
}

.mmax-welcome-box > p {
    font-size: 14px;
    color: #1F1F1F;
    opacity: 0.5;
    margin: 0 0 24px;
}

.mmax-license-key-box {
    background: #F5F3EF;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.mmax-license-key-label {
    font-size: 13px;
    color: #1F1F1F;
    opacity: 0.5;
}

.mmax-license-key-value {
    font-size: 14px;
    font-family: monospace;
    background: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid #EBE3D8;
    word-break: break-all;
}

.mmax-copy-key {
    font-size: 12px !important;
    padding: 4px 12px !important;
}

.mmax-welcome-email-note {
    font-size: 12px;
    color: #1F1F1F;
    opacity: 0.4;
    margin: 0 0 24px;
}

.mmax-welcome-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Error state */
.mmax-error-message {
    font-size: 14px;
    color: #1F1F1F;
    opacity: 0.5;
    margin: 0 0 8px;
}

/* ===== MOST POPULAR BADGE ===== */
.mmax-popular-badge {
    display: inline-block;
    background: #E5A73D;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 12px;
    border-radius: 9999px;
    margin-bottom: 8px;
}

/* ===== TRUST FOOTER ===== */
.mmax-trust-footer {
    font-size: 12px;
    color: #1F1F1F;
    opacity: 0.4;
    margin-top: 20px;
}

/* ===== CURRENT PLAN CARD (States B/C) ===== */
.mmax-current-plan-card {
    background: #fff;
    border: 1px solid #EBE3D8;
    border-radius: 14px;
    padding: 24px;
    max-width: 680px;
    margin: 0 0 24px;
}

.mmax-current-plan-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1F1F1F;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mmax-active-badge {
    display: inline-block;
    background: rgba(229, 167, 61, 0.15);
    color: #CC7E30;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 10px;
    border-radius: 9999px;
}

.mmax-current-plan-card .mmax-license-key-box {
    margin: 0;
}

/* ===== UPSELL CARD (State B) ===== */
.mmax-upsell-card {
    background: #fff;
    border: 2px dashed #E5A73D;
    border-radius: 14px;
    padding: 28px 24px;
    max-width: 680px;
    margin: 0 0 24px;
    text-align: center;
}

.mmax-upsell-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1F1F1F;
    margin: 0 0 8px;
}

.mmax-upsell-intro {
    font-size: 14px;
    color: #1F1F1F;
    opacity: 0.5;
    margin: 0 0 12px;
}

.mmax-upsell-card .mmax-feature-list {
    display: inline-block;
    text-align: left;
    margin: 0 0 20px;
}

.mmax-upsell-price {
    margin-bottom: 16px;
}

.mmax-upsell-card .mmax-billing-toggle-wrap {
    margin-bottom: 16px;
    margin-left: auto;
    margin-right: auto;
}

.mmax-upsell-card .mmax-plan-select {
    max-width: 300px;
}

/* ===== FEATURE COMPARISON TABLE (State A) ===== */
.mmax-comparison-table-wrap {
    max-width: 680px;
    margin: 0 0 32px;
}

.mmax-comparison-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #EBE3D8;
    border-radius: 14px;
    overflow: hidden;
}

.mmax-comparison-table th,
.mmax-comparison-table td {
    padding: 12px 16px;
    text-align: center;
    font-size: 13px;
    border-bottom: 1px solid #F5F3EF;
}

.mmax-comparison-table th:first-child,
.mmax-comparison-table td:first-child {
    text-align: left;
    font-weight: 500;
    color: #1F1F1F;
}

.mmax-comparison-table thead th {
    background: #FBF9F5;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #1F1F1F;
    opacity: 0.45;
}

.mmax-comparison-table thead th.mmax-comparison-highlight {
    color: #E5A73D;
    opacity: 1;
}

.mmax-comparison-table tbody tr:last-child td {
    border-bottom: none;
}

.mmax-comparison-highlight {
    background: rgba(229, 167, 61, 0.04);
}

.mmax-check {
    color: #2BB5A0;
    font-size: 16px;
    font-weight: 700;
}

.mmax-dash {
    color: #E4DFD7;
    font-size: 16px;
}

.mmax-coming-soon td {
    opacity: 0.55;
}

.mmax-soon-label {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    color: #1A6B60;
    background: #D4F0EA;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    vertical-align: middle;
}

/* ===== FEATURE MATRIX (States B/C) ===== */
.mmax-feature-matrix {
    max-width: 680px;
    margin: 0 0 24px;
}

.mmax-feature-matrix h3 {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #2BB5A0;
    margin: 0 0 12px;
}

.mmax-matrix-table th:last-child,
.mmax-matrix-table td:last-child {
    width: 80px;
}

.mmax-icon-muted {
    color: #E4DFD7;
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* ===== LICENSE MANAGEMENT ===== */
.mmax-license-management {
    max-width: 680px;
    padding-top: 16px;
    border-top: 1px solid #EBE3D8;
}

.mmax-deactivate-btn {
    color: #1F1F1F !important;
    opacity: 0.35;
    border-color: #EBE3D8 !important;
}

.mmax-deactivate-btn:hover {
    opacity: 1;
    color: #dc2626 !important;
    border-color: #dc2626 !important;
}

/* ===== REVIEW PROMPT ===== */
.mmax-review-prompt {
    max-width: 680px;
    margin: 0 0 24px;
    background: #FBF9F5;
    border: 1px solid #EBE3D8;
    border-radius: 14px;
    padding: 24px;
    text-align: center;
}

.mmax-review-prompt h4 {
    font-size: 15px;
    font-weight: 700;
    color: #1F1F1F;
    margin: 0 0 6px;
}

.mmax-review-prompt p {
    font-size: 13px;
    color: #1F1F1F;
    opacity: 0.65;
    margin: 0 0 16px;
    line-height: 1.5;
}

.mmax-review-icon {
    display: block;
    font-size: 24px;
    color: #2BB5A0;
    margin-bottom: 8px;
    line-height: 1;
}

.mmax-review-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.mmax-review-link {
    background: none;
    border: none;
    color: #1F1F1F;
    opacity: 0.4;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

.mmax-review-link:hover {
    opacity: 0.65;
}

/* Dashboard banner variant */
.mmax-review-prompt-banner {
    padding: 14px 20px;
    margin-bottom: 24px;
    text-align: left;
    position: relative;
}

.mmax-review-banner-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.mmax-review-prompt-banner .mmax-review-icon {
    display: inline;
    font-size: 18px;
    margin-bottom: 0;
}

.mmax-review-prompt-banner .mmax-review-step-2a,
.mmax-review-prompt-banner .mmax-review-step-2b,
.mmax-review-prompt-banner .mmax-review-step-thanks {
    text-align: center;
}

.mmax-review-dismiss-x {
    background: none;
    border: none;
    font-size: 18px;
    color: #1F1F1F;
    opacity: 0.35;
    cursor: pointer;
    padding: 0 4px;
    margin-left: auto;
    line-height: 1;
}

.mmax-review-dismiss-x:hover {
    opacity: 0.65;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .mmax-stats-grid {
        grid-template-columns: 1fr;
    }

    .mmax-stat-card {
        padding: 15px;
    }

    .mmax-stat-card p {
        font-size: 20px;
    }

    .mmax-plan-cards {
        grid-template-columns: 1fr;
    }

    .mmax-manual-activate-form {
        flex-direction: column;
    }

    .mmax-manual-activate-form .regular-text {
        max-width: 100%;
        width: 100%;
    }

    .mmax-comparison-table th,
    .mmax-comparison-table td {
        padding: 8px 10px;
        font-size: 12px;
    }

    .mmax-upsell-card {
        padding: 20px 16px;
    }

    .mmax-review-banner-content {
        gap: 8px;
    }
}