/* Team View Dashboard - Custom Styles */

/* Team View Container */
.teamview-container {
    background-color: var(--background-color);
    min-height: 100vh;    
}

/* Team View Specific Header Styles - Now using theme.css header styles */
/* Header card styles are now defined in theme.css for consistency */

/* Team Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.metric-card {
    background-color: var(--secondary-gray-light);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background-color: white;
}

.metric-card .metric-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-blue-dark);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.metric-card .metric-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* Team Performance Graph Specific Styles */
#team-performance-graph {
    min-height: 500px;
    background-color: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    position: relative;
}

#team-performance-graph svg {
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

/* Collaboration Network Specific Styles */
#team-collaboration-graph {
    min-height: 400px;
    background-color: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    position: relative;
}

#team-collaboration-graph svg {
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

/* Individual Performance Graph Specific Styles */
#individual-performance-graph {
    min-height: 400px;
    background-color: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    position: relative;
}

#individual-performance-graph svg {
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

/* Activity Timeline Specific Styles */
#team-activity-timeline {
    min-height: 300px;
    background-color: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    position: relative;
}

#team-activity-timeline svg {
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

/* Team Member Node Styles */
.team-member-node {
    cursor: pointer;
    transition: all 0.3s ease;
}

.team-member-node:hover {
    transform: scale(1.1);
    filter: brightness(1.2);
}

.team-member-node circle {
    stroke: white;
    stroke-width: 2px;
    transition: all 0.3s ease;
}

.team-member-node:hover circle {
    stroke-width: 3px;
    stroke: var(--primary-blue-dark);
}

.team-member-label {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 12px;
    font-weight: 600;
    fill: var(--text-primary);
    text-anchor: middle;
    dominant-baseline: central;
    pointer-events: none;
}

/* Performance Bar Styles */
.performance-bar {
    fill: var(--primary-blue-dark);
    transition: all 0.3s ease;
    cursor: pointer;
}

.performance-bar:hover {
    fill: var(--primary-blue-medium);
    filter: brightness(1.1);
}

.performance-bar-background {
    fill: var(--secondary-gray-medium);
    opacity: 0.3;
}

/* Activity Timeline Styles */
.activity-timeline-axis {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 12px;
    fill: var(--text-secondary);
}

.activity-timeline-axis path,
.activity-timeline-axis line {
    fill: none;
    stroke: var(--border-color);
    stroke-width: 1px;
}

.activity-marker {
    cursor: pointer;
    transition: all 0.3s ease;
}

.activity-marker:hover {
    transform: scale(1.2);
}

.activity-marker circle {
    stroke: white;
    stroke-width: 2px;
    transition: all 0.3s ease;
}

.activity-marker:hover circle {
    stroke-width: 3px;
    stroke: var(--primary-blue-dark);
}

/* Collaboration Link Styles */
.collaboration-link {
    stroke: var(--secondary-gray-dark);
    stroke-width: 2px;
    stroke-opacity: 0.6;
    transition: all 0.3s ease;
    cursor: pointer;
}

.collaboration-link:hover {
    stroke: var(--primary-blue-dark);
    stroke-width: 3px;
    stroke-opacity: 1;
}

/* Team Performance Chart Styles */
.team-performance-chart {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.team-performance-axis {
    font-size: 12px;
    fill: var(--text-secondary);
}

.team-performance-axis path,
.team-performance-axis line {
    fill: none;
    stroke: var(--border-color);
    stroke-width: 1px;
}

.team-performance-grid {
    stroke: var(--secondary-gray-medium);
    stroke-width: 1px;
    stroke-opacity: 0.3;
}

/* Legend Styles */
.team-legend {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
}

.team-legend-item {
    display: inline-flex;
    align-items: center;
    margin: 0.5rem 1rem 0.5rem 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.team-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    margin-right: 0.5rem;
    border: 1px solid var(--border-color);
}

/* Tooltip Styles for Team View */
.teamview-tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid #ffffff20;
    max-width: 300px;
}

.teamview-tooltip .tooltip-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #ffd700;
}

.teamview-tooltip .tooltip-value {
    font-size: 18px;
    font-weight: 600;
    color: #4CAF50;
    margin: 4px 0;
}

.teamview-tooltip .tooltip-details {
    font-size: 12px;
    color: #cccccc;
    margin-top: 8px;
    border-top: 1px solid #ffffff20;
    padding-top: 6px;
}

/* Loading States */
.teamview-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 400px;
    background-color: rgba(248, 249, 250, 0.8);
    border-radius: 8px;
}

