/* EMD Page Styles - Shared styles for model, component, and family pages */

:root {
    --emd-primary: #2563eb;
    --emd-primary-dark: #1d4ed8;
    --emd-secondary: #64748b;
    --emd-success: #22c55e;
    --emd-warning: #f59e0b;
    --emd-danger: #ef4444;
    --emd-bg: #f8fafc;
    --emd-surface: #ffffff;
    --emd-border: #e2e8f0;
    --emd-text: #1e293b;
    --emd-text-muted: #64748b;
    --emd-radius: 8px;
    --emd-shadow: 0 1px 3px rgba(0,0,0,0.1);
    --emd-shadow-lg: 0 4px 12px rgba(0,0,0,0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body.emd-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--emd-bg);
    color: var(--emd-text);
    line-height: 1.6;
    min-height: 100vh;
}

.emd-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
.emd-header {
    background: var(--emd-surface);
    border-radius: var(--emd-radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--emd-shadow);
}

.emd-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--emd-text-muted);
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.emd-breadcrumb a {
    color: var(--emd-primary);
    text-decoration: none;
}

.emd-breadcrumb a:hover {
    text-decoration: underline;
}

.emd-badge {
    display: inline-block;
    background: var(--emd-primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.emd-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--emd-text);
    margin-bottom: 0.5rem;
}

.emd-long-name {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 0.875rem;
    color: var(--emd-text-muted);
    margin-bottom: 0.75rem;
}

.emd-subtitle {
    font-size: 1.125rem;
    color: var(--emd-secondary);
    margin-bottom: 1.5rem;
}

.emd-header-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--emd-border);
}

.emd-meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.emd-meta-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--emd-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.emd-meta-value {
    font-size: 0.875rem;
    color: var(--emd-text);
}

.emd-meta-value a {
    color: var(--emd-primary);
    text-decoration: none;
}

.emd-meta-value a:hover {
    text-decoration: underline;
}

/* Sections */
.emd-section {
    background: var(--emd-surface);
    border-radius: var(--emd-radius);
    margin-bottom: 1rem;
    box-shadow: var(--emd-shadow);
    overflow: hidden;
}

.emd-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.emd-section-header:hover {
    background: var(--emd-bg);
}

.emd-section-title-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.emd-section-icon {
    width: 24px;
    height: 24px;
    color: var(--emd-primary);
}

.emd-section-icon svg {
    width: 100%;
    height: 100%;
}

.emd-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--emd-text);
}

.emd-section-count {
    font-weight: 400;
    color: var(--emd-text-muted);
}

.emd-section-toggle {
    width: 20px;
    height: 20px;
    color: var(--emd-text-muted);
    transition: transform 0.2s;
}

.emd-section-toggle svg {
    width: 100%;
    height: 100%;
}

.emd-section.expanded .emd-section-toggle {
    transform: rotate(180deg);
}

.emd-section-content {
    display: none;
    padding: 0 1.5rem 1.5rem;
}

.emd-section.expanded .emd-section-content {
    display: block;
}

.emd-section-divider {
    height: 1px;
    background: var(--emd-border);
    margin-bottom: 1rem;
}

.emd-section-body {
    padding-top: 0;
}

/* Description */
.emd-description-text {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--emd-text);
}

.emd-description-text mark {
    background: #fef08a;
    padding: 0 0.125rem;
    border-radius: 2px;
}

/* Domain Cards */
.emd-domains-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.emd-domain-card {
    background: var(--emd-bg);
    border: 1px solid var(--emd-border);
    border-radius: var(--emd-radius);
    padding: 1rem;
}

.emd-domain-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.emd-domain-card-title {
    font-weight: 600;
    color: var(--emd-text);
}

.emd-domain-card-type {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--emd-primary);
    background: rgba(37, 99, 235, 0.1);
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
}

.emd-domain-card-id {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 0.75rem;
    color: var(--emd-text-muted);
    margin-bottom: 0.5rem;
}

.emd-domain-card-description {
    font-size: 0.875rem;
    color: var(--emd-secondary);
    margin-bottom: 0.5rem;
}

.emd-domain-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.emd-meta-tag {
    font-size: 0.75rem;
    color: var(--emd-text-muted);
    background: var(--emd-surface);
    border: 1px solid var(--emd-border);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    text-decoration: none;
}

.emd-meta-tag:hover {
    border-color: var(--emd-primary);
    color: var(--emd-primary);
}

/* Tech Details */
.emd-tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.emd-tech-item {
    background: var(--emd-bg);
    border-radius: var(--emd-radius);
    padding: 1rem;
}

.emd-tech-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--emd-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.emd-tech-value {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 0.875rem;
    color: var(--emd-text);
    word-break: break-all;
}

.emd-tech-value a {
    color: var(--emd-primary);
    text-decoration: none;
}

.emd-tech-value a:hover {
    text-decoration: underline;
}

.emd-type-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.emd-type-badge {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--emd-secondary);
    background: var(--emd-surface);
    border: 1px solid var(--emd-border);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* References */
.emd-reference-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--emd-bg);
    border-radius: var(--emd-radius);
    margin-bottom: 0.5rem;
    text-decoration: none;
    color: var(--emd-text);
    transition: background 0.2s, box-shadow 0.2s;
}

.emd-reference-item:hover {
    background: var(--emd-surface);
    box-shadow: var(--emd-shadow);
}

.emd-reference-icon {
    width: 20px;
    height: 20px;
    color: var(--emd-primary);
    flex-shrink: 0;
}

.emd-reference-icon svg {
    width: 100%;
    height: 100%;
}

.emd-reference-text {
    flex: 1;
    font-size: 0.875rem;
    word-break: break-all;
}

.emd-reference-arrow {
    color: var(--emd-text-muted);
    font-size: 1rem;
}

/* Coupling */
.emd-coupling-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.emd-coupling-group {
    background: var(--emd-bg);
    border-radius: var(--emd-radius);
    padding: 1rem;
}

.emd-coupling-group-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--emd-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.emd-coupling-components {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.emd-coupling-component {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--emd-primary);
    background: rgba(37, 99, 235, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
}

/* Embedded Components */
.emd-embedded-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--emd-bg);
    border-radius: var(--emd-radius);
    margin-bottom: 0.5rem;
}

.emd-embedded-component {
    font-weight: 500;
    color: var(--emd-text);
}

.emd-embedded-arrow {
    color: var(--emd-text-muted);
}

.emd-embedded-host {
    color: var(--emd-secondary);
}

/* Footer */
.emd-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--emd-border);
    text-align: center;
}

.emd-footer-text {
    font-size: 0.875rem;
    color: var(--emd-text-muted);
}

.emd-footer-link {
    color: var(--emd-primary);
    text-decoration: none;
}

.emd-footer-link:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .emd-container {
        padding: 1rem;
    }
    
    .emd-header {
        padding: 1.5rem;
    }
    
    .emd-title {
        font-size: 1.5rem;
    }
    
    .emd-header-meta {
        grid-template-columns: 1fr;
    }
    
    .emd-domains-grid {
        grid-template-columns: 1fr;
    }
    
    .emd-tech-grid {
        grid-template-columns: 1fr;
    }
}
