/* Extensions Page Styles */
.mds-extensions-page {
    max-width: 1200px;
}

.mds-extensions-tabs {
    margin: 20px 0;
}

.nav-tab-wrapper {
    border-bottom: 1px solid #ccd0d4;
    padding-bottom: 0;
}

.nav-tab {
    border: 1px solid transparent;
    border-bottom: none;
    background: #f1f1f1;
    color: #666;
    font-weight: 600;
    padding: 12px 15px;
    text-decoration: none;
    display: inline-block;
    margin: 0 5px -1px 0;
    border-radius: 3px 3px 0 0;
}

.nav-tab.nav-tab-active {
    background: #fff;
    border-color: #ccd0d4;
    border-bottom: 1px solid #fff;
    color: #000;
    margin-bottom: -1px;
}

.nav-tab:hover {
    background: #fff;
    color: #000;
}

.tab-content {
    display: none;
    padding: 20px 0;
}

.tab-content.active {
    display: block;
}

.mds-extensions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.extension-card {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.extension-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.extension-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.extension-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1d2327;
}

.extension-version {
    background: #f0f0f1;
    color: #646970;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.extension-meta {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.extension-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.extension-badge.free {
    background: #d1e7dd;
    color: #0f5132;
}

.extension-badge.premium {
    background: #fff3cd;
    color: #664d03;
}

.extension-badge.active {
    background: #d1e7dd;
    color: #0f5132;
}

.extension-badge.inactive {
    background: #f8d7da;
    color: #721c24;
}

.extension-badge.update-available {
    background: #cff4fc;
    color: #055160;
}

.extension-description {
    margin-bottom: 20px;
}

.extension-description p {
    margin: 0;
    color: #646970;
    line-height: 1.5;
}

.extension-changelog {
    margin-top: 15px;
    padding: 12px;
    background: #f8f9fa;
    border-left: 4px solid #2271b1;
    border-radius: 4px;
}

.extension-changelog h4 {
    margin: 0 0 8px 0;
    font-size: 13px;
    font-weight: 600;
    color: #2271b1;
}

.changelog-content {
    font-size: 12px;
    color: #646970;
    line-height: 1.4;
}

.changelog-content p {
    margin: 0 0 8px 0;
}

.changelog-content ul, .changelog-content ol {
    margin: 0 0 8px 20px;
    padding: 0;
}

.changelog-content li {
    margin-bottom: 4px;
}

.extension-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.extension-status {
    font-size: 12px;
    color: #646970;
    font-style: italic;
}

.extension-status.up-to-date {
    color: #0f5132;
}

.extension-status.installed {
    color: #055160;
}

/* Loading states */
.extension-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

.extension-card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Notice styles */
#mds-extensions-notices {
    margin: 20px 0;
}

#mds-extensions-notices .notice {
    margin: 5px 0;
}

/* Button styles */
#mds-check-updates-btn {
    margin-left: 10px;
}

.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: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    border: 1px solid transparent;
    background: #f8fafc;
    color: #1f2933;
}

.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: #b7e4c7;
    color: #0f5132;
}

.mds-card-update-panel .mds-update-status.is-warning {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #b45309;
}

.mds-card-update-panel .mds-update-status.is-error {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
}

.mds-card-update-panel .mds-update-status.is-info {
    background: #e0f2fe;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

/* Responsive design */
@media (max-width: 768px) {
    .mds-extensions-grid {
        grid-template-columns: 1fr;
    }
    
    .extension-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .extension-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .extension-actions .button {
        text-align: center;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .extension-card {
        background: #1d2327;
        border-color: #3c434a;
    }
    
    .extension-header h3 {
        color: #f0f0f1;
    }
    
    .extension-version {
        background: #3c434a;
        color: #a7aaad;
    }
    
    .extension-description p {
        color: #a7aaad;
    }
    
    .extension-status {
        color: #a7aaad;
    }

    .mds-card-update-panel .mds-update-status {
        background: rgba(17, 24, 39, 0.85);
        border-color: rgba(148, 163, 184, 0.35);
        color: #e5e7eb;
    }

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

    .mds-card-update-panel .mds-update-status.is-warning {
        background: rgba(120, 53, 15, 0.55);
        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.55);
        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.55);
        border-color: rgba(96, 165, 250, 0.45);
        color: #dbeafe;
    }
}
