/* ============================================
   MOTIVATION & REWARDS - Phase 14.1
   Employee financial incentives, Lean Belts, ROI
   ============================================ */

/* Tab Navigation */
.motivation-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e2e8f0;
    flex-wrap: wrap;
    margin-bottom: 24px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.motivation-tab {
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    transition: all 0.2s;
}

.motivation-tab:hover {
    color: #334155;
    background: #f8fafc;
}

.motivation-tab.active {
    color: #3b82f6;
    font-weight: 600;
    border-bottom-color: #3b82f6;
}

/* Stat Cards */
.motivation-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.motivation-stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #e2e8f0;
    text-align: center;
    transition: box-shadow 0.2s;
}

.motivation-stat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.motivation-stat-value {
    font-size: 28px;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.2;
    margin-bottom: 4px;
}

.motivation-stat-label {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
}

.motivation-stat-sub {
    font-size: 11px;
    color: #cbd5e1;
    margin-top: 4px;
}

/* Belt Display */
.motivation-belt-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #e2e8f0;
    margin-bottom: 24px;
}

.motivation-belt-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.motivation-belt-badge {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    border: 3px solid;
    flex-shrink: 0;
}

.motivation-belt-info h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 4px 0;
}

.motivation-belt-info p {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

.motivation-belt-progress {
    margin-bottom: 8px;
}

.motivation-belt-progress-bar {
    height: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 6px;
}

.motivation-belt-progress-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.6s ease;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
}

.motivation-belt-progress-text {
    font-size: 12px;
    color: #64748b;
    text-align: right;
}

/* Belt Criteria Grid */
.motivation-criteria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
}

.motivation-criteria-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 12px;
}

.motivation-criteria-check {
    font-size: 14px;
    flex-shrink: 0;
}

.motivation-criteria-label {
    flex: 1;
    color: #475569;
}

.motivation-criteria-value {
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
}

/* Rewards Table */
.motivation-table-wrap {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    margin-bottom: 24px;
}

