/* Enhanced Extensions Page Styles - Marketing Psychology UI */
.mds-extensions-page {
    max-width: 1400px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Header Section */
.mds-extensions-header {
    background: #667eea;
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    margin-top: 12px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
}

.mds-extensions-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
    opacity: 0.3;
}

.mds-extensions-header h1 {
    margin: 0 0 10px 0;
    font-size: 2.5em;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.mds-extensions-subtitle {
    font-size: 1.2em;
    opacity: 0.95;
    margin: 0;
    position: relative;
    z-index: 1;
}

.mds-extensions-header-main {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mds-extensions-portal-link {
    position: relative;
    z-index: 1;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.mds-extensions-portal-link:hover,
.mds-extensions-portal-link:focus {
    background: rgba(255, 255, 255, 0.28);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
    transform: translateY(-1px);
}

.mds-extensions-portal-link:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.7);
    outline-offset: 3px;
}

@media (min-width: 768px) {
    .mds-extensions-header {
        flex-direction: row;
        align-items: flex-start;
    }

    .mds-extensions-header-main {
        max-width: 70%;
    }

    .mds-extensions-portal-link {
        margin-left: auto;
    }
}

/* Discovery Banner */
.mds-discovery-banner {
    background: #f093fb;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 30px;
    color: white;
    box-shadow: 0 8px 32px rgba(240, 147, 251, 0.3);
}

.mds-banner-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.mds-banner-text h2 {
    margin: 0 0 10px 0;
    font-size: 1.8em;
    font-weight: 700;
}

.mds-banner-text p {
    margin: 0;
    font-size: 1.1em;
    opacity: 0.95;
}

.mds-banner-stats {
    display: flex;
    gap: 30px;
}

.mds-stat {
    text-align: center;
}

.mds-stat-number {
    display: block;
    font-size: 2.2em;
    font-weight: 800;
    line-height: 1;
}

.mds-stat-label {
    font-size: 0.9em;
    opacity: 0.9;
    margin-top: 5px;
}

/* Extension Cards */
.mds-available-grid {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.mds-extension-card {
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 18px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    width: 100%;
}

.mds-extension-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #667eea;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.mds-extension-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
    border-color: #667eea;
}

.mds-extension-card:hover::before {
    transform: scaleX(1);
}

.mds-extension-card.loading {
    opacity: 0.7;
    pointer-events: none;
}

.mds-extension-card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid #f3f4f6;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.mds-extension-card--premium::before {
    background: #f472b6;
}

.mds-extension-card--installed {
    border-color: #c7d2fe;
}

.mds-card-header {
    padding: 26px 28px 18px;
    background: rgba(102, 126, 234, 0.08);
    border-bottom: 1px solid rgba(102, 126, 234, 0.12);
}

.mds-card-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.mds-card-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.mds-card-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 10px;
    position: relative;
    min-width: 0;
    margin-left: auto;
    flex-shrink: 0;
}

.mds-card-version-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 14px;
}

.mds-version-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 13px;
    font-weight: 600;
    border-radius: 999px;
    padding: 6px 12px;
    line-height: 1.2;
}

.mds-version-pill .mds-version-label {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 11px;
    opacity: 0.75;
}

.mds-card-version-meta.is-outdated .mds-version-installed {
    background: #fee2e2;
    color: #991b1b;
}

.mds-card-version-meta.is-outdated .mds-version-available {
    background: #fef3c7;
    color: #92400e;
}

.mds-update-hint {
    font-size: 12px;
    color: #4b5563;
    margin: 8px 0 0;
}

