/**
 * Bonus Dashboard Styles
 * Brand colors: Orange (#FF6B35) and Dark Blue (#1B3A57)
 */

:root {
    --primary-orange: #FF6B35;
    --dark-blue: #1B3A57;
    --light-blue: #2E5A7D;
    --accent-orange: #FF8C42;
    --success-green: #4CAF50;
    --warning-yellow: #FFC107;
    --danger-red: #F44336;
    --bg-white: #FFFFFF;
    --bg-light: #F5F5F5;
    --text-dark: #333333;
    --text-light: #666666;
    --border-color: #DDDDDD;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.dashboard-header {
    background: linear-gradient(135deg, var(--dark-blue) 0%, var(--light-blue) 100%);
    color: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
}

.header-main {
    flex: 1;
}

.dashboard-header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 700;
}

.dashboard-header .period-info {
    font-size: 1.1em;
    opacity: 0.9;
}

/* Team Health Score */
.team-health-score {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px 35px;
    text-align: center;
    min-width: 220px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.health-score-label {
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
    margin-bottom: 10px;
    font-weight: 600;
}

.health-score-value {
    font-size: 3.5em;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 8px;
    font-variant-numeric: tabular-nums;
}

.score-denominator {
    font-size: 0.4em;
    font-weight: 500;
    opacity: 0.7;
    margin-left: 2px;
}

.health-score-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
    color: rgba(255, 255, 255, 0.85);
}

.health-grade {
    font-size: 1em;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.health-trend {
    font-size: 0.85em;
    font-weight: 500;
    opacity: 0.9;
}

.health-trend.positive {
    color: rgba(129, 199, 132, 0.95);
}

.health-trend.neutral {
    color: rgba(255, 255, 255, 0.85);
}

.health-trend.negative {
    color: rgba(255, 205, 210, 0.95);
}

.health-components {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
}

.health-components li {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.8em;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.health-components li .component-label {
    font-weight: 600;
    opacity: 0.95;
}

.health-components li .component-value {
    font-size: 1.1em;
    font-weight: 700;
}

.health-components li.positive {
    background: rgba(76, 175, 80, 0.22);
    color: #0f6b28;
}

.health-components li.neutral {
    background: rgba(255, 193, 7, 0.22);
    color: #6b4d00;
}

.health-components li.negative {
    background: rgba(244, 67, 54, 0.24);
    color: #7f1d15;
}

.health-score-value.excellent {
    color: #4CAF50;
    text-shadow: 0 0 20px rgba(76, 175, 80, 0.5);
}

.health-score-value.good {
    color: #8BC34A;
}

.health-score-value.fair {
    color: #FFC107;
}

.health-score-value.needs-attention {
    color: #FF9800;
}

.health-score-value.critical {
    color: #F44336;
}

.health-score-grade {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 5px;
}

.health-score-trend {
    font-size: 1.5em;
    margin-top: 5px;
}

/* Team Performance Section */
.team-performance {
    background: white;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-top: 4px solid var(--primary-orange);
}

.team-performance h2 {
    color: var(--dark-blue);
    margin-bottom: 20px;
    font-size: 1.8em;
}

.team-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-orange);
}

.stat-card .label {
    font-size: 0.9em;
    color: var(--text-light);
    margin-bottom: 8px;
}

.stat-card .value {
    font-size: 2em;
    font-weight: bold;
    color: var(--dark-blue);
    margin-bottom: 5px;
    line-height: 1.3;
}

.stat-composite {
    font-size: 0.5em;
    font-weight: 600;
    margin-left: 8px;
    display: inline-block;
}

.stat-target {
    font-size: 0.38em;
    font-weight: 500;
    color: var(--text-light);
    display: block;
    margin-top: 4px;
}

.stat-card .growth-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}

