/* Reports CSS - Consolidated and organized styles */

/* ===== CSS VARIABLES ===== */
:root {
    /* Primary Colors */
    --primary-blue: #2C5282;
    --primary-blue-light: #667eea;
    --primary-blue-dark: #2c3e50;
    
    /* Status Colors */
    --status-red: #e53e3e;
    --status-red-dark: #c53030;
    --status-red-light: #fff5f5;
    --status-yellow: #d69e2e;
    --status-yellow-light: #fff3cd;
    --status-green: #38a169;
    --status-green-light: #f0fff4;
    --status-green-dark: #28a745;
    --status-critical: #dc3545;
    
    /* Neutral Colors */
    --gray-50: #f8f9fa;
    --gray-100: #e2e8f0;
    --gray-200: #dee2e6;
    --gray-300: #e9ecef;
    --gray-400: #6c757d;
    --gray-500: #666;
    --gray-600: #4a5568;
    --gray-700: #333;
    --gray-800: #2d3748;
    --white: #ffffff;
    --black: #000000;
    
    /* Background Colors */
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --bg-success: #e8f5e8;
    --bg-danger: #fff5f5;
    --bg-warning: #fff3cd;
    
    /* Border Colors */
    --border-light: #e2e8f0;
    --border-medium: #dee2e6;
    --border-success: #38a169;
    --border-danger: #e53e3e;
    --border-warning: #ffc107;
}

/* ===== LAYOUT & STRUCTURE ===== */
.report-header {
    background: var(--primary-blue);
    color: var(--white);
    padding: 2rem;
    margin: 1rem -24px;
    border-radius: 8px;
    position: relative;
}

.report-header h1 {
    margin: 0;
}

.report-header h2 {
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.report-header .subtitle {
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
}

.report-header .analysis-date {
    margin-top: 0.25rem;
}

/* ===== SECTION HEADERS ===== */
.main-section-header,
.section-header,
.section-header-primary {
    color: var(--primary-blue);
    font-size: 1.4rem;
    font-weight: 600;
    margin: 2rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--gray-300);
}

.section-subheader,
.section-subheader-alt {
    color: var(--primary-blue);
    margin-bottom: 1rem;
}

.technical-appendix-subsection,
.security-section,
.repo-characterization,
.security-posture,
.deployment-frequency,
.git-process-culture,
.team-skills {
    color: var(--primary-blue);
    font-size: 1.2rem;
    font-weight: 600;
    margin: 1.5rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-300);
}

/* ===== ANCHOR OFFSETS FOR FIXED HEADER ===== */
/* Smooth scrolling for anchor links */
html {
    scroll-behavior: smooth;
}

/* Offset anchor targets to account for fixed header (64px) when scrolling */
h1[id],
h2[id],
h3[id],
h4[id],
h5[id],
h6[id],
[id] {
    scroll-margin-top: 80px; /* 64px header + 16px padding */
}