.mds-card-header-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.mds-card-header-buttons .button {
    min-width: 140px;
    text-align: center;
    border-radius: 999px;
    padding: 8px 18px;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mds-card-header-buttons .button.button-primary {
    background: #10b981;
    border: none;
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(16, 185, 129, 0.35);
}

.mds-card-header-buttons .button.button-primary:hover,
.mds-card-header-buttons .button.button-primary:focus {
    background: #0f9f7c;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(16, 185, 129, 0.45);
}

.mds-card-header-buttons:not(.mds-card-license-buttons) > .button.button-secondary:not(.mds-activate-extension),
.mds-card-header-buttons:not(.mds-card-license-buttons) > .button.button-secondary:not(.mds-activate-extension):disabled,
.mds-card-header-buttons:not(.mds-card-license-buttons) > .button.button-secondary:not(.mds-activate-extension)[disabled] {
    background: #f8fafc !important;
    border: 1px solid #d7e3f8;
    color: #0f172a !important;
}

.mds-card-header-buttons:not(.mds-card-license-buttons) > .button.button-secondary:not(.mds-activate-extension):hover,
.mds-card-header-buttons:not(.mds-card-license-buttons) > .button.button-secondary:not(.mds-activate-extension):focus {
    background: #e2e8f0;
    border-color: #cbd5f5;
    color: #0f172a;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.mds-card-header-buttons .mds-activate-extension {
    background: #22c55e;
    border: none;
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(34, 197, 94, 0.32);
}

.mds-card-header-buttons .mds-activate-extension:hover,
.mds-card-header-buttons .mds-activate-extension:focus {
    background: #16a34a;
    box-shadow: 0 16px 34px rgba(22, 163, 74, 0.48);
    color: #ffffff;
    transform: translateY(-2px);
}

.mds-card-header-buttons .mds-activate-extension:disabled,
.mds-card-header-buttons .mds-activate-extension[disabled],
.mds-card-header-buttons .mds-activate-extension.mds-btn-loading {
    background: #86efac;
    color: rgba(255, 255, 255, 0.9);
    box-shadow: none;
    transform: none;
}

.mds-card-header-buttons .mds-ext-active {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 8px 18px;
    background: #f1f5f9;
    border: 1px solid #d7e3f8;
    color: #475569;
    font-weight: 600;
}

.mds-card-license-trigger {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}


.mds-card-license-buttons {
    display: flex;
    justify-content: flex-end;
}

.mds-card-license-buttons .button {
    background: #3b82f6;
    border: none;
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(59, 130, 246, 0.28);
}

.mds-card-license-buttons .button:hover,
.mds-card-license-buttons .button:focus {
    background: #2563eb;
    box-shadow: 0 14px 32px rgba(37, 99, 235, 0.45);
    color: #ffffff;
}

.mds-card-license-popover {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: #ffffff;
    border: 1px solid #d7e3f8;
    border-radius: 14px;
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.18);
    padding: 20px 22px;
    min-width: 300px;
    max-width: 460px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 20;
}

.mds-card-license-popover .mds-inline-license {
    width: 100%;
}

.mds-card-license-popover::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 18px;
    width: 16px;
    height: 16px;
    background: #ffffff;
    border-left: 1px solid #d7e3f8;
    border-top: 1px solid #d7e3f8;
    transform: rotate(45deg);
    z-index: 0;
}

.mds-card-license-popover[hidden] {
    display: none !important;
}

.mds-card-title-heading {
    display: inline-flex;
    align-items: baseline;
    gap: 0.45rem;
    font-size: 1.3rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.mds-card-title-version {
    font-size: 0.95rem;
    font-weight: 600;
    color: #475569;
}

html.dark .mds-card-header {
    background: rgba(30, 41, 59, 0.7);
    border-bottom-color: rgba(99, 102, 241, 0.25);
}

html.dark .mds-card-header-buttons .button.button-primary {
    box-shadow: 0 12px 28px rgba(20, 184, 166, 0.4);
}

html.dark .mds-card-header-buttons .button.button-primary:hover,
html.dark .mds-card-header-buttons .button.button-primary:focus {
    box-shadow: 0 18px 36px rgba(20, 184, 166, 0.55);
}

html.dark .mds-card-header-buttons:not(.mds-card-license-buttons) .mds-activate-extension,
html.dark .mds-card-header-buttons .mds-activate-extension {
    background: #16a34a;
    box-shadow: 0 12px 28px rgba(22, 163, 74, 0.42);
}

html.dark .mds-card-header-buttons:not(.mds-card-license-buttons) .mds-activate-extension:hover,
html.dark .mds-card-header-buttons:not(.mds-card-license-buttons) .mds-activate-extension:focus,
html.dark .mds-card-header-buttons .mds-activate-extension:hover,
html.dark .mds-card-header-buttons .mds-activate-extension:focus {
    background: #15803d;
    box-shadow: 0 16px 34px rgba(22, 163, 74, 0.52);
}

html.dark .mds-card-header-buttons:not(.mds-card-license-buttons) .mds-activate-extension:disabled,
html.dark .mds-card-header-buttons:not(.mds-card-license-buttons) .mds-activate-extension[disabled],
html.dark .mds-card-header-buttons:not(.mds-card-license-buttons) .mds-activate-extension.mds-btn-loading,
html.dark .mds-card-header-buttons .mds-activate-extension:disabled,
html.dark .mds-card-header-buttons .mds-activate-extension[disabled],
html.dark .mds-card-header-buttons .mds-activate-extension.mds-btn-loading {
    background: #4ade80;
    color: rgba(255, 255, 255, 0.92);
}

html.dark .mds-inline-license-actions .mds-inline-license-activate {
    background: #16a34a;
    box-shadow: 0 12px 28px rgba(22, 163, 74, 0.42);
}

html.dark .mds-inline-license-actions .mds-inline-license-activate:hover,
html.dark .mds-inline-license-actions .mds-inline-license-activate:focus {
    background: #15803d;
    box-shadow: 0 16px 34px rgba(22, 163, 74, 0.52);
}

html.dark .mds-inline-license-actions .mds-inline-license-remove {
    background: #ea580c;
    box-shadow: 0 12px 28px rgba(234, 88, 12, 0.42);
}

html.dark .mds-inline-license-actions .mds-inline-license-remove:hover,
html.dark .mds-inline-license-actions .mds-inline-license-remove:focus {
    background: #c2410c;
    box-shadow: 0 16px 34px rgba(194, 65, 12, 0.52);
}

html.dark .mds-inline-license-actions .mds-inline-license-remove:disabled,
html.dark .mds-inline-license-actions .mds-inline-license-remove[disabled] {
    background: #fb923c;
    color: rgba(255, 255, 255, 0.85);
}

html.dark .mds-card-license-buttons .button {
    background: #1d4ed8;
    color: #e0e7ff;
    box-shadow: 0 12px 30px rgba(30, 64, 175, 0.45);
}

html.dark .mds-card-license-buttons .button:hover,
html.dark .mds-card-license-buttons .button:focus {
    background: #1e40af;
    color: #f8fafc;
    box-shadow: 0 16px 36px rgba(30, 64, 175, 0.55);
}

html.dark .mds-cancel-auto-renew {
    background: rgba(148, 163, 184, 0.18);
    border: 1px solid rgba(148, 163, 184, 0.45);
    color: #e2e8f0;
}

html.dark .mds-cancel-auto-renew:hover,
html.dark .mds-cancel-auto-renew:focus {
    background: rgba(148, 163, 184, 0.32);
    border-color: rgba(148, 163, 184, 0.65);
    color: #f8fafc;
}

html.dark .mds-cancel-auto-renew:disabled,
html.dark .mds-cancel-auto-renew[disabled] {
    background: rgba(148, 163, 184, 0.16);
    border-color: rgba(148, 163, 184, 0.35);
    color: rgba(226, 232, 240, 0.65);
}

html.dark .mds-card-license-popover {
    background: rgba(15, 23, 42, 0.98);
    border-color: #4338ca;
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.5);
}

