/* MDM Shared Styles */

/* Layout and Structure */
#app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#app-header {
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 1020;
    background: var(--gw-surface);
    box-shadow: var(--gw-shadow-md);
}

#app-content {
    flex: 1;
    background: var(--gw-gray-50);
}

/* Page Header */
.page-header {
    background: var(--gw-surface);
    border-radius: var(--gw-border-radius-lg);
    padding: var(--gw-spacing-xl);
    box-shadow: var(--gw-shadow-sm);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--gw-spacing-sm);
    margin-bottom: var(--gw-spacing-lg);
    font-size: var(--gw-font-size-sm);
}

.breadcrumb-item {
    color: var(--gw-gray-600);
    text-decoration: none;
}

.breadcrumb-item:hover {
    color: var(--gw-primary);
}

.breadcrumb-item.active {
    color: var(--gw-gray-900);
    font-weight: var(--gw-font-weight-medium);
}

.breadcrumb-separator {
    color: var(--gw-gray-400);
}

.page-title {
    display: flex;
    flex-direction: column;
}

.page-icon {
    font-size: 2.5rem !important;
    color: var(--gw-primary);
}

.page-subtitle {
    color: var(--gw-gray-600);
    font-size: var(--gw-font-size-lg);
}

/* Metrics Cards */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--gw-spacing-lg);
}

.metric-card {
    background: var(--gw-surface);
    border-radius: var(--gw-border-radius-lg);
    box-shadow: var(--gw-shadow-sm);
    padding: var(--gw-spacing-lg);
    border-left: 4px solid var(--gw-primary);
    transition: var(--gw-transition);
}

.metric-card:hover {
    box-shadow: var(--gw-shadow-md);
}

.metric-card.success {
    border-left-color: var(--gw-green-500);
}

.metric-card.warning {
    border-left-color: var(--gw-yellow-500);
}

.metric-card.danger {
    border-left-color: var(--gw-red-500);
}

.metric-value {
    font-size: 2.5rem;
    font-weight: var(--gw-font-weight-bold);
    color: var(--gw-gray-900);
    line-height: 1;
    margin-bottom: var(--gw-spacing-xs);
}

.metric-label {
    font-size: var(--gw-font-size-sm);
    color: var(--gw-gray-600);
    text-transform: uppercase;
    font-weight: var(--gw-font-weight-medium);
    letter-spacing: 0.05em;
    margin-bottom: var(--gw-spacing-sm);
}

.metric-trend {
    display: flex;
    align-items: center;
    gap: var(--gw-spacing-xs);
    font-size: var(--gw-font-size-sm);
    color: var(--gw-gray-500);
}

.metric-trend.positive {
    color: var(--gw-green-600);
}

.metric-trend.negative {
    color: var(--gw-red-600);
}

/* Search and Filters */
.search-filters {
    background: var(--gw-surface);
    border-radius: var(--gw-border-radius-lg);
    box-shadow: var(--gw-shadow-sm);
    padding: var(--gw-spacing-xl);
}

.search-bar {
    display: flex;
    gap: var(--gw-spacing-md);
    align-items: center;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 300px;
    padding: var(--gw-spacing-md);
    border: 1px solid var(--gw-gray-300);
    border-radius: var(--gw-border-radius-md);
    font-size: var(--gw-font-size-base);
    transition: var(--gw-transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--gw-primary);
    box-shadow: 0 0 0 3px var(--gw-primary-100);
}

.filters {
    display: flex;
    gap: var(--gw-spacing-lg);
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--gw-spacing-xs);
    min-width: 150px;
}

.filter-label {
    font-size: var(--gw-font-size-sm);
    color: var(--gw-gray-600);
    font-weight: var(--gw-font-weight-medium);
}

.filter-select {
    padding: var(--gw-spacing-sm) var(--gw-spacing-md);
    border: 1px solid var(--gw-gray-300);
    border-radius: var(--gw-border-radius-md);
    font-size: var(--gw-font-size-sm);
    background: var(--gw-surface);
    transition: var(--gw-transition);
}

.filter-select:focus {
    outline: none;
    border-color: var(--gw-primary);
    box-shadow: 0 0 0 3px var(--gw-primary-100);
}

/* Data Grid */
.data-grid {
    background: var(--gw-surface);
    border-radius: var(--gw-border-radius-lg);
    box-shadow: var(--gw-shadow-sm);
    overflow: hidden;
}

.data-grid-header {
    background: var(--gw-gray-50);
    padding: var(--gw-spacing-lg);
    border-bottom: 1px solid var(--gw-gray-200);
    display: flex;
    justify-content: between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--gw-spacing-md);
}

.data-grid-body {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: var(--gw-spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--gw-gray-200);
    vertical-align: middle;
}