.teamview-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e9ecef;
    border-top: 4px solid var(--primary-blue-dark);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design for Team View */
@media (max-width: 768px) {
    .teamview-container {
        padding: 0.5rem;
    }
    
    .teamview-container .customer-name {
        font-size: 1.5rem;
    }
    
    .teamview-container .customer-details {
        font-size: 1rem;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .metric-card .metric-value {
        font-size: 1.5rem;
    }
    
    .metric-card .metric-label {
        font-size: 0.8rem;
    }
    
    #team-performance-graph,
    #team-collaboration-graph,
    #individual-performance-graph {
        min-height: 300px;
    }
    
    #team-activity-timeline {
        min-height: 250px;
    }
    
    .team-member-label {
        font-size: 10px;
    }
    
    .activity-timeline-axis {
        font-size: 10px;
    }
}

@media (max-width: 576px) {
    .teamview-container {
        padding: 0.25rem;
    }
    
    .teamview-container .customer-name {
        font-size: 1.3rem;
    }
    
    .teamview-container .customer-details {
        font-size: 0.9rem;
    }
    
    .metric-card {
        padding: 0.75rem;
    }
    
    .metric-card .metric-value {
        font-size: 1.3rem;
    }
    
    .metric-card .metric-label {
        font-size: 0.75rem;
    }
    
    #team-performance-graph,
    #team-collaboration-graph,
    #individual-performance-graph {
        min-height: 250px;
    }
    
    #team-activity-timeline {
        min-height: 200px;
    }
    
    .team-member-label {
        font-size: 9px;
    }
    
    .activity-timeline-axis {
        font-size: 9px;
    }
    
    .team-legend-item {
        font-size: 12px;
        margin: 0.25rem 0.5rem 0.25rem 0;
    }
    
    .team-legend-color {
        width: 12px;
        height: 12px;
    }
}

/* Animation Classes for Team View */
.teamview-fade-in {
    animation: teamviewFadeIn 0.5s ease-in;
}

@keyframes teamviewFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.teamview-slide-in {
    animation: teamviewSlideIn 0.3s ease-out;
}

@keyframes teamviewSlideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Team Leader Dashboard Specific Styles */
.account-manager-card {
    min-height: 350px;
    transition: all 0.3s ease;
}

.account-manager-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.account-manager-card .card-header {
    padding: 0.75rem 1rem;
    background-color: var(--primary-blue-light);
    border-bottom: 1px solid var(--border-color);
}

.account-manager-card .card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.account-manager-card .card-body {
    padding: 1rem;
}

.account-manager-graph {
    min-height: 250px;
    width: 100%;
    position: relative;
}

.account-manager-graph svg {
    width: 100%;
    height: 100%;
    border-radius: 4px;
}

/* Team Summary Metrics */
#team-summary-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.summary-metric-card {
    background-color: var(--secondary-gray-light);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    min-height: auto;
}

.summary-metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background-color: white;
}

.summary-metric-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-blue-dark);
    line-height: 1.1;
    margin-bottom: 0.25rem;
}

.summary-metric-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 500;
    margin-bottom: 0.1rem;
}

.summary-metric-change {
    font-size: 0.65rem;
    font-weight: 500;
    margin-top: 0.1rem;
    line-height: 1.2;
}

.summary-metric-change.positive {
    color: var(--accent-green-medium);
}

.summary-metric-change.negative {
    color: var(--warning-orange-medium);
}

/* Product Legend Styles - Original Section */
.legend-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: white;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.3s ease;
    cursor: pointer;
}

.legend-item:hover {
    background-color: var(--primary-blue-light);
    border-color: var(--primary-blue-dark);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 123, 255, 0.2);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.legend-item.disabled {
    opacity: 0.5;
    text-decoration: line-through;
}

/* Floating Legend Popup - Bottom Right */
.legend-container.floating {
    position: fixed;
    bottom: 15px;
    right: 15px;
    background-color: rgba(0, 0, 0, 0.9);
    border-radius: 6px;
    padding: 6px 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    justify-content: center;
    max-width: fit-content;
}