html.dark .mds-card-license-popover::before {
    background: rgba(15, 23, 42, 0.98);
    border-color: #4338ca;
}

html.dark .mds-card-title-heading {
    color: #e2e8f0;
}

html.dark .mds-card-title-version {
    color: #cbd5f5;
}

.mds-card-body {
    padding: 22px 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Enhanced Buttons */
.mds-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.mds-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.mds-btn:hover:before {
    left: 100%;
}

.mds-btn-primary {
    background: #667eea;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.mds-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.mds-btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.mds-btn-secondary:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.mds-btn-active {
    background: #10b981;
    color: white;
    cursor: default;
}

.mds-btn-small {
    padding: 8px 16px;
    font-size: 0.8em;
}

.mds-btn-icon {
    font-size: 1.1em;
}

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced Notices */
.mds-enhanced-notice {
    border-left: 4px solid #667eea;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    margin: 15px 0;
}

.mds-notice-icon {
    font-size: 1.2em;
    margin-right: 8px;
}

/* Loading states for buttons */
.mds-btn-loading {
    position: relative;
    color: transparent !important;
}

.mds-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Hover effects */
.hover-effect {
    transform: translateY(-2px) !important;
}

/* Pulse glow for featured items */
.pulse-glow {
    animation: pulse-glow 3s infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
    50% { box-shadow: 0 8px 25px rgba(102,126,234,0.3); }
}

/* Changelog styling */
.mds-changelog {
    background: #f8f9fa;
    border-left: 3px solid #1a73e8;
    padding: 8px 12px;
    margin: 8px 0;
    border-radius: 4px;
    font-size: 0.9em;
}

.mds-no-updates {
    color: #2e7d2e;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mds-banner-content {
        flex-direction: column;
        text-align: center;
    }
    
    .mds-banner-stats {
        justify-content: center;
    }
}


/* Table compatibility for existing functionality */
.mds-extensions-container {
    margin-top: 20px;
}

.mds-update-available {
    margin: 5px 0;
}

.mds-card-update-panel {
    margin-top: 12px;
    font-size: 13px;
    color: #0f172a;
}