.data-table th {
    background: var(--gw-gray-50);
    font-weight: var(--gw-font-weight-semibold);
    color: var(--gw-gray-900);
    font-size: var(--gw-font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table tbody tr {
    transition: var(--gw-transition);
}

.data-table tbody tr:hover {
    background: var(--gw-primary-50);
}

/* Quality Score Indicators */
.quality-score {
    display: inline-flex;
    align-items: center;
    padding: var(--gw-spacing-xs) var(--gw-spacing-sm);
    border-radius: var(--gw-border-radius-pill);
    font-size: var(--gw-font-size-sm);
    font-weight: var(--gw-font-weight-medium);
}

.quality-score.excellent {
    background: var(--gw-green-100);
    color: var(--gw-green-700);
}

.quality-score.good {
    background: var(--gw-blue-100);
    color: var(--gw-blue-700);
}

.quality-score.warning {
    background: var(--gw-yellow-100);
    color: var(--gw-yellow-700);
}

.quality-score.poor {
    background: var(--gw-red-100);
    color: var(--gw-red-700);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: var(--gw-spacing-xs) var(--gw-spacing-sm);
    border-radius: var(--gw-border-radius-pill);
    font-size: var(--gw-font-size-xs);
    font-weight: var(--gw-font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge.active {
    background: var(--gw-green-100);
    color: var(--gw-green-700);
}

.status-badge.pending {
    background: var(--gw-yellow-100);
    color: var(--gw-yellow-700);
}

.status-badge.inactive {
    background: var(--gw-gray-100);
    color: var(--gw-gray-700);
}

.status-badge.failed {
    background: var(--gw-red-100);
    color: var(--gw-red-700);
}

/* Actions */
.actions {
    display: flex;
    gap: var(--gw-spacing-sm);
    align-items: center;
    flex-wrap: wrap;
}

/* Relationship Visualization */
.relationship-container {
    background: var(--gw-surface);
    border-radius: var(--gw-border-radius-lg);
    box-shadow: var(--gw-shadow-sm);
    padding: var(--gw-spacing-xl);
    min-height: 300px;
    position: relative;
}

.relationship-node {
    background: var(--gw-surface);
    border: 2px solid var(--gw-primary-200);
    border-radius: var(--gw-border-radius-md);
    padding: var(--gw-spacing-md);
    box-shadow: var(--gw-shadow-sm);
    cursor: pointer;
    transition: var(--gw-transition);
    text-align: center;
}

.relationship-node:hover {
    border-color: var(--gw-primary);
    box-shadow: var(--gw-shadow-md);
}

.relationship-node.source {
    border-color: var(--gw-green-300);
}

.relationship-node.transformation {
    border-color: var(--gw-blue-300);
}

.relationship-node.target {
    border-color: var(--gw-purple-300);
}

.relationship-node i {
    font-size: 1.5rem;
    margin-bottom: var(--gw-spacing-sm);
    color: var(--gw-primary);
}

/* Loading States */
.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--gw-spacing-2xl);
}

.loading-spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--gw-gray-200);
    border-top-color: var(--gw-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Chart Containers */
.chart-container {
    background: var(--gw-surface);
    border-radius: var(--gw-border-radius-lg);
    box-shadow: var(--gw-shadow-sm);
    padding: var(--gw-spacing-xl);
}

.chart-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: var(--gw-spacing-lg);
    padding-bottom: var(--gw-spacing-md);
    border-bottom: 1px solid var(--gw-gray-200);
}

.chart-title {
    font-size: var(--gw-font-size-lg);
    font-weight: var(--gw-font-weight-semibold);
    color: var(--gw-gray-900);
}

/* Activity Timeline */
.activity-timeline {
    position: relative;
}

.activity-item {
    display: flex;
    gap: var(--gw-spacing-md);
    padding: var(--gw-spacing-md) 0;
    border-bottom: 1px solid var(--gw-gray-100);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon.success {
    background: var(--gw-green-100);
    color: var(--gw-green-600);
}

.activity-icon.info {
    background: var(--gw-blue-100);
    color: var(--gw-blue-600);
}

.activity-icon.warning {
    background: var(--gw-yellow-100);
    color: var(--gw-yellow-600);
}

.activity-icon.danger {
    background: var(--gw-red-100);
    color: var(--gw-red-600);
}

.activity-content {
    flex: 1;
}

.activity-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: var(--gw-spacing-xs);
}

.activity-time {
    font-size: var(--gw-font-size-sm);
    color: var(--gw-gray-500);
}

.activity-details {
    font-size: var(--gw-font-size-sm);
    color: var(--gw-gray-600);
}

/* System Status Indicators */
.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: var(--gw-spacing-sm);
    display: inline-block;
}

.status-indicator.success {
    background-color: var(--gw-green-500);
}

.status-indicator.warning {
    background-color: var(--gw-yellow-500);
}

.status-indicator.danger {
    background-color: var(--gw-red-500);
}

/* Responsive Design */
@media (max-width: 768px) {
    .page-header {
        padding: var(--gw-spacing-md);
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .search-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-input {
        min-width: auto;
    }
    
    .filters {
        flex-direction: column;
    }
    
    .filter-group {
        min-width: auto;
    }
    
    .data-grid-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .actions {
        justify-content: stretch;
    }
    
    .data-table {
        font-size: var(--gw-font-size-sm);
    }
    
    .data-table th,
    .data-table td {
        padding: var(--gw-spacing-sm);
    }
}

@media (max-width: 480px) {
    .search-filters {
        padding: var(--gw-spacing-md);
    }
    
    .relationship-container {
        padding: var(--gw-spacing-md);
    }
    
    .chart-container {
        padding: var(--gw-spacing-md);
    }
}