/* Account Manager Dashboard - Custom Styles */

/* Color Palette Variables - Now using theme.css variables */
/* These variables are now defined in theme.css for consistency across all pages */

/* Stage Colors - Account Manager Specific */
:root {
    --stage-bids-made: #2196F3;
    --stage-bids-won: #FF9800;
    --stage-contract-signed: #4CAF50;
    --stage-new-revenue: #9C27B0;
}

/* Global Styles - Now using theme.css base styles */
/* Base styles are now defined in theme.css for consistency */

/* Header Styles - Now using theme.css header styles */
/* Header card styles are now defined in theme.css for consistency */

.dashboard-title {
    color: #212529 !important;
    font-size: 1.5rem !important;
    font-weight: 600 !important;
}

.dashboard-subtitle {
    display: none;
}

.header-card .card-body {
    padding: 0.75rem 1rem !important;
}

/* Stage Breakdown Cards - Modern Redesign */
.stage-breakdown-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.stage-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.stage-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    transition: width 0.3s ease;
}

.stage-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
    border-color: rgba(0, 0, 0, 0.1);
}

.stage-card:hover::before {
    width: 6px;
}

.stage-card.bids-made::before {
    background: linear-gradient(180deg, var(--stage-bids-made) 0%, rgba(33, 150, 243, 0.8) 100%);
}

.stage-card.bids-won::before {
    background: linear-gradient(180deg, var(--stage-bids-won) 0%, rgba(255, 152, 0, 0.8) 100%);
}

.stage-card.contract-signed::before {
    background: linear-gradient(180deg, var(--stage-contract-signed) 0%, rgba(76, 175, 80, 0.8) 100%);
}

.stage-card.new-revenue::before {
    background: linear-gradient(180deg, var(--stage-new-revenue) 0%, rgba(156, 39, 176, 0.8) 100%);
}

.stage-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #e9ecef;
}

.stage-card-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: #212529;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.stage-card-percentage-badge {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #495057;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.4rem;
    border-radius: 10px;
    line-height: 1;
    border: 1px solid #dee2e6;
}

.stage-card.bids-made .stage-card-percentage-badge {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.1) 0%, rgba(33, 150, 243, 0.05) 100%);
    color: var(--stage-bids-made);
    border-color: rgba(33, 150, 243, 0.2);
}

.stage-card.bids-won .stage-card-percentage-badge {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.1) 0%, rgba(255, 152, 0, 0.05) 100%);
    color: var(--stage-bids-won);
    border-color: rgba(255, 152, 0, 0.2);
}

.stage-card.contract-signed .stage-card-percentage-badge {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1) 0%, rgba(76, 175, 80, 0.05) 100%);
    color: var(--stage-contract-signed);
    border-color: rgba(76, 175, 80, 0.2);
}

.stage-card.new-revenue .stage-card-percentage-badge {
    background: linear-gradient(135deg, rgba(156, 39, 176, 0.1) 0%, rgba(156, 39, 176, 0.05) 100%);
    color: var(--stage-new-revenue);
    border-color: rgba(156, 39, 176, 0.2);
}

.stage-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.stage-card-count {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}

.stage-card-count-number {
    font-size: 1.4rem;
    font-weight: 800;
    color: #212529;
    line-height: 1;
    letter-spacing: -0.5px;
}

.stage-card-count-label {
    font-size: 0.7rem;
    color: #6c757d;
    font-weight: 500;
    text-transform: lowercase;
}

.stage-card-revenue {
    font-size: 0.8rem;
    font-weight: 700;
    color: #495057;
    line-height: 1.3;
    padding-top: 0.2rem;
    border-top: 1px solid #f1f3f5;
}

/* Dashboard Card Styles - Now using theme.css card styles */
/* Dashboard card styles are now defined in theme.css for consistency */

/* Chart Widget Styles */
.chart-widget {
    min-height: 600px;
}

.chart-container {
    width: 100%;
    height: 500px;
    position: relative;
    background-color: #fafafa;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: visible;
}

.chart-container svg {
    position: relative;
    z-index: 0;
}

.chart-controls {
    padding: 0rem 0;
}

.chart-controls .row {
    width: 100%;
    margin: 0;
}

.chart-controls .form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.chart-controls .form-select {
    width: 100%;
    font-size: 0.875rem;
}

.chart-controls .btn-group .btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
}