.mds-card-update-panel .mds-update-available {
    margin: 0;
    border: 1px solid #dbeafe;
    background: #eff6ff;
    border-radius: 8px;
    padding: 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.mds-card-update-panel .mds-update-available p {
    margin: 0 0 8px 0;
}

.mds-card-update-panel .mds-update-available p:last-child {
    margin-bottom: 0;
}

.mds-card-update-panel .mds-no-updates {
    display: inline-block;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    color: #475569;
}

.mds-card-header-updates {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.mds-card-update-panel .mds-update-status {
    margin: 0 0 12px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    border: 1px solid transparent;
    background: #f8fafc;
    color: #475569;
}

.mds-card-update-panel .mds-update-status:last-child {
    margin-bottom: 0;
}

.mds-card-update-panel .mds-update-status.is-success {
    background: #dcfce7;
    border-color: rgba(16, 185, 129, 0.35);
    color: #047857;
}

.mds-card-update-panel .mds-update-status.is-warning {
    background: #fef3c7;
    border-color: rgba(234, 179, 8, 0.35);
    color: #b45309;
}

.mds-card-update-panel .mds-update-status.is-error {
    background: #fee2e2;
    border-color: rgba(248, 113, 113, 0.35);
    color: #b91c1c;
}

.mds-card-update-panel .mds-update-status.is-info {
    background: #e0f2fe;
    border-color: rgba(59, 130, 246, 0.35);
    color: #1d4ed8;
}

.mds-card-header-updates .button {
    min-width: 140px;
}

.mds-card-header-updates .mds-check-updates {
    background: #3b82f6;
    border: none;
    border-radius: 999px;
    box-shadow: 0 10px 24px rgba(59, 130, 246, 0.28);
    color: #ffffff;
    font-weight: 600;
    padding: 8px 18px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mds-card-header-updates .mds-check-updates:hover,
.mds-card-header-updates .mds-check-updates:focus {
    background: #2563eb;
    box-shadow: 0 14px 32px rgba(37, 99, 235, 0.45);
    color: #ffffff;
    transform: translateY(-2px);
}

.mds-card-header-updates .mds-check-updates:disabled,
.mds-card-header-updates .mds-check-updates[disabled],
.mds-card-header-updates .mds-check-updates.mds-btn-loading {
    background: #93c5fd;
    box-shadow: none;
    color: #f8fafc;
    cursor: not-allowed;
    opacity: 0.9;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .mds-card-header-updates .mds-check-updates {
        transition: none;
    }
}

@media (prefers-color-scheme: dark) {
    .mds-card-header-updates .mds-check-updates {
        background: #60a5fa;
    }

    .mds-card-header-updates .mds-check-updates:hover,
    .mds-card-header-updates .mds-check-updates:focus {
        background: #3b82f6;
    }

    .mds-card-header-updates .mds-check-updates:disabled,
    .mds-card-header-updates .mds-check-updates[disabled],
    .mds-card-header-updates .mds-check-updates.mds-btn-loading {
        background: #1d4ed8;
        color: #dbeafe;
    }

    .mds-card-update-panel .mds-update-status {
        background: rgba(30, 41, 59, 0.72);
        border-color: rgba(148, 163, 184, 0.4);
        color: #e2e8f0;
    }

    .mds-card-update-panel .mds-update-status.is-success {
        background: rgba(22, 101, 52, 0.6);
        border-color: rgba(16, 185, 129, 0.45);
        color: #bbf7d0;
    }

    .mds-card-update-panel .mds-update-status.is-warning {
        background: rgba(113, 63, 18, 0.62);
        border-color: rgba(234, 179, 8, 0.45);
        color: #fde68a;
    }

    .mds-card-update-panel .mds-update-status.is-error {
        background: rgba(127, 29, 29, 0.62);
        border-color: rgba(248, 113, 113, 0.45);
        color: #fecaca;
    }

    .mds-card-update-panel .mds-update-status.is-info {
        background: rgba(30, 64, 175, 0.58);
        border-color: rgba(96, 165, 250, 0.45);
        color: #dbeafe;
    }
}

.mds-card-license-actions {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mds-card-license-actions .button {
    margin: 0;
}

.mds-plan-current-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: space-between;
}

.mds-plan-current-wrap .mds-plan-current {
    flex: 1 1 180px;
    width: auto;
    justify-content: flex-start;
    text-align: left;
    padding: 10px 16px;
}

.mds-plan-current-wrap .mds-cancel-auto-renew {
    flex: 0 0 auto;
    width: auto;
}

@media (max-width: 640px) {
  .mds-plan-current-wrap {
    flex-direction: column;
    align-items: stretch;
  }

  .mds-plan-current-wrap .mds-plan-current {
    text-align: center;
    justify-content: center;
  }

  .mds-plan-current-wrap .mds-cancel-auto-renew {
    width: 100%;
  }
}

.mds-status-active {
    color: #00a32a;
    font-weight: bold;
}

.mds-status-inactive {
    color: #d63638;
}

.mds-status-installed {
    color: #00a32a;
    font-weight: bold;
}

.mds-type-premium {
    color: #d63638;
    font-weight: bold;
}

.mds-type-free {
    color: #00a32a;
    font-weight: bold;
}

.description {
    color: #666;
    font-size: 13px;
    font-style: italic;
}

.mds-extension-name strong {
    display: block;
    margin-bottom: 4px;
}

/* Align section headings with WP Admin aesthetic */
.mds-extensions-container h1,
.mds-extensions-container h2 {
    color: #1d2327;
    font-weight: 600;
    margin: 0 0 12px 0;
}

/* Inline update text style moved from PHP inline styles */
.mds-update-available-text {
    color: #d63638;
    font-size: 12px;
    font-style: italic;
}
/* Disabled Active badge styling for consistent appearance with server-rendered state */
.mds-ext-active[disabled],
.mds-ext-active[disabled="disabled"] {
    opacity: 0.7;
    cursor: default;
}
/* Heading color overrides for WP admin consistency */
.mds-extensions-page .mds-extensions-header h1 {
    color: #1d2327;
    font-weight: 600;
    margin-bottom: 12px;
}

.mds-extensions-page .mds-extensions-header .mds-extensions-subtitle {
    color: #3c434a;
}

.mds-extensions-page .mds-discovery-banner h2 {
    color: #1d2327;
    font-weight: 600;
    margin-bottom: 12px;
}

.mds-extensions-page .mds-discovery-banner p {
    color: #3c434a;
}
.mds-extensions-page .mds-extensions-header h1 { color: #1d2327; font-weight: 600; margin-bottom: 12px; }
.mds-extensions-page .mds-extensions-header .mds-extensions-subtitle { color: #3c434a; }
.mds-extensions-page .mds-discovery-banner .mds-banner-text h2 { color: #1d2327; font-weight: 600; margin-bottom: 12px; }
.mds-extensions-page .mds-discovery-banner .mds-banner-text p { color: #3c434a; }

/* Accessible header and banner overrides (placed after prior heading rules) */
.mds-extensions-page .mds-extensions-header { background: #1e3a8a; }
.mds-extensions-page .mds-extensions-header h1 { color: #ffffff; font-weight: 700; margin-bottom: 8px; }

/* --- License UI: Manage toggle + input sizing --- */
.dashicons {
    vertical-align: middle;
}

.mds-visibility-toggle.button-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #1d2327;
}

.mds-visibility-toggle .dashicons {
    font-size: 18px;
}

/* Manage toggle */
.mds-license-cell {
    position: relative;
    vertical-align: middle;
}

.mds-manage-license-toggle.button-link {
    padding: 0;
    border: none;
    background: none;
    color: #2271b1;
    cursor: pointer;
}

.mds-manage-license-toggle.button-link:hover,
.mds-manage-license-toggle.button-link:focus {
    color: #135e96;
    text-decoration: underline;
}

.mds-license-manage-content {
    display: none; /* hidden by default; toggled via JS */
    margin-top: 6px;
}

.mds-license-manage-content.is-open {
    display: inline-block; /* inline within table cell */
}

.mds-inline-license {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
}

.mds-inline-license-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    flex-wrap: wrap;
}

.mds-inline-license-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.mds-inline-license-actions .mds-inline-license-activate {
    background: #22c55e;
    border: none;
    border-radius: 999px;
    color: #ffffff;
    font-weight: 600;
    padding: 8px 18px;
    box-shadow: 0 10px 24px rgba(34, 197, 94, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.mds-inline-license-actions .mds-inline-license-activate:hover,
.mds-inline-license-actions .mds-inline-license-activate:focus {
    background: #16a34a;
    box-shadow: 0 14px 32px rgba(22, 163, 74, 0.45);
    transform: translateY(-1px);
    color: #ffffff;
}

.mds-inline-license-actions .mds-inline-license-activate:disabled,
.mds-inline-license-actions .mds-inline-license-activate[disabled] {
    background: #86efac;
    box-shadow: none;
    color: rgba(255, 255, 255, 0.85);
    cursor: default;
    transform: none;
}

.mds-inline-license-actions .mds-inline-license-activate.mds-btn-loading {
    color: rgba(255, 255, 255, 0.88) !important;
}

.mds-inline-license-actions .mds-inline-license-remove {
    background: #f97316;
    border: none;
    border-radius: 999px;
    color: #ffffff;
    font-weight: 600;
    padding: 8px 18px;
    box-shadow: 0 10px 24px rgba(249, 115, 22, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mds-inline-license-actions .mds-inline-license-remove:hover,
.mds-inline-license-actions .mds-inline-license-remove:focus {
    background: #ea580c;
    box-shadow: 0 14px 32px rgba(234, 88, 12, 0.45);
    transform: translateY(-1px);
    color: #ffffff;
}

.mds-inline-license-actions .mds-inline-license-remove:disabled,
.mds-inline-license-actions .mds-inline-license-remove[disabled] {
    background: #fb923c;
    box-shadow: none;
    color: rgba(255, 255, 255, 0.85);
    transform: none;
}

.mds-inline-license-actions .mds-inline-license-remove {
    margin-left: auto;
}

.mds-license-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.mds-license-actions .mds-remove-license {
    margin-left: auto;
}

.mds-inline-license .mds-inline-license-key,
.mds-license-form input[name="license_key"] {
    flex: 1 1 240px;
    width: 100%;
    max-width: 100%;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    padding: 10px 14px;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

.mds-inline-license-eye {
    width: 32px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Prevent action buttons from overlapping license inputs on narrow widths */
@media (max-width: 900px) {
    .mds-inline-license .mds-inline-license-key,
    .mds-license-form input[name="license_key"] {
        flex: 1 1 100%;
        width: 100%;
        max-width: 100%;
    }
}
.mds-extensions-page .mds-extensions-header .mds-extensions-subtitle { color: #e5e7eb; }
.mds-extensions-page .mds-discovery-banner { background: #2563eb; }
.mds-extensions-page .mds-discovery-banner .mds-banner-text h2 { color: #ffffff; font-weight: 700; margin-bottom: 8px; }
.mds-extensions-page .mds-discovery-banner .mds-banner-text p { color: #e5e7eb; }
.mds-extensions-page .mds-discovery-banner a,
.mds-extensions-page .mds-extensions-header a { color: #ffffff; text-decoration: none; }

/* Full-width CTA styling (used on main admin page) */
.mds-cta-full { display: block; width: 100%; padding: 16px 20px; border-radius: 6px; background: #1e3a8a; color: #fff; }
.mds-cta-full h2 { margin: 0 0 6px; color: #fff; }
.mds-cta-full p { margin: 0 0 8px; color: #e5e7eb; }
.mds-cta-full .button.button-primary { background: #16a34a; border-color: #16a34a; }

/* Ensure notices are readable on gradient headers */
/* Removed styling of WordPress notices inside header to preserve standard admin notice layout */

/* Top-of-page license notice positioning and visibility - keep in normal flow */
.mds-license-notice-top {
  margin: 15px 0 !important;
}

/* Guard: keep WP admin notices in standard flow and clickable */
body.wp-admin .wrap > .notice {
  display: block !important;
  float: none !important;
  clear: both !important;
  position: static !important;
  z-index: auto !important;
  margin: 15px 0 !important;
  color: #1d2327 !important; /* WP admin text color */
  background-color: #fff !important; /* standard notice bg */
}
body.wp-admin .wrap > .notice a {
  color: #2271b1 !important;
  text-decoration: underline;
}
body.wp-admin .wrap > .notice .mds-go-to-system { pointer-events: auto; }

/* Header should not overlay or capture notices */
.mds-extensions-page .mds-extensions-header {
  position: relative;
  z-index: 0;
  margin-top: 16px;
  color: inherit; /* do not force white on descendants */
}
/* Prevent header styles from affecting nested notices if they still get wrapped for any reason */
.mds-extensions-header .notice {
  color: #1d2327 !important;
  background-color: #fff !important;
}

/* Manage modal plan selection: indicate current plan */
.mds-current-plan-indicator {
  color: #6b7280; /* gray-500 */
  font-style: italic;
  font-size: 12px;
  margin-left: 6px;
}

.mds-card-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.mds-card-description {
  margin: 0;
  color: #425466;
  font-size: 0.98rem;
  line-height: 1.6;
}

.mds-card-pricing {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  width: 100%;
  align-items: stretch;
}

.mds-plan-tabs { display: flex; flex-direction: column; gap: 1.25rem; margin-top: 12px; }
.mds-plan-tablist { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.mds-plan-tab { border: 1px solid #cbd5f5; background: #eef2ff; color: #1e293b; border-radius: 999px; padding: 6px 16px; font-weight: 600; cursor: pointer; transition: all 0.2s ease; }
.mds-plan-tab:hover { background: #2563eb; border-color: #2563eb; color: #ffffff; }
.mds-plan-tab.is-active { background: #2563eb; border-color: #2563eb; color: #ffffff; box-shadow: 0 14px 26px rgba(37, 99, 235, 0.28); }
.mds-plan-tabpanels { border: 1px solid #d7e3f8; border-radius: 18px; background: #ffffff; padding: 20px; }
.mds-plan-tabpanel { display: none; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.mds-plan-tabpanel.is-active { display: grid; }

.mds-card-pricing--empty {
  background: #f8fafc;
  border: 1px dashed #cbd5f5;
  padding: 18px 20px;
  border-radius: 12px;
  color: #475569;
  font-size: 0.95rem;
}

.mds-plan-card {
  position: relative;
  background: #ffffff;
  border: 1px solid #d7e3f8;
  border-radius: 18px;
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
  transition: box-shadow 0.25s ease, background 0.25s ease;
}

.mds-plan-card__header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 6px; }
.mds-plan-card__heading { display: flex; flex-direction: column; gap: 4px; }
.mds-plan-card__plan { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: #64748b; }
.mds-plan-chipset { display: flex; flex-wrap: wrap; gap: 6px; }
.mds-plan-chip { display: inline-flex; align-items: center; justify-content: center; padding: 4px 10px; border-radius: 999px; font-size: 0.7rem; font-weight: 600; background: #e2e8f0; color: #1e293b; text-transform: uppercase; letter-spacing: 0.04em; }
.mds-plan-chip--primary { background: #6366f1; color: #ffffff; }
.mds-plan-card.is-muted { opacity: 0.7; }
.mds-plan-features-empty { border: 1px dashed #cbd5f5; border-radius: 12px; padding: 18px; text-align: center; color: #475569; font-size: 0.9rem; }

.mds-plan-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(99, 102, 241, 0.08);
  opacity: 0;
  transition: opacity 0.25s ease;
  border-radius: inherit;
  z-index: 0;
}

.mds-plan-card > * {
  position: relative;
  z-index: 1;
}

.mds-plan-card {
  transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
}

.mds-plan-card:hover::before {
  opacity: 0.7;
}

.mds-plan-card.is-highlighted {
  border-color: #6366f1;
  box-shadow: 0 32px 60px rgba(79, 70, 229, 0.28);
  transform: translateY(-8px);
}

.mds-plan-card.is-highlighted::before {
  opacity: 1;
}

.mds-plan-card.is-highlighted .mds-plan-actions .mds-purchase-extension {
  box-shadow: 0 22px 44px rgba(99, 102, 241, 0.45);
}

.mds-plan-card.is-highlighted .mds-plan-title {
  color: #312e81;
}

@media (hover: hover) {
  .mds-plan-card.is-highlighted:hover {
    box-shadow: 0 36px 70px rgba(79, 70, 229, 0.32);
  }
}

.mds-plan-actions .button,
.mds-plan-actions .mds-plan-current,
.mds-plan-actions .mds-plan-locked {
  width: 100%;
  text-align: center;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
}

.mds-plan-actions .mds-plan-current,
.mds-plan-actions .mds-plan-locked {
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.mds-plan-actions .mds-plan-current {
  background: #f8fafc;
  border: 1px solid #d7e3f8;
  color: #0f172a;
  cursor: default;
}

.mds-plan-actions .mds-plan-locked {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #64748b;
  cursor: not-allowed;
  opacity: 0.75;
}

.mds-cancel-auto-renew {
  background: #f8fafc;
  border: 1px solid #d7e3f8;
  border-radius: 999px;
  color: #1f2937;
  font-weight: 600;
  padding: 10px 20px;
  box-shadow: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.mds-cancel-auto-renew:hover,
.mds-cancel-auto-renew:focus {
  background: #ecf2ff;
  border-color: #c3d4f7;
  color: #1f2937;
}

.mds-cancel-auto-renew:disabled,
.mds-cancel-auto-renew[disabled] {
  background: #f1f5f9;
  border-color: #d7e3f8;
  color: rgba(31, 41, 55, 0.6);
}

.mds-plan-placeholder {
  margin: 0;
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.5;
}

@media (min-width: 960px) {
  .mds-plan-actions .button,
  .mds-plan-actions .mds-plan-current,
  .mds-plan-actions .mds-plan-locked {
    width: auto;
    min-width: 180px;
  }
}

html.dark .mds-plan-card {
  background: rgba(30, 41, 59, 0.9);
  border-color: #4c51bf;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.55);
}

html.dark .mds-plan-card::before {
  background: rgba(129, 140, 248, 0.18);
}

html.dark .mds-plan-tab { background: #162136; border-color: #293548; color: #cbd5f5; }
html.dark .mds-plan-tab:hover { background: #4f46e5; border-color: #4f46e5; color: #ffffff; }
html.dark .mds-plan-tab.is-active { background: #4f46e5; border-color: #4f46e5; color: #ffffff; box-shadow: 0 16px 30px rgba(79, 70, 229, 0.35); }
html.dark .mds-plan-tabpanels { background: #0f172a; border-color: #1f2937; }
html.dark .mds-plan-card__plan { color: #94a3b8; }
html.dark .mds-plan-chip { background: #1f2a3d; color: #cbd5f5; }
html.dark .mds-plan-chip--primary { background: #6366f1; color: #ffffff; }
html.dark .mds-plan-features-empty { background: #101d33; border-color: #24324d; color: #cbd5f5; }

.mds-plan-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #1e293b;
}

html.dark .mds-plan-title {
  color: #e2e8f0;
}

.mds-plan-pricing {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  font-weight: 600;
}

.mds-plan-price {
  font-size: 1.1rem;
  color: #0f172a;
}

.mds-plan-price--sale {
  color: #be185d;
}

.mds-plan-price--compare {
  font-size: 0.9rem;
  color: #64748b;
  text-decoration: line-through;
}

.mds-plan-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(190, 24, 93, 0.12);
  color: #9d174d;
  font-size: 0.75rem;
  font-weight: 600;
}

.mds-plan-tiers {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #334155;
  font-size: 0.9rem;
}

.mds-plan-tiers li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.35);
  padding-bottom: 6px;
}

.mds-plan-tiers li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.mds-plan-tier-label {
  font-weight: 600;
}

.mds-plan-tier-price {
  font-weight: 600;
  color: #0f172a;
}

html.dark .mds-plan-tiers {
  color: #cbd5f5;
}

html.dark .mds-plan-tier-price {
  color: #e2e8f0;
}

html.dark .mds-plan-tiers li {
  border-color: rgba(148, 163, 184, 0.25);
}

.mds-plan-features {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  color: #475569;
  font-size: 0.95rem;
}

html.dark .mds-plan-features {
  color: #dbeafe;
}

.mds-plan-features li {
  position: relative;
  padding-left: 20px;
  margin: 0;
}

.mds-plan-features li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  top: 0;
  color: #10b981;
  font-weight: 700;
}

html.dark .mds-plan-features li::before {
  color: #34d399;
}

.mds-plan-options .mds-plan-option {
  background: #f8fafc;
  border: 1px solid #d0dbea;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.mds-plan-option-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 6px;
}

.mds-plan-option-header input[type="radio"] {
  margin: 0;
}

.mds-plan-option-body {
  margin-left: 28px;
}

.mds-plan-option-body .mds-plan-features {
  margin: 0;
}

.mds-plan-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: auto;
}

.mds-plan-actions .button {
  width: 100%;
  text-align: center;
}

.mds-plan-actions .mds-purchase-extension {
  background: #4f46e5;
  border: none;
  border-radius: 12px;
  color: #fff;
  font-weight: 600;
  padding: 12px 22px;
  box-shadow: 0 16px 36px rgba(99, 102, 241, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

@media (hover: hover) {
  .mds-plan-actions .mds-purchase-extension:hover {
    box-shadow: 0 22px 44px rgba(99, 102, 241, 0.4);
  }
}

.mds-plan-actions .mds-purchase-extension:focus-visible {
  outline: 3px solid #7c3aed;
  outline-offset: 2px;
}

@media (min-width: 960px) {
  .mds-plan-actions .mds-purchase-extension {
    width: auto;
    min-width: 180px;
  }
}

html.dark .mds-plan-actions .mds-purchase-extension {
  background: #6366f1;
  box-shadow: 0 16px 36px rgba(79, 70, 229, 0.55);
}

.mds-plan-feedback {
  min-height: 0.75rem;
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.4;
}

.mds-plan-feedback.is-error {
  color: #b91c1c;
}

.mds-plan-feedback.is-success {
  color: #0f766e;
}

.mds-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.mds-card-actions .button {
  min-width: 140px;
}

.mds-license-required-note {
  display: inline-block;
  margin-left: 8px;
  font-size: 0.85rem;
  color: #64748b;
}

.mds-license-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(226, 232, 240, 0.78);
  color: #1f2937;
}

.mds-license-chip--active {
  background: rgba(34, 197, 94, 0.18);
  color: #166534;
}

.mds-license-chip--attention {
  background: rgba(249, 115, 22, 0.18);
  color: #9a3412;
}

.mds-license-chip--renewal {
  background: rgba(59, 130, 246, 0.16);
  color: #1d4ed8;
}

.mds-license-chip--purchased {
  background: rgba(250, 204, 21, 0.18);
  color: #92400e;
}

.mds-license-chip--free {
  background: rgba(34, 197, 94, 0.12);
  color: #047857;
}

html.dark .mds-license-chip {
  background: rgba(148, 163, 184, 0.25);
  color: #e2e8f0;
}

html.dark .mds-license-chip--renewal {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

html.dark .mds-card-pricing--empty {
  background: rgba(15, 23, 42, 0.6);
  border-color: #334155;
  color: #cbd5f5;
}

.mds-card-license:not(.mds-card-license-popover) {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  border-top: 1px solid #e2e8f0;
  padding-top: 14px;
}

.mds-card-license:not(.mds-card-license-popover).is-collapsed {
  display: none;
}

html.dark .mds-card-license:not(.mds-card-license-popover) {
  border-top: 1px solid #334155;
}
