/* ==========================================================================
   MxChat Pro & Extensions Page Styles - v1.0
   Uses admin-sidebar.css for core layout/navigation styles
   ========================================================================== */

/* ==========================================================================
   License Section in Sidebar (Simplified)
   ========================================================================== */
.mxch-license-section {
    margin-bottom: var(--mxch-spacing-xs);
}

.mxch-sidebar-license-status {
    padding: 0 var(--mxch-spacing-lg) var(--mxch-spacing-sm);
    position: relative;
    z-index: 1;
}

.mxch-license-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mxch-license-badge.active {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.mxch-license-badge.active::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
}

.mxch-license-badge.inactive {
    background: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
}

.mxch-license-badge.inactive::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #94a3b8;
}

/* ==========================================================================
   Extensions Section in Sidebar
   ========================================================================== */
.mxch-extensions-section {
    flex: 1;
    overflow-y: auto;
}

.mxch-nav-section-count {
    margin-left: auto;
    background: var(--mxch-primary);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
}

.mxch-addon-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    flex-grow: 0;  /* Prevent dot from expanding in flex containers */
    flex-basis: 8px;  /* Fixed size basis */
}

.mxch-addon-status-dot.active {
    background: var(--mxch-success);
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}

.mxch-addon-status-dot.inactive {
    background: var(--mxch-warning);
}

.mxch-addon-status-dot.not-installed {
    background: var(--mxch-sidebar-text);
    opacity: 0.4;
}

/* ==========================================================================
   Main Content - License Management Card
   ========================================================================== */
.mxch-license-mgmt-card .mxch-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mxch-license-main-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mxch-license-main-badge.active {
    background: #ecfdf5;
    color: #059669;
}

.mxch-license-main-badge.inactive {
    background: #f1f5f9;
    color: #64748b;
}

.mxch-license-info-grid {
    display: grid;
    gap: var(--mxch-spacing-md);
    margin-bottom: var(--mxch-spacing-lg);
}

.mxch-license-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mxch-license-info-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--mxch-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mxch-license-info-value {
    font-size: 14px;
    color: var(--mxch-text-primary);
    display: flex;
    align-items: center;
    gap: var(--mxch-spacing-sm);
    flex-wrap: wrap;
}

.mxch-domain-linked {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--mxch-success);
    font-size: 12px;
    font-weight: 500;
}

.mxch-link-domain-btn {
    padding: 4px 10px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: var(--mxch-radius-sm);
    color: #0369a1;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--mxch-transition-fast);
}

.mxch-link-domain-btn:hover {
    background: #e0f2fe;
}

.mxch-license-key-code {
    background: #f1f5f9;
    padding: 6px 12px;
    border-radius: var(--mxch-radius-sm);
    font-family: monospace;
    font-size: 13px;
    word-break: break-all;
}

.mxch-license-footer-actions {
    display: flex;
    align-items: center;
    gap: var(--mxch-spacing-md);
    flex-wrap: wrap;
    padding-top: var(--mxch-spacing-md);
    border-top: 1px solid var(--mxch-card-border);
}

.mxch-btn-danger {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.mxch-btn-danger:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

/* Activation Form */
.mxch-activation-form {
    max-width: 600px;
}

.mxch-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--mxch-spacing-md);
    margin-bottom: var(--mxch-spacing-lg);
}

.mxch-form-actions {
    display: flex;
    align-items: center;
    gap: var(--mxch-spacing-md);
    margin-bottom: var(--mxch-spacing-sm);
}

.mxch-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top-color: var(--mxch-primary);
    border-radius: 50%;
    animation: mxcSpin 0.6s linear infinite;
}

@keyframes mxcSpin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Extensions Overview Grid
   ========================================================================== */
.mxch-mt-xl {
    margin-top: var(--mxch-spacing-xl);
}

.mxch-h2 {
    font-size: 20px;
}