/* Chart Legend Styles */
.chart-legend {
    background-color: var(--secondary-gray-light);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.legend-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.legend-bubble {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.legend-bubble.small {
    width: 12px;
    height: 12px;
    background-color: var(--primary-blue-light);
}

.legend-bubble.medium {
    width: 16px;
    height: 16px;
    background-color: var(--primary-blue-medium);
}

.legend-bubble.large {
    width: 20px;
    height: 20px;
    background-color: var(--primary-blue-dark);
}

.legend-height {
    width: 4px;
    border-radius: 2px;
    background-color: var(--secondary-gray-dark);
    margin-right: 0.5rem;
}

.legend-height.short {
    height: 8px;
}

.legend-height.medium {
    height: 12px;
}

.legend-height.tall {
    height: 16px;
}

/* Bubble Chart Specific Styles */
.bubble {
    cursor: pointer;
    transition: all 0.3s ease;
    stroke: white;
    stroke-width: 2;
    z-index: -1;
}

.bubble:hover {
    stroke-width: 3;
    stroke: var(--text-primary);
    z-index: 0;
}

.bubble circle {
    z-index: -1;
}

.bubble text {
    z-index: 1;
    pointer-events: none;
}

.bubble.stage-bids-made {
    fill: var(--stage-bids-made);
}

.bubble.stage-bids-won {
    fill: var(--stage-bids-won);
}

.bubble.stage-contract-signed {
    fill: var(--stage-contract-signed);
}

.bubble.stage-new-revenue {
    fill: var(--stage-new-revenue);
}

.bubble-label {
    font-family: 'Arial', 'Helvetica', sans-serif;
    font-size: 10px;
    font-weight: bold;
    text-anchor: middle;
    dominant-baseline: central;
    fill: white;
    pointer-events: none;
    stroke-width: 0px;
    z-index: 1;
}

.stage-axis {
    font-size: 12px;
    font-weight: 600;
    text-anchor: middle;
    fill: var(--text-primary);
}

.stage-line {
    stroke: var(--border-color);
    stroke-width: 1;
    stroke-dasharray: 3,3;
    opacity: 0.6;
}

/* Summary Statistics Styles */
.summary-stat {
    text-align: center;
    padding: 1rem;
    background-color: var(--secondary-gray-light);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.summary-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.summary-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.5rem;
}

.summary-change {
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 0.25rem;
}

.summary-change.positive {
    color: var(--accent-green-dark);
}

.summary-change.negative {
    color: var(--danger-red-dark);
}

/* Stage Breakdown Styles */
.stage-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background-color: var(--secondary-gray-light);
    border-radius: 6px;
    border-left: 4px solid;
    transition: all 0.2s ease;
}

.stage-item:hover {
    background-color: var(--primary-blue-light);
    transform: translateX(2px);
}

.stage-item.bids-made {
    border-left-color: var(--stage-bids-made);
}

.stage-item.bids-won {
    border-left-color: var(--stage-bids-won);
}

.stage-item.contract-signed {
    border-left-color: var(--stage-contract-signed);
}

.stage-item.new-revenue {
    border-left-color: var(--stage-new-revenue);
}

.stage-info {
    flex: 1;
}

.stage-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.stage-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.stage-value {
    text-align: right;
}

.stage-revenue {
    font-weight: 600;
    color: var(--text-primary);
}

.stage-percentage {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Top Opportunities Styles */
.opportunity-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background-color: var(--secondary-gray-light);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.opportunity-item:hover {
    background-color: var(--accent-green-light);
    transform: translateY(-1px);
}

.opportunity-info {
    flex: 1;
}

.opportunity-company {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.opportunity-contact {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.opportunity-stage {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    background-color: var(--primary-blue-light);
    color: var(--primary-blue-dark);
    font-weight: 500;
}

.opportunity-value {
    text-align: right;
}

.opportunity-revenue {
    font-weight: 600;
    color: var(--text-primary);
}

.opportunity-weeks {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Tooltip Styles */
.tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px;
    border-radius: 8px;
    font-size: 12px;
    pointer-events: none;
    z-index: 20;
    max-width: 250px;
    word-wrap: break-word;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.tooltip.visible {
    opacity: 1;
}

.tooltip-title {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 0.5rem;
    color: white;
}

.tooltip-content {
    line-height: 1.4;
}

.tooltip-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.tooltip-label {
    color: #ccc;
}

.tooltip-value {
    font-weight: 500;
    color: white;
}

/* AI Summary Styles */
.ai-summary-container {
    padding: 0.5rem 0;
}

.ai-summary-header {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.ai-summary-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.ai-stat-item {
    text-align: center;
    padding: 0.75rem;
    background-color: var(--secondary-gray-light);
    border-radius: 6px;
}

.ai-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.ai-stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

.ai-insights {
    margin-top: 1rem;
}

.ai-insights-header {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.ai-insight-item {
    display: flex;
    align-items: flex-start;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.ai-insight-warning {
    background-color: rgba(255, 193, 7, 0.1);
    border-left: 3px solid #ffc107;
    color: var(--text-primary);
}

.ai-insight-info {
    background-color: rgba(23, 162, 184, 0.1);
    border-left: 3px solid #17a2b8;
    color: var(--text-primary);
}

.ai-insight-success {
    background-color: rgba(40, 167, 69, 0.1);
    border-left: 3px solid #28a745;
    color: var(--text-primary);
}

.ai-top-opportunities {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.ai-opportunities-header {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.ai-opportunity-item {
    padding: 0.5rem;
    background-color: var(--secondary-gray-light);
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.ai-opportunity-company {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.ai-opportunity-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
}

.ai-opportunity-revenue {
    font-weight: 600;
    color: var(--accent-green-dark);
}

.ai-opportunity-probability {
    color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-title {
        font-size: 1.3rem;
    }
    
    .dashboard-subtitle {
        font-size: 1rem;
    }
    
    .status-indicator {
        text-align: left;
        margin-top: 1rem;
    }
    
    .dashboard-card .card-body {
        padding: 1rem;
    }
    
    .chart-container {
        height: 400px;
    }
    
    .chart-controls {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .chart-controls .btn-group {
        width: 100%;
    }
    
    .chart-legend .row {
        flex-direction: column;
    }
    
    .chart-legend .col-md-6 {
        margin-bottom: 1rem;
    }
    
    .stage-breakdown-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .stage-card {
        padding: 0.65rem;
    }
    
    .stage-card-count-number {
        font-size: 1.25rem;
    }
    
    .stage-card-revenue {
        font-size: 0.75rem;
    }
    
    .stage-card-name {
        font-size: 0.7rem;
    }
}

@media (max-width: 576px) {
    .container-fluid {
        padding: 1rem;
    }
    
    .header-card {
        margin-bottom: 1rem;
    }
    
    .header-card .card-body {
        padding: 0.75rem !important;
    }
    
    .dashboard-title {
        font-size: 1.2rem;
    }
    
    .dashboard-card .card-header {
        padding: 0.75rem 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .dashboard-card .card-title {
        font-size: 1rem;
    }
    
    .chart-container {
        height: 350px;
    }
    
    .stage-breakdown-cards {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .stage-card {
        padding: 0.65rem;
    }
    
    .stage-card-count-number {
        font-size: 1.2rem;
    }
    
    .stage-card-revenue {
        font-size: 0.75rem;
    }
    
    .stage-card-name {
        font-size: 0.7rem;
    }
}

/* Loading Animation */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--secondary-gray-medium);
    border-radius: 50%;
    border-top-color: var(--primary-blue-dark);
    animation: spin 1s ease-in-out infinite;
}

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

/* Utility Classes */
.text-muted {
    color: var(--text-secondary) !important;
}

.bg-light {
    background-color: var(--secondary-gray-light) !important;
}

.border {
    border-color: var(--border-color) !important;
}

/* Custom Badge Styles */
.badge {
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}

.badge-success {
    background-color: var(--accent-green-medium);
    color: var(--text-primary);
}

.badge-warning {
    background-color: var(--warning-orange-medium);
    color: var(--text-primary);
}

.badge-info {
    background-color: var(--primary-blue-medium);
    color: var(--text-primary);
}

.badge-secondary {
    background-color: var(--secondary-gray-dark);
    color: white;
}

/* Button Styles */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-blue-dark);
    border-color: var(--primary-blue-dark);
}

.btn-primary:hover {
    background-color: var(--primary-blue-medium);
    border-color: var(--primary-blue-medium);
}

.btn-outline-primary {
    color: #ffffff;
    border-color: var(--primary-blue-dark);
}

.btn-outline-primary:hover {
    background-color: var(--primary-blue-dark);
    border-color: var(--primary-blue-dark);
    color: white;
}

.btn-outline-primary.active {
    /* background-color: var(--primary-blue-dark); */
    border-color: var(--primary-blue-dark);
    color: white;
}