.stat-card .growth {
    font-size: 0.85em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-card .growth-label {
    font-weight: 700;
    min-width: 45px;
    color: var(--text-dark);
}

.stat-card .growth-value {
    font-weight: 600;
}

.stat-card .growth.positive .growth-value {
    color: var(--success-green);
}

.stat-card .growth.negative .growth-value {
    color: var(--danger-red);
}

.stat-card .growth.neutral .growth-value {
    color: var(--text-light);
}

/* Employee Cards Grid */
.employees-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.employee-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-top: 5px solid var(--primary-orange);
}

.employee-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.employee-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.employee-emoji {
    font-size: 3em;
}

.employee-info h3 {
    font-size: 1.5em;
    color: var(--dark-blue);
    margin-bottom: 5px;
}

.employee-info .role {
    color: var(--text-light);
    font-size: 0.95em;
}

.status-icon {
    margin-left: auto;
    font-size: 2.1em;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
}

/* Bonus Display */
.bonus-display {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.bonus-display .bonus-label {
    font-size: 0.9em;
    color: var(--text-light);
    margin-bottom: 10px;
    text-align: center;
    font-weight: 600;
}

.bonus-progress-bar {
    width: 100%;
    height: 45px;
    background: linear-gradient(90deg,
        #E8E8E8 0%,
        #E8E8E8 20%,
        #D0D0D0 20%,
        #D0D0D0 40%,
        #B8B8B8 40%,
        #B8B8B8 60%,
        #A0A0A0 60%,
        #A0A0A0 80%,
        #888888 80%,
        #888888 100%);
    border-radius: 22px;
    overflow: visible;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.bonus-progress-fill {
    height: 100%;
    background: linear-gradient(90deg,
        #4CAF50 0%,
        #66BB6A 50%,
        #FF6B35 80%,
        #FF8C42 100%);
    border-radius: 22px;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.4);
    position: relative;
    z-index: 1;
}

.bonus-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.3) 0%,
        rgba(255, 255, 255, 0) 50%,
        rgba(0, 0, 0, 0.1) 100%);
    border-radius: 22px;
}

.progress-markers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.marker {
    position: absolute;
    top: 0;
    height: 100%;
    width: 2px;
    background: rgba(255, 255, 255, 0.8);
    transform: translateX(-50%);
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.2);
}

.marker.base-marker {
    width: 3px;
    background: rgba(255, 107, 53, 0.9);
    box-shadow: 0 0 6px rgba(255, 107, 53, 0.7);
    z-index: 3;
}

.bonus-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 700;
    font-size: 0.95em;
    color: var(--dark-blue);
    background: rgba(255, 255, 255, 0.86);
    padding: 6px 14px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    pointer-events: none;
    white-space: normal;
    line-height: 1.3;
    text-align: center;
    min-width: 120px;
}

.bonus-progress-text .final-score {
    font-size: 1.05em;
    font-weight: 700;
    color: var(--dark-blue);
}

.bonus-progress-text .base-score {
    font-size: 0.75em;
    font-weight: 600;
    color: var(--text-light);
}

.bonus-math {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 0.85em;
    font-weight: 600;
    color: var(--text-light);
    gap: 12px;
}

.bonus-math .multiplier {
    transition: color 0.3s ease, transform 0.3s ease;
}

.bonus-math .multiplier.multiplier-positive {
    color: var(--success-green);
}

.bonus-math .multiplier.multiplier-negative {
    color: var(--danger-red);
}

.bonus-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.bonus-summary .summary-item {
    background: white;
    border-radius: 8px;
    padding: 12px;
    box-shadow: inset 0 0 0 1px rgba(27, 58, 87, 0.08);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bonus-summary .summary-item .label {
    font-size: 0.7em;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-light);
    font-weight: 700;
}

.bonus-summary .summary-item .value {
    font-size: 1.1em;
    font-weight: 700;
    color: var(--dark-blue);
}

