/* ===== COUPLING PAGE SPECIFIC STYLES ===== */

.coupling-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

@media (max-width: 1400px) {
    .coupling-container {
        grid-template-columns: 1fr;
    }
}

.coupling-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.coupling-card h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.coupling-card h2 i {
    color: var(--primary-color);
}

/* Dependency Graph */
#dependency-graph {
    width: 100%;
    height: 700px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    overflow: hidden;
}

/* Graph Controls */
.graph-controls {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.control-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.control-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: white;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.control-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
}

.control-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Metrics Table */
.metrics-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.metrics-table thead {
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border-light);
}

.metrics-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
}

.metrics-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
}

.metrics-table tbody tr {
    transition: background var(--transition-fast);
}

.metrics-table tbody tr:hover {
    background: var(--bg-secondary);
}

.module-name {
    font-family: 'Courier New', monospace;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.8125rem;
}

/* Coupling Badge */
.coupling-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.75rem;
}

.coupling-badge.low {
    background: #dcfce7;
    color: #166534;
}

.coupling-badge.medium {
    background: #fef3c7;
    color: #92400e;
}

.coupling-badge.high {
    background: #fee2e2;
    color: #991b1b;
}

/* Instability Bar */
.instability-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.instability-bar-fill {
    flex: 1;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.instability-bar-fill-inner {
    height: 100%;
    transition: width var(--transition-normal);
}

.instability-value {
    font-weight: 600;
    font-size: 0.75rem;
    min-width: 3rem;
    text-align: right;
}

/* Legend */
.legend {
    display: flex;
    gap: var(--spacing-lg);
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.875rem;
}

.legend-symbol {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

/* D3 Graph Nodes and Links */
.node {
    cursor: pointer;
    transition: all 0.3s ease;
}

.node:hover {
    stroke-width: 3px;
}

.node-label {
    font-size: 11px;
    font-family: 'Inter', sans-serif;
    pointer-events: none;
    user-select: none;
}

.link {
    stroke: #94a3b8;
    stroke-opacity: 0.6;
    fill: none;
}

.link-arrow {
    fill: #94a3b8;
    opacity: 0.6;
}

.node.selected {
    stroke-width: 3px;
    stroke: var(--primary-color);
}

.link.highlighted {
    stroke: var(--primary-color);
    stroke-opacity: 1;
    stroke-width: 2px;
}

.link-arrow.highlighted {
    fill: var(--primary-color);
    opacity: 1;
}

/* Tooltip */
.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    pointer-events: none;
    z-index: 1000;
    max-width: 300px;
    box-shadow: var(--shadow-lg);
}

.tooltip-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

.tooltip-row {
    display: flex;
    justify-content: space-between;
    margin: 0.25rem 0;
    font-size: 0.75rem;
}

.tooltip-label {
    color: #94a3b8;
}

/* Search Box */
.search-box {
    position: relative;
    margin-bottom: var(--spacing-md);
}

.search-box input {
    width: 100%;
    padding: 0.625rem 0.875rem 0.625rem 2.5rem;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    background: white;
    transition: all var(--transition-fast);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-box i {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.stat-card {
    background: var(--bg-secondary);
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

