/* Dashboard Specific Styles - Styles for dashboard components and data visualization */

/* Repository Information */
.repository-info {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border-left: 4px solid #3498db;
}

.repository-info h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.repo-description {
    color: #666;
    font-style: italic;
    margin-bottom: 1rem;
}

.repo-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #3498db;
    font-weight: 500;
    transition: color 0.3s ease;
}

.repo-link:hover {
    color: #2980b9;
}

/* Metrics Sections */
.metrics-section {
    margin-bottom: 2rem;
}

.metrics-section h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.metric-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e8ed;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3498db, #2ecc71);
}

.metric-card.repository-metric::before {
    background: linear-gradient(90deg, #3498db, #9b59b6);
}

.metric-card.filtered-metric::before {
    background: linear-gradient(90deg, #e74c3c, #f39c12);
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.metric-label {
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Date Range */
.date-range {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    border-left: 3px solid #2ecc71;
    margin-top: 1rem;
}

.date-range h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.date-range p {
    margin-bottom: 0.25rem;
    color: #666;
}

/* Commit List */
.commits-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e1e8ed;
}

.commits-list {
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
}

.commit-item {
    padding: 1rem;
    border-bottom: 1px solid #e1e8ed;
    transition: background-color 0.2s ease;
    position: relative;
    cursor: pointer;
}

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

.commit-item:hover {
    background-color: #f8f9fa;
}

.commit-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    cursor: pointer;
}

.expand-icon {
    margin-left: auto;
    font-size: 0.8rem;
    color: #666;
    transition: transform 0.3s ease;
}

.commit-item.expanded .expand-icon {
    transform: rotate(90deg);
}

.commit-sha {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    background-color: #f1f3f4;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #2c3e50;
    font-weight: 600;
}

.commit-author {
    color: #3498db;
    font-weight: 500;
}

.commit-date {
    color: #666;
    font-size: 0.9rem;
}

.commit-message {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.commit-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.commit-stats .additions {
    color: #2ecc71;
}

.commit-stats .deletions {
    color: #e74c3c;
}

.commit-stats .files {
    color: #666;
}

/* Expandable Commit Details */
.commit-details-expanded {
    display: none;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e1e8ed;
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 1rem;
}

.commit-item.expanded .commit-details-expanded {
    display: block;
}

.commit-full-message h5,
.commit-metadata h5,
.commit-files h5 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.commit-full-message pre {
    background: white;
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid #e1e8ed;
    font-size: 0.85rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #2c3e50;
}

.metadata-row {
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: #555;
}

.metadata-row strong {
    color: #2c3e50;
    font-weight: 600;
}

.commit-files {
    margin-top: 1rem;
}

.commit-files ul {
    list-style: none;
    padding: 0;
    background: white;
    border-radius: 4px;
    border: 1px solid #e1e8ed;
    max-height: 200px;
    overflow-y: auto;
}

.commit-files li {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #f1f3f4;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8rem;
    color: #2c3e50;
}

.commit-files li:last-child {
    border-bottom: none;
}

.commit-files li em {
    color: #666;
    font-style: italic;
}

.commits-help {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-style: italic;
}

/* Charts Container */
.charts-container {
    margin-top: 2rem;
    display: grid;
    gap: 2rem;
}

.chart-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e8ed;
}

.chart-section h4 {
    margin-bottom: 1rem;
    color: #2c3e50;
    border-bottom: 1px solid #e1e8ed;
    padding-bottom: 0.5rem;
}

.chart {
    min-height: 200px;
    position: relative;
}

/* Timeline Chart */
.timeline-chart {
    display: flex;
    flex-direction: column;
    height: 250px;
}

.chart-bars {
    flex: 1;
    display: flex;
    align-items: end;
    gap: 2px;
    padding: 0 10px;
    margin-bottom: 10px;
}

.chart-bar {
    flex: 1;
    background: linear-gradient(to top, #3498db, #5dade2);
    border-radius: 2px 2px 0 0;
    position: relative;
    min-height: 2px;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.chart-bar:hover {
    opacity: 0.8;
}

.bar-value {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: #666;
    white-space: nowrap;
}

.chart-labels {
    display: flex;
    gap: 2px;
    padding: 0 10px;
}

.chart-label {
    flex: 1;
    text-align: center;
    font-size: 0.75rem;
    color: #666;
    transform: rotate(-45deg);
    transform-origin: center;
    white-space: nowrap;
}

/* Contributors Chart */
.contributors-chart {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contributor-bar {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.contributor-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contributor-name {
    font-weight: 500;
    color: #2c3e50;
}

.contributor-commits {
    font-size: 0.9rem;
    color: #666;
}

.contributor-progress {
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* File Type Chart */
.filetype-chart {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stacked-bar {
    height: 20px;
    display: flex;
    border-radius: 10px;
    overflow: hidden;
    background-color: #e9ecef;
}

.segment {
    height: 100%;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.segment:hover {
    opacity: 0.8;
}

.chart-legend {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
}

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

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.legend-label {
    flex: 1;
    color: #2c3e50;
    font-weight: 500;
}

.legend-value {
    color: #666;
    font-size: 0.8rem;
}

/* Productivity Chart */
.productivity-chart {
    position: relative;
    height: 200px;
}

.chart-area {
    position: relative;
    height: 150px;
    border-bottom: 1px solid #e1e8ed;
    border-left: 1px solid #e1e8ed;
}

.chart-point {
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: #3498db;
    border-radius: 50%;
    transform: translate(-50%, 50%);
    cursor: pointer;
}

.chart-point:hover {
    background-color: #2980b9;
    transform: translate(-50%, 50%) scale(1.2);
}

/* Commit Size Chart */
.commit-size-chart {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.size-category {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.category-label {
    min-width: 120px;
    font-size: 0.9rem;
    color: #2c3e50;
    font-weight: 500;
}

.category-bar {
    flex: 1;
    height: 20px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.6s ease;
}

.category-value {
    min-width: 80px;
    text-align: right;
    font-size: 0.85rem;
    color: #666;
}

/* No Data States */
.no-data {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 2rem;
}

.chart-error {
    text-align: center;
    color: #e74c3c;
    padding: 1rem;
    background-color: #ffebee;
    border-radius: 4px;
    border: 1px solid #ffcdd2;
}

/* Loading States */
.chart-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: #666;
}

.chart-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

/* Responsive adjustments for charts */
@media (max-width: 768px) {
    .charts-container {
        grid-template-columns: 1fr;
    }
    
    .chart-label {
        transform: rotate(-90deg);
        font-size: 0.65rem;
    }
    
    .contributor-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .legend-item {
        font-size: 0.8rem;
    }
}

/* Date Filter Section Styles */
.filter-controls {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e1e8ed;
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group h4 {
    color: #2c3e50;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
}

/* Quick Filter Buttons */
.quick-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.filter-btn {
    background: white;
    border: 2px solid #e1e8ed;
    color: #495057;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: #3498db;
    color: #3498db;
}

.filter-btn.active {
    background: #3498db;
    border-color: #3498db;
    color: white;
}

/* Custom Date Range */
.custom-date-range {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 1rem;
}

.date-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.date-input-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #495057;
}

.date-input {
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
    background: white;
}

.date-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Filter Status */
.filter-status {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #e1e8ed;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-status p {
    margin: 0;
    color: #666;
    font-weight: 500;
}

.btn-outline {
    background: transparent;
    border: 1px solid #6c757d;
    color: #6c757d;
}

.btn-outline:hover {
    background: #6c757d;
    color: white;
}

/* Collapsed Repository Section */
.section.collapsed {
    padding: 1rem 2rem;
}

.section.collapsed .section-header {
    margin-bottom: 0.5rem;
}

.section.collapsed .section-header h2 {
    font-size: 1.2rem;
}

.section.collapsed .input-group {
    display: none;
}

.section-summary {
    display: none;
    color: #666;
    font-size: 0.9rem;
    font-style: italic;
}

.section.collapsed .section-summary {
    display: block;
}

/* Responsive Design for Filters */
@media (max-width: 768px) {
    .quick-filters {
        flex-direction: column;
    }
    
    .filter-btn {
        text-align: center;
    }
    
    .custom-date-range {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-status {
        flex-direction: column;
        align-items: stretch;
    }
}