/* ===== STATUS INDICATORS (TRAFFIC LIGHT SYSTEM) ===== */
.status-critical,
.risk-critical,
.severity-critical {
    color: var(--status-critical);
    font-weight: 600;
    background-color: rgba(220, 53, 69, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.status-red,
.risk-high,
.severity-high {
    color: var(--status-red);
    font-weight: 600;
    background-color: rgba(229, 62, 62, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(229, 62, 62, 0.3);
}

.status-yellow,
.risk-medium,
.severity-medium {
    color: var(--status-yellow);
    font-weight: 600;
    background-color: rgba(214, 158, 46, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(214, 158, 46, 0.3);
}

.status-green,
.risk-low,
.severity-low {
    color: var(--status-green);
    font-weight: 600;
    background-color: rgba(56, 161, 105, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(56, 161, 105, 0.3);
}

.status-info,
.risk-unknown,
.severity-info {
    color: var(--gray-400);
    font-weight: 600;
    background-color: rgba(108, 117, 125, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(108, 117, 125, 0.3);
}

/* ===== CARDS & CONTAINERS ===== */
.card,
.info-card,
.info-card-lg,
.info-card-centered,
.info-card-warning-centered {
    background: var(--bg-light);
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    padding: 1rem;
    margin: 0.5rem 0;
}

.info-card-centered,
.info-card-warning-centered {
    text-align: center;
}

.info-card-warning-centered {
    background: var(--bg-warning);
    border: 1px solid #ffeaa7;
}

.info-card-header,
.info-card-header-primary {
    color: var(--primary-blue);
    font-weight: 600;
    display: block;
    margin-bottom: 0.5rem;
}

.info-card-value,
.info-card-value-lg,
.info-card-value-xl {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--gray-700);
}

.info-card-value-xl {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-blue);
}

/* ===== METRICS & GRID ===== */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.metric-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    text-align: center;
}

.metric-card h4 {
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--primary-blue-light);
    margin: 0;
    line-height: 1;
}

.metric-label {
    font-size: 0.9rem;
    color: var(--gray-500);
    margin: 0.5rem 0 0 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== TABLES ===== */
.table-full,
.table-full-width {
    width: 100%;
    border-collapse: collapse;
}

.table-header-left,
.table-header-center,
.table-header-left-bold {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid var(--border-medium);
    color: var(--primary-blue);
}

.table-header-center {
    text-align: center;
}

.table-header-left-bold {
    border-bottom: 2px solid var(--border-medium);
}

.table-cell-center,
.table-cell-left,
.table-cell-right,
.table-cell-muted,
.table-cell-bold-primary,
.table-cell-center-bold,
.table-cell-medium,
.table-cell-center-plain,
.table-cell-capitalize,
.table-cell-plain {
    padding: 0.75rem;
    border-bottom: 1px solid #f1f3f4;
}

.table-cell-center,
.table-cell-center-bold {
    text-align: center;
    font-weight: 600;
    color: var(--primary-blue);
}

.table-cell-left {
    font-weight: 600;
    color: var(--primary-blue);
    text-align: left;
}

.table-cell-right {
    text-align: right;
}

.table-cell-muted {
    color: var(--gray-500);
}

.table-cell-bold-primary {
    font-weight: 600;
    color: var(--primary-blue);
}

.table-cell-medium {
    font-weight: 500;
}

.table-cell-capitalize {
    text-transform: capitalize;
}

.table-row-highlight {
    background-color: var(--bg-light);
}

.table-cell-indent {
    padding-left: 2rem;
}

.table-cell-bold {
    font-weight: 500;
}

.table-cell-small {
    font-size: 0.9rem;
    color: var(--gray-500);
}

.table-cell-monospace {
    font-family: monospace;
}

/* ===== HEATMAP STYLING ===== */
.heatmap-cell {
    display: inline-block;
    min-width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.heatmap-none {
    background-color: var(--white);
    color: var(--gray-400);
    border: 1px solid var(--gray-300);
}

.heatmap-minimal {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--gray-700);
    border: 1px solid var(--border-light);
}

.heatmap-low {
    background-color: rgba(40, 167, 69, 0.2);
    color: var(--gray-700);
    border: 1px solid var(--border-light);
}

.heatmap-medium {
    background-color: rgba(40, 167, 69, 0.3);
    color: var(--gray-700);
    border: 1px solid var(--border-light);
}

.heatmap-high {
    background-color: rgba(40, 167, 69, 0.4);
    color: var(--gray-700);
    border: 1px solid var(--border-light);
}

.heatmap-cell:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.heatmap-legend {
    background-color: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-color {
    min-width: 30px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    border-radius: 3px;
    font-weight: 600;
    font-size: 0.75rem;
}

.legend-label {
    font-size: 0.875rem;
    color: var(--gray-600);
}

/* ===== TEAM SKILLS TABLE ===== */
.team-skills-table {
    border-collapse: collapse;
    min-width: 800px;
}


.team-skills-table th {
    background-color: var(--bg-light);
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    color: var(--primary-blue);
    border-bottom: 2px solid var(--border-light);
    cursor: pointer;
    transition: background-color 0.2s ease;
    min-width: 80px;
}

.team-skills-table th:hover {
    background-color: var(--border-light);
}

.team-skills-table td {
    padding: 8px;
    text-align: center;
    border-bottom: 1px solid var(--border-light);
    overflow: hidden; /* ensure heatmap hover scale doesn't overlap neighbor cells */
}

.team-skills-table td:first-child {
    text-align: left;
    font-weight: 600;
    color: var(--primary-blue);
}

.sort-indicator {
    margin-left: 4px;
    font-size: 0.75rem;
    color: var(--gray-400);
}

.developer-column {
    min-width: 150px;
    text-align: left !important;
}

.developer-name {
    font-weight: 600;
    color: var(--primary-blue);
}

.sortable-header {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.sortable-header:hover {
    background-color: var(--border-light);
}

/* ===== TOOLTIPS ===== */
.tooltip-container {
    position: relative;
    display: inline-block;
    margin-left: 0;
    vertical-align: baseline;
}

.tooltip-trigger,
.simple-tooltip {
    cursor: help;
    color: inherit;
    font-size: inherit;
    text-decoration: underline;
    text-decoration-color: rgba(0, 0, 0, 0.2);
    
    transition: text-decoration-color 0.2s ease;
    border: none;
    background: none;
    padding: 0;
    margin: 0;
    display: inline;
}

.simple-tooltip {
    color: inherit;
    background: none;
    text-decoration-color: rgba(44, 82, 130, 0.3);
}

.tooltip-trigger:hover,
.simple-tooltip:hover,
.simple-tooltip:focus {
    text-decoration-color: rgba(0, 0, 0, 0.4);
    outline: none;
}

.simple-tooltip:hover,
.simple-tooltip:focus {
    text-decoration-color: rgba(44, 82, 130, 0.4);
}

.tooltip-content,
.tooltip-text,
.click-tooltip {
    visibility: hidden;
    position: absolute;
    z-index: 10000;
    width: 300px;
    background-color: #333;
    color: var(--white);
    text-align: left;
    border-radius: 6px;
    padding: 0.75rem;
    font-size: 0.875rem;
    line-height: 1.4;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip-content {
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 10px;
}

.tooltip-text {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.click-tooltip {
    display: none;
    margin-top: 0.5rem;
    margin-left: -150px;
}

.click-tooltip.show {
    display: block;
}

.tooltip-content::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.tooltip-container:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
}

.simple-tooltip:focus .tooltip-text {
    visibility: visible;
}

/* ===== KNOWLEDGE BASE TOOLTIPS ===== */
/* Simple dotted underline for knowledge base terms - completely separate from existing tooltip styling */
.kb-term {
    border-bottom: 1px dotted #f0f0f0;
    cursor: help;
    text-decoration: none;
}

.kb-term:hover {
    border-bottom-color: #ddd;
    background-color: rgba(0, 0, 0, 0.01);
}

/* Ensure tooltip content is completely independent of table styling */
.tooltip-content {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: initial !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    max-width: 350px !important;
    min-width: 200px !important;
}

/* ===== SETTINGS MENU ===== */
.settings-container {
    position: relative;
    overflow: visible !important;
    z-index: 9999 !important;
}

#settingsButton {
    z-index: 9999 !important;
    position: relative;
    color: rgba(255, 255, 255, 0.8);
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

#settingsButton:hover {
    background-color: rgba(255,255,255,0.1);
}

#settingsMenu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--white);
    border: 1px solid var(--border-medium);
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    min-width: 200px;
    display: none;
    z-index: 9999 !important;
    overflow: visible;
}

.settings-menu-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--gray-700);
    text-decoration: none;
    border-bottom: 1px solid var(--bg-light);
    transition: background-color 0.2s ease;
}

.settings-menu-item:hover {
    background-color: var(--bg-light);
}

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

.settings-menu-icon {
    font-size: 1rem;
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* ===== CHART CONTAINER ===== */
.chart-container {
    margin-top: 1.5rem;
    padding: 1rem 1rem 6rem 1rem;
    background: var(--bg-light);
    border-radius: 6px;
    height: 400px;
    position: relative;
    overflow: hidden;
}

.chart-title {
    margin-bottom: 1rem;
}

.chart-granularity {
    font-size: 0.8em;
    color: var(--gray-500);
    font-weight: normal;
}

/* ===== UTILITY CLASSES ===== */
/* Text Alignment */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Text Colors */
.text-primary { color: var(--primary-blue); }
.text-primary-dark { color: var(--primary-blue-dark); }
.text-muted { color: var(--gray-500); }
.text-muted-alt { color: var(--gray-500); margin-bottom: 2rem; }
.text-muted-small { color: var(--gray-400); }
.text-muted-dark { color: var(--gray-800); }
.text-muted-light { color: var(--gray-500); }
.text-gray { color: var(--gray-400); }
.text-gray-mt { font-size: 1rem; color: var(--gray-500); margin-top: 0.5rem; }
.text-sm-muted { font-size: 0.9rem; color: var(--gray-500); }
.text-monospace-muted { font-family: monospace; color: var(--gray-500); }

/* Status Text Colors */
.text-critical { color: var(--status-red-dark); }
.text-high { color: var(--status-red); }
.text-medium { color: var(--status-yellow); }
.text-success { color: var(--status-green); }
.text-success-alt { color: #4caf50; }
.text-danger-bold { color: #d32f2f; font-weight: 600; }
.text-orange { color: #f57c00; }
.text-warning { color: #856404; }
.text-high-alt { color: var(--status-red); margin-bottom: 1rem; }
.text-link { color: var(--primary-blue-light); text-decoration: none; font-weight: 500; }

/* Classification links - no underlines */
.classification-link,
.classification-link:hover,
.classification-link:visited,
.classification-link:link,
.classification-link:active,
a.classification-link,
a.classification-link:hover,
a.classification-link:visited,
a.classification-link:link,
a.classification-link:active {
    text-decoration: none !important;
    border-bottom: none !important;
}

/* Font Sizes */
.text-large { font-size: 1.1rem; line-height: 1.7; }
.text-small { font-size: 0.8rem; }
.text-xs { font-size: 0.75rem; }
.font-size-lg { font-size: 1.1rem; }
.font-size-sm { font-size: 0.9rem; }

/* Font Weights */
.font-weight-500 { font-weight: 500; }
.font-weight-600 { font-weight: 600; }
.font-weight-700 { font-weight: 700; }
.font-weight-600-dark { font-weight: 600; color: var(--gray-700); }
.font-weight-500-primary { font-weight: 500; color: var(--primary-blue); }

/* Background Colors */
.bg-white { background: var(--white); }
.bg-light { background: var(--bg-light); }
.bg-success-light { background: var(--bg-success); }
.bg-danger-light { background: var(--bg-danger); }
.bg-warning-light { background: var(--bg-warning); }
.bg-success-border { background: var(--bg-success); border: 1px solid #c3e6c3; border-radius: 4px; padding: 1rem; }
.bg-gray-light { background: var(--bg-light); border: 1px solid var(--border-medium); border-radius: 4px; padding: 1rem; }

/* Border Colors */
.border-top { border-top: 1px solid; }
.border-success { border-color: var(--border-success); }
.border-danger { border-color: var(--border-danger); }
.border-primary { border-color: var(--border-light); }
.border-light { border-color: var(--border-light); }
.border-left-light { border-left: 2px solid #e0e0e0; }
.border-left-success { border-left: 4px solid #4caf50; }
.border-left-warning { border-left: 4px solid var(--border-warning); }
.border-bottom-light { border-bottom: 1px solid var(--border-light); }
.border-radius { border-radius: 8px; }

/* Spacing */
.m-0 { margin: 0; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-075 { margin-bottom: 0.75rem; }
.mb-small { margin-bottom: 0.5rem; }
.mb-section { margin-bottom: 1.5rem; }
.mb-item { margin-bottom: 0.5rem; }
.mb-header { margin-bottom: 0.75rem; }
.mb-tiny { margin-bottom: 0.25rem; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1rem; }
.mt-section { margin-top: 1.5rem; }
.mt-detail { margin-top: 0.5rem; }
.ml-1 { margin-left: 1rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-075 { padding: 0.75rem; }
.pt-1 { padding-top: 0.5rem; }

/* Positioning */
.position-relative { position: relative; }
.position-absolute { position: absolute; }
.position-sticky { position: sticky; }
.position-top-right { top: 1rem; right: 1rem; z-index: 10; }
.top-0 { top: 0; }
.z-index-10 { z-index: 10; }
.z-index-1000 { z-index: 1000; }
.z-index-9999 { z-index: 9999; }

/* Display & Layout */
.d-flex { display: flex; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-wrap { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.overflow-auto { overflow: auto; }
.overflow-hidden { overflow: hidden; }
.cursor-pointer { cursor: pointer; }

/* Width & Sizing */
.width-80 { width: 80px; }

/* Lists */
.list-unstyled { margin: 0; padding-left: 1.5rem; }
.list-styled { margin: 0; padding-left: 1.2rem; font-size: 0.9rem; }
.list-indented { margin: 0; padding-left: 1.5rem; }

/* Badges */
.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-success {
    background: #e8f5e8;
    color: #2d5a2d;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-danger {
    background: #fff5f5;
    color: #e53e3e;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-warning {
    background: #fff3cd;
    color: #d69e2e;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-secondary {
    background: #f8f9fa;
    color: #4a5568;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid #e2e8f0;
}

.badge-info {
    padding: 0.2rem 0.5rem;
    background: #e3f2fd;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* Values & Counts */
.value-primary { font-weight: 500; color: var(--primary-blue-dark); }
.value-lg-alt { font-size: 1.2rem; font-weight: 500; color: var(--gray-600); }
.value-xl-warning { font-size: 1.5rem; font-weight: 600; color: #f6ad55; }
.count-danger { color: var(--status-red); font-weight: 500; }
.count-success { color: var(--status-green); font-weight: 500; }

/* Alignment */
.align-top { vertical-align: top; }

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .report-header {
        margin: 1rem -16px;
        padding: 1.5rem;
    }
    
    .team-skills-table {
        min-width: auto;
        font-size: 0.9rem;
    }
    
    .heatmap-cell {
        min-width: 25px;
        padding: 4px 6px;
        font-size: 0.8rem;
    }
    
    .legend-items {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* ===== MATERIAL DESIGN OVERRIDES ===== */
.mdc-card {
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
}

.mdc-data-table {
    border: none !important;
}

.mdc-data-table__table {
    border: none !important;
}

.mdc-data-table__table th {
    text-align: left !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    border: none !important;
}

.mdc-data-table__table td {
    text-align: left !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    border: none !important;
}

.mdc-data-table__header-cell,
.mdc-data-table__cell,
.mdc-data-table__row {
    border: none !important;
}

.mdc-button:focus,
.mdc-button:active {
    outline: none !important;
    border: none !important;
}