.motivation-table-title {
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.motivation-table {
    width: 100%;
    border-collapse: collapse;
}

.motivation-table th {
    text-align: left;
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.motivation-table td {
    padding: 12px 16px;
    font-size: 13px;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
}

.motivation-table tr:last-child td {
    border-bottom: none;
}

.motivation-table tr:hover {
    background: #f8fafc;
}

/* Status Badges */
.motivation-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.motivation-status-pending { background: #fef3c7; color: #92400e; }
.motivation-status-approved { background: #dbeafe; color: #1d4ed8; }
.motivation-status-paid { background: #d1fae5; color: #065f46; }
.motivation-status-rejected { background: #fee2e2; color: #991b1b; }

/* Leaderboard */
.motivation-leaderboard-row {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    gap: 12px;
    transition: background 0.15s;
}

.motivation-leaderboard-row:hover {
    background: #f8fafc;
}

.motivation-leaderboard-row.my-row {
    background: #eff6ff;
    border-left: 3px solid #3b82f6;
}

.motivation-lb-rank {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #475569;
    flex-shrink: 0;
}

.motivation-lb-rank-1 { background: #fef3c7; color: #92400e; }
.motivation-lb-rank-2 { background: #e2e8f0; color: #475569; }
.motivation-lb-rank-3 { background: #fed7aa; color: #9a3412; }

.motivation-lb-name {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
}

.motivation-lb-dept {
    font-size: 11px;
    color: #94a3b8;
}

.motivation-lb-belt {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.motivation-lb-stat {
    text-align: right;
    min-width: 60px;
    flex-shrink: 0;
}

.motivation-lb-stat-val {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}

.motivation-lb-stat-label {
    font-size: 10px;
    color: #94a3b8;
}

/* Period Selector */
.motivation-period-select {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 3px;
    width: fit-content;
}

.motivation-period-btn {
    padding: 6px 14px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.motivation-period-btn.active {
    background: white;
    color: #1e293b;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* AI Calculator */
.motivation-ai-form {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #e2e8f0;
    margin-bottom: 24px;
}

.motivation-ai-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

.motivation-ai-form input,
.motivation-ai-form textarea,
.motivation-ai-form select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    margin-bottom: 14px;
    box-sizing: border-box;
}

.motivation-ai-form textarea {
    min-height: 80px;
    resize: vertical;
}

.motivation-ai-form input:focus,
.motivation-ai-form textarea:focus,
.motivation-ai-form select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.motivation-ai-btn {
    padding: 10px 24px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.motivation-ai-btn:hover { opacity: 0.9; }
.motivation-ai-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.motivation-ai-result {
    background: #f0fdf4;
    border: 2px solid #22c55e;
    border-radius: 12px;
    padding: 24px;
    margin-top: 20px;
}

.motivation-ai-result-header {
    font-size: 16px;
    font-weight: 700;
    color: #166534;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.motivation-ai-big-number {
    font-size: 36px;
    font-weight: 800;
    color: #166534;
    text-align: center;
    margin-bottom: 4px;
}

.motivation-ai-big-label {
    font-size: 13px;
    color: #4ade80;
    text-align: center;
    margin-bottom: 20px;
}

.motivation-ai-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}

.motivation-ai-breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    font-size: 12px;
}

.motivation-ai-breakdown-label { color: #4b5563; }
.motivation-ai-breakdown-value { font-weight: 600; color: #166534; }

.motivation-ai-metrics {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.motivation-ai-metric {
    text-align: center;
    padding: 12px 16px;
    background: white;
    border-radius: 8px;
    flex: 1;
    min-width: 100px;
}

.motivation-ai-metric-val {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
}

.motivation-ai-metric-label {
    font-size: 11px;
    color: #64748b;
}

.motivation-ai-list {
    margin: 8px 0;
    padding-left: 20px;
}

.motivation-ai-list li {
    font-size: 12px;
    color: #4b5563;
    margin-bottom: 4px;
}

/* ROI Summary */
.motivation-roi-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.motivation-roi-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #e2e8f0;
}

.motivation-roi-card.highlight {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-color: #22c55e;
}

.motivation-roi-value {
    font-size: 32px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 4px;
}

.motivation-roi-label {
    font-size: 12px;
    color: #64748b;
}

/* Trend Chart (CSS-based) */
.motivation-trend-chart {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 150px;
    padding: 16px 0;
}

.motivation-trend-bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    height: 100%;
}

.motivation-trend-bars {
    flex: 1;
    display: flex;
    gap: 2px;
    align-items: flex-end;
    width: 100%;
}

.motivation-trend-bar {
    flex: 1;
    border-radius: 3px 3px 0 0;
    min-height: 2px;
    transition: height 0.4s ease;
}

.motivation-trend-bar-savings { background: #22c55e; }
.motivation-trend-bar-rewards { background: #f59e0b; }

.motivation-trend-label {
    font-size: 9px;
    color: #94a3b8;
    white-space: nowrap;
}

/* Settings Form */
.motivation-settings-section {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #e2e8f0;
    margin-bottom: 16px;
}

.motivation-settings-title {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.motivation-settings-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.motivation-settings-row label {
    flex: 1;
    font-size: 13px;
    color: #475569;
}

.motivation-settings-row input[type="number"] {
    width: 120px;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    text-align: right;
}

.motivation-settings-row input[type="number"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.motivation-settings-unit {
    font-size: 12px;
    color: #94a3b8;
    width: 30px;
}

.motivation-save-btn {
    padding: 10px 24px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.motivation-save-btn:hover { opacity: 0.9; }

/* Action buttons */
.motivation-action-btn {
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.motivation-action-btn:hover { opacity: 0.8; }

.motivation-btn-approve {
    background: #d1fae5;
    color: #065f46;
}

.motivation-btn-reject {
    background: #fee2e2;
    color: #991b1b;
}

.motivation-btn-pay {
    background: #dbeafe;
    color: #1d4ed8;
}

/* Empty State */
.motivation-empty {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
    font-size: 14px;
}

.motivation-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

/* Belt History */
.motivation-belt-history {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.motivation-belt-history-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f8fafc;
    border-radius: 20px;
    font-size: 12px;
    border: 1px solid #e2e8f0;
}

/* Responsive */
@media (max-width: 768px) {
    .motivation-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .motivation-roi-cards {
        grid-template-columns: 1fr;
    }
    .motivation-criteria-grid {
        grid-template-columns: 1fr;
    }
    .motivation-ai-metrics {
        flex-direction: column;
    }
    .motivation-leaderboard-row {
        flex-wrap: wrap;
    }
    .motivation-lb-stat {
        min-width: 50px;
    }
    .motivation-settings-row {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .motivation-stats {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .motivation-stat-value {
        font-size: 22px;
    }
    .motivation-tabs {
        flex-wrap: nowrap;
    }
}