/* Progress Bar */
.progress-container {
    margin-bottom: 20px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9em;
    color: var(--text-light);
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: var(--bg-light);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success-green) 0%, var(--primary-orange) 100%);
    border-radius: 15px;
    transition: width 1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.9em;
}

/* Metrics List */
.metrics-list {
    list-style: none;
}

.metric-item {
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.metric-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.metric-weight {
    font-size: 0.7em;
    font-weight: 700;
    letter-spacing: 0.45px;
    text-transform: uppercase;
    color: var(--text-light);
    background: rgba(27, 58, 87, 0.08);
    padding: 2px 8px;
    border-radius: 999px;
}

.metric-weight.multiplier-badge {
    background: rgba(255, 107, 53, 0.15);
    color: var(--primary-orange);
}

.metric-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.metric-score {
    font-size: 0.8em;
    font-weight: 700;
    color: var(--dark-blue);
    background: rgba(27, 58, 87, 0.08);
    padding: 3px 8px;
    border-radius: 6px;
}

.metric-name {
    color: var(--text-dark);
    font-size: 0.95em;
    font-weight: 600;
}

.metric-status {
    font-size: 1.3em;
}

.metric-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.metric-current {
    font-size: 0.85em;
    color: var(--text-light);
    font-weight: 500;
}

.metric-breakdown {
    display: block;
    font-size: 0.9em;
    margin-top: 4px;
    color: var(--text-dark);
    font-weight: 400;
}

.breakdown-item {
    display: inline-block;
    margin-right: 8px;
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    display: flex;
    align-items: center;
    gap: 10px;
}

.metric-number {
    font-weight: 600;
    color: var(--dark-blue);
}

.metric-bar {
    width: 100%;
    height: 10px;
    background: #E0E0E0;
    border-radius: 5px;
    overflow: hidden;
}

.metric-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success-green) 0%, var(--primary-orange) 100%);
    border-radius: 5px;
    transition: width 0.5s ease;
}

/* Status Indicators */
.status-excellent {
    color: var(--success-green);
}

.status-good {
    color: var(--warning-yellow);
}

.status-poor {
    color: var(--danger-red);
}

.breakdown-item.positive {
    color: var(--success-green);
}

.breakdown-item.negative {
    color: var(--danger-red);
}

.breakdown-item.neutral {
    color: var(--text-light);
}

/* Loading State */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Error State */
.error {
    background: var(--danger-red);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

/* Footer */
.dashboard-footer {
    padding: 20px;
    color: var(--text-light);
    font-size: 0.9em;
    margin-top: 40px;
}

.last-updated {
    color: var(--text-light);
    font-size: 0.85em;
    text-align: right;
    margin-bottom: 30px;
}

/* Legal Disclaimer */
.legal-disclaimer {
    background: #fffbea;
    border: 3px solid #f5d547;
    border-radius: 12px;
    padding: 30px 35px;
    margin-top: 20px;
    font-size: 0.8em;
    line-height: 1.6;
    color: #4a4a4a;
    box-shadow: 0 4px 12px rgba(245, 213, 71, 0.2);
}

.legal-disclaimer p {
    margin: 0 0 12px 0;
    text-align: justify;
}

.legal-disclaimer p:last-of-type {
    margin-bottom: 0;
}

.legal-disclaimer strong {
    color: #d97706;
    font-weight: 700;
}

.legal-disclaimer em {
    font-style: italic;
    color: #6b5b00;
    font-weight: 500;
}

.disclaimer-date {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid #f5d547;
    text-align: center;
    font-size: 0.9em;
    color: #8b7700;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .employees-grid {
        grid-template-columns: 1fr;
    }

    .team-stats {
        grid-template-columns: 1fr;
    }

    .dashboard-header h1 {
        font-size: 1.8em;
    }

    .bonus-display .bonus-amount {
        font-size: 2em;
    }
}

/* Animation for milestones */
@keyframes celebrate {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.milestone-reached {
    animation: celebrate 0.5s ease-in-out;
}