.legend-container.floating .close-icon {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 16px;
    height: 16px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
    font-weight: bold;
    color: #333;
    transition: all 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.legend-container.floating .close-icon:hover {
    background-color: #ff4444;
    color: white;
    transform: scale(1.1);
}

.legend-container.floating .close-icon::before {
    content: "×";
    line-height: 1;
}

.legend-container.floating::before {
    content: "Legend";
    color: white;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-right: 6px;
    flex-shrink: 0;
}

.legend-container.floating .legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 6px;
    font-size: 9px;
    font-weight: 500;
    color: white;
    transition: all 0.2s ease;
    cursor: pointer;
    border-radius: 3px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.legend-container.floating .legend-item:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.legend-container.floating .legend-color {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.legend-container.floating .legend-item.disabled {
    opacity: 0.4;
    text-decoration: line-through;
}

.legend-container.floating .legend-item.disabled .legend-color {
    opacity: 0.3;
}


/* Responsive Grid Adjustments */
@media (max-width: 1200px) {
    .account-manager-card {
        min-height: 320px;
    }
    
    .account-manager-graph {
        min-height: 220px;
    }
}

@media (max-width: 992px) {
    .account-manager-card {
        min-height: 300px;
    }
    
    .account-manager-graph {
        min-height: 200px;
    }
    
    #team-summary-metrics {
        gap: 0.5rem;
    }
}

@media (max-width: 768px) {
    .account-manager-card {
        min-height: 280px;
    }
    
    .account-manager-graph {
        min-height: 180px;
    }
    
    .account-manager-card .card-header {
        padding: 0.5rem 0.75rem;
    }
    
    .account-manager-card .card-body {
        padding: 0.75rem;
    }
    
    .account-manager-card .card-title {
        font-size: 0.8rem;
    }
    
    #team-summary-metrics {
        gap: 0.5rem;
    }
    
    .summary-metric-card {
        padding: 0.75rem;
    }
    
    .summary-metric-value {
        font-size: 1.3rem;
    }
    
    .summary-metric-label {
        font-size: 0.75rem;
    }
    
    .legend-container {
        gap: 0.75rem;
        padding: 0.75rem;
    }
    
    .legend-item {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .legend-color {
        width: 14px;
        height: 14px;
    }
}

@media (max-width: 576px) {
    .account-manager-card {
        min-height: 260px;
    }
    
    .account-manager-graph {
        min-height: 160px;
    }
    
    #team-summary-metrics {
        gap: 0.5rem;
    }
    
    .summary-metric-card {
        padding: 0.5rem;
    }
    
    .summary-metric-value {
        font-size: 1.1rem;
    }
    
    .summary-metric-label {
        font-size: 0.7rem;
    }
    
    .legend-container {
        bottom: 8px;
        right: 8px;
        padding: 4px 8px;
        gap: 6px;
    }
    
    .legend-item {
        font-size: 8px;
        padding: 2px 4px;
        gap: 3px;
    }
    
    .legend-color {
        width: 6px;
        height: 6px;
    }
}

/* Team View Specific Color Palette */
:root {
    --team-lead-color: #007bff;
    --developer-color: #28a745;
    --designer-color: #dc3545;
    --qa-color: #ffc107;
    --collaboration-color: #17a2b8;
    --performance-high: #28a745;
    --performance-medium: #ffc107;
    --performance-low: #dc3545;
}

/* Performance Level Colors */
.performance-high {
    fill: var(--performance-high);
}

.performance-medium {
    fill: var(--performance-medium);
}

.performance-low {
    fill: var(--performance-low);
}

/* Role-based Colors */
.role-team-lead {
    fill: var(--team-lead-color);
}

.role-developer {
    fill: var(--developer-color);
}

.role-designer {
    fill: var(--designer-color);
}

.role-qa {
    fill: var(--qa-color);
}

/* Team Leader Dashboard Graph Styles */
.previous-year-line {
    stroke: #AD686B !important;
    stroke-width: 5px !important;
    stroke-dasharray: 12,6 !important;
    stroke-opacity: 1 !important;
    fill: none !important;
    vector-effect: non-scaling-stroke !important;
}

.previous-year-group {
    pointer-events: none;
}

.product-area {
    transition: opacity 0.3s ease;
    opacity: 0.8;
}

.product-area:hover {
    opacity: 0.6;
}

/* Ensure the churn line is always visible and prominent */
svg .previous-year-line {
    stroke: #919191 !important;
    stroke-width: 3px !important;
    stroke-dasharray: 8,4 !important;
    stroke-opacity: 0.8 !important;
    fill: none !important;
}

/* Churn line styling */
svg .churn-line {
    stroke: #DC3545 !important;
    stroke-width: 4px !important;
    stroke-opacity: 1 !important;
    fill: none !important;
    vector-effect: non-scaling-stroke !important;
}

.churn-group {
    pointer-events: none;
}