.mxch-extensions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--mxch-spacing-lg);
}

.mxch-extension-card {
    background: var(--mxch-card-bg);
    border: 1px solid var(--mxch-card-border);
    border-radius: var(--mxch-radius-lg);
    padding: var(--mxch-spacing-lg);
    transition: all var(--mxch-transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.mxch-extension-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(135deg, var(--card-accent, #fa73e6), #7873f5);
    opacity: 0;
    transition: opacity var(--mxch-transition-fast);
}

.mxch-extension-card:hover {
    box-shadow: var(--mxch-card-shadow-hover);
    transform: translateY(-2px);
}

.mxch-extension-card:hover::after {
    opacity: 1;
}

.mxch-extension-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--mxch-spacing-sm);
    margin-bottom: var(--mxch-spacing-sm);
}

.mxch-extension-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--mxch-text-primary);
    margin: 0;
}

.mxch-extension-status {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

.mxch-extension-status.active {
    background: #ecfdf5;
    color: #059669;
}

.mxch-extension-status.inactive {
    background: #fffbeb;
    color: #d97706;
}

.mxch-extension-status.not-installed {
    background: #f1f5f9;
    color: #64748b;
}

.mxch-extension-desc {
    font-size: 13px;
    color: var(--mxch-text-secondary);
    line-height: 1.6;
    margin: 0 0 var(--mxch-spacing-md) 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mxch-extension-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--mxch-spacing-sm);
}

/* ==========================================================================
   Addon Detail View - Hero Style Layout
   ========================================================================== */
.mxch-addon-detail {
    animation: mxcFadeIn 0.2s ease;
}

/* Page Header with Back Link */
.mxch-addon-page-header {
    margin-bottom: var(--mxch-spacing-lg);
}

.mxch-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    background: none;
    border: none;
    color: var(--mxch-text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: color var(--mxch-transition-fast);
}

.mxch-back-link:hover {
    color: var(--mxch-primary);
}

.mxch-back-link svg {
    transition: transform var(--mxch-transition-fast);
}

.mxch-back-link:hover svg {
    transform: translateX(-3px);
}

/* Hero Section - Two Column Layout */
.mxch-addon-hero-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--mxch-spacing-xl);
    align-items: center;
    min-height: 400px;
}

/* Left Column - Content */
.mxch-addon-hero-content {
    max-width: 520px;
}

.mxch-addon-hero-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--mxch-text-primary);
    margin: 0 0 var(--mxch-spacing-md) 0;
    line-height: 1.2;
}

.mxch-addon-hero-desc {
    font-size: 16px;
    line-height: 1.7;
    color: var(--mxch-text-secondary);
    margin: 0 0 var(--mxch-spacing-lg) 0;
}

/* Feature Highlights */
.mxch-addon-hero-features {
    display: flex;
    flex-wrap: wrap;
    gap: var(--mxch-spacing-md) var(--mxch-spacing-xl);
    margin-bottom: var(--mxch-spacing-xl);
}

.mxch-addon-hero-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--mxch-text-primary);
}

.mxch-addon-hero-feature svg {
    color: #10b981;
    flex-shrink: 0;
}

/* Action Buttons */
.mxch-addon-hero-actions {
    display: flex;
    gap: var(--mxch-spacing-md);
    flex-wrap: wrap;
}

/* Outline Button Style */
.mxch-btn-outline {
    background: transparent;
    color: var(--mxch-text-primary);
    border: 1px solid var(--mxch-card-border);
}

.mxch-btn-outline:hover {
    border-color: var(--mxch-primary);
    color: var(--mxch-primary);
    background: rgba(120, 115, 245, 0.05);
}

