/**
 * Module Admin Panel Styles
 * V1-alpha — module registry + endpoint module management
 */

/* ============================================
   STATUS MESSAGES
   ============================================ */

.module-admin-status {
    display: none;
    padding: 0.625rem 1rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.module-admin-status--success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.module-admin-status--error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ============================================
   LAYOUT — TWO COLUMN (endpoints + modules)
   ============================================ */

.module-admin-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

@media (max-width: 900px) {
    .module-admin-layout {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   ENDPOINT SELECTOR (left column)
   ============================================ */

.endpoint-selector {
    background: var(--bg-secondary, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 8px;
    overflow: hidden;
}

.endpoint-selector__header {
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border, #e2e8f0);
    color: var(--text-primary, #1e293b);
}

.endpoint-selector__list {
    max-height: 400px;
    overflow-y: auto;
}

.endpoint-row {
    display: flex;
    flex-direction: column;
    padding: 0.625rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border, #e2e8f0);
    transition: background 0.15s;
}

.endpoint-row:hover {
    background: var(--bg-hover, #f1f5f9);
}

.endpoint-row.selected {
    background: rgba(99, 102, 241, 0.08);
    border-left: 3px solid #6366f1;
}

.endpoint-uid {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.75rem;
    color: var(--text-primary, #1e293b);
    font-weight: 500;
}

.endpoint-domain {
    font-size: 0.6875rem;
    color: var(--text-muted, #94a3b8);
    margin-top: 2px;
}

/* ============================================
   MODULE TABLES
   ============================================ */

.module-admin-section {
    background: var(--bg-secondary, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 8px;
    overflow: hidden;
}

.module-admin-section + .module-admin-section {
    margin-top: 1rem;
}

.module-admin-section__header {
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border, #e2e8f0);
    color: var(--text-primary, #1e293b);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.module-admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.module-admin-table th {
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #94a3b8);
    border-bottom: 1px solid var(--border, #e2e8f0);
    background: var(--bg-tertiary, #f1f5f9);
}

.module-admin-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
    color: var(--text-primary, #1e293b);
    vertical-align: middle;
}

.module-admin-table tr:last-child td {
    border-bottom: none;
}

.module-admin-table code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.75rem;
    background: rgba(99, 102, 241, 0.06);
    padding: 2px 6px;
    border-radius: 3px;
}

/* ============================================
   MODULE STATUS BADGES
   ============================================ */

.module-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.module-status--active {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.module-status--disabled {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.module-status--deprecated {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

/* ============================================
   TAG PREVIEW
   ============================================ */

.tag-preview-section {
    background: var(--bg-secondary, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.tag-preview-section h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.8125rem;
    font-weight: 600;
}

.tag-url-display {
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary, #f1f5f9);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    word-break: break-all;
}

.tag-payload-preview {
    max-height: 120px;
    overflow-y: auto;
    padding: 0.5rem 0.75rem;
    background: #1e293b;
    color: #e2e8f0;
    border-radius: 4px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.6875rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ============================================
   CONFIG PREVIEW
   ============================================ */

.config-preview {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}

/* ============================================
   BUTTONS (inherit console btn styles)
   ============================================ */

.btn--sm {
    padding: 4px 10px;
    font-size: 0.75rem;
    border-radius: 4px;
}

.btn--danger {
    background: #ef4444;
    color: white;
    border: 1px solid #ef4444;
}

.btn--danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}