/* Right Column - Screenshot */
.mxch-addon-hero-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mxch-addon-hero-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--mxch-radius-lg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Image Placeholder (when no screenshot) */
.mxch-addon-image-placeholder {
    width: 100%;
    aspect-ratio: 16/10;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: var(--mxch-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}

/* ==========================================================================
   Mobile Responsiveness
   ========================================================================== */

/* Mobile license status badge */
.mxch-mobile-license-status {
    padding: 0 20px 12px;
}

@media screen and (max-width: 1100px) {
    /* Stack hero layout on medium screens */
    .mxch-addon-hero-section {
        grid-template-columns: 1fr;
        gap: var(--mxch-spacing-xl);
        min-height: auto;
    }

    .mxch-addon-hero-content {
        max-width: none;
        order: 1;
    }

    .mxch-addon-hero-image {
        order: 2;
        max-width: 500px;
        margin: 0 auto;
    }
}

@media screen and (max-width: 960px) {
    .mxch-form-row {
        grid-template-columns: 1fr;
    }

    .mxch-extensions-grid {
        grid-template-columns: 1fr;
    }

    .mxch-license-footer-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .mxch-license-footer-actions .mxch-btn {
        justify-content: center;
    }

    /* Hero title adjustments */
    .mxch-addon-hero-title {
        font-size: 28px;
    }

    .mxch-addon-hero-desc {
        font-size: 15px;
    }

    .mxch-addon-hero-features {
        gap: var(--mxch-spacing-sm) var(--mxch-spacing-lg);
    }
}

@media screen and (max-width: 600px) {
    .mxch-addon-hero-title {
        font-size: 24px;
    }

    .mxch-addon-hero-desc {
        font-size: 14px;
    }

    .mxch-addon-hero-features {
        flex-direction: column;
        gap: var(--mxch-spacing-sm);
    }

    .mxch-addon-hero-actions {
        flex-direction: column;
    }

    .mxch-addon-hero-actions .mxch-btn {
        width: 100%;
        justify-content: center;
    }

    .mxch-extension-card-header {
        flex-direction: column;
        gap: var(--mxch-spacing-xs);
    }

    .mxch-addon-hero-image {
        max-width: 100%;
    }
}

/* ==========================================================================
   Mobile Detail Panel (Slide Up)
   ========================================================================== */
@media screen and (max-width: 782px) {
    .mxch-addon-detail.mobile-active {
        position: fixed;
        top: 46px;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--mxch-content-bg);
        z-index: 1000;
        overflow-y: auto;
        padding: var(--mxch-spacing-md);
        max-width: none;
    }

    body.mxch-mobile-panel-open {
        overflow: hidden;
    }
}

/* ==========================================================================
   Feature Showcase (no-image addon detail visual)
   ========================================================================== */
.mxch-addon-feature-showcase {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    width: 100%;
    padding: 32px;
    background: linear-gradient(145deg, #f8fafc 0%, #eef2ff 50%, #f5f3ff 100%);
    border-radius: var(--mxch-radius-lg);
    border: 1px solid rgba(99, 102, 241, 0.12);
}

.mxch-addon-showcase-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

.mxch-addon-showcase-item:hover {
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.2);
    transform: translateY(-2px);
}

.mxch-addon-showcase-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--showcase-accent, #6366f1);
    background: linear-gradient(135deg, var(--showcase-accent, #6366f1), #818cf8);
    color: #fff;
}

.mxch-addon-showcase-icon svg {
    stroke: #fff;
}

.mxch-addon-showcase-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.mxch-addon-showcase-text strong {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--mxch-text-primary, #1a1a2e);
    line-height: 1.3;
}

.mxch-addon-showcase-text span {
    font-size: 12.5px;
    color: var(--mxch-text-secondary, #64748b);
    line-height: 1.4;
}

@media screen and (max-width: 1100px) {
    .mxch-addon-feature-showcase {
        max-width: 500px;
        margin: 0 auto;
    }
}

@media screen and (max-width: 600px) {
    .mxch-addon-feature-showcase {
        grid-template-columns: 1fr;
        padding: 20px;
    }
}
