/* ============================================================
   AI FEATURES CSS - Modern Styling for AI Components
   Includes: Widgets, Panels, Modals, Cards, Charts
   ============================================================ */

:root {
    --ai-primary: #667eea;
    --ai-secondary: #764ba2;
    --ai-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --ai-success: #10b981;
    --ai-warning: #f59e0b;
    --ai-danger: #ef4444;
    --ai-info: #3b82f6;
    --ai-card-bg: rgba(255, 255, 255, 0.95);
    --ai-shadow: 0 10px 40px rgba(102, 126, 234, 0.15);
    --ai-radius: 16px;
}

/* ============================================================
   AI DASHBOARD WIDGETS
   ============================================================ */

.ai-widgets-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 0;
    max-width: 100%;
}

.ai-widget {
    background: var(--ai-card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
    padding: 15px;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
    min-height: auto;
    max-height: 280px;
}

.ai-widget:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(102, 126, 234, 0.25);
}

.ai-widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--ai-gradient);
}

.ai-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.ai-widget-title {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-widget-icon {
    font-size: 1.3rem;
}

.ai-widget-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.ai-widget-badge.success {
    background: #d1fae5;
    color: #059669;
}

.ai-widget-badge.warning {
    background: #fef3c7;
    color: #d97706;
}

.ai-widget-badge.danger {
    background: #fee2e2;
    color: #dc2626;
}

.ai-widget-badge.info {
    background: #dbeafe;
    color: #2563eb;
}

/* ============================================================
   BURNOUT RISK WIDGET
   ============================================================ */

.burnout-widget {
    background: linear-gradient(135deg, #fff 0%, #fef3f3 100%);
}

.burnout-meter {
    height: 12px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    margin: 15px 0;
}

.burnout-meter-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s ease, background 0.3s;
}

.burnout-meter-fill.low {
    background: var(--ai-success);
}

.burnout-meter-fill.medium {
    background: var(--ai-warning);
}

.burnout-meter-fill.high {
    background: #f97316;
}

.burnout-meter-fill.critical {
    background: var(--ai-danger);
}

.burnout-indicators {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.burnout-indicator {
    padding: 4px 10px;
    background: #f3f4f6;
    border-radius: 12px;
    font-size: 0.75rem;
    color: #6b7280;
}

.burnout-indicator.active {
    background: #fef3c7;
    color: #92400e;
}

/* ============================================================
   GAMIFICATION WIDGET
   ============================================================ */

.gamification-widget {
    background: linear-gradient(135deg, #667eea10 0%, #764ba210 100%);
}

.gamification-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    text-align: center;
}

.gamification-stat {
    padding: 12px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.gamification-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--ai-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gamification-stat-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 4px;
}

.streak-fire {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 15px;
    padding: 10px;
    background: linear-gradient(135deg, #ff9a56 0%, #ff5858 100%);
    border-radius: 12px;
    color: white;
    font-weight: 600;
}

.level-progress {
    margin-top: 15px;
}

.level-progress-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.level-progress-fill {
    height: 100%;
    background: var(--ai-gradient);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.level-progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 5px;
}

/* ============================================================
   FOCUS BLOCKS WIDGET
   ============================================================ */

.focus-widget {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}

.focus-block-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.focus-block-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: white;
    border-radius: 10px;
    border-left: 4px solid var(--ai-success);
}

.focus-block-time {
    font-weight: 600;
    color: #374151;
    min-width: 120px;
}

.focus-block-quality {
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
}

.focus-block-quality.high {
    background: #d1fae5;
    color: #059669;
}

.focus-block-quality.medium {
    background: #fef3c7;
    color: #d97706;
}

.focus-block-quality.low {
    background: #fee2e2;
    color: #dc2626;
}

.focus-start-btn {
    width: 100%;
    margin-top: 15px;
    padding: 12px;
    background: var(--ai-gradient);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.focus-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

/* ============================================================
   AI INSIGHTS WIDGET
   ============================================================ */

.insights-widget {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.insight-card {
    padding: 15px;
    background: white;
    border-radius: 12px;
    margin-top: 10px;
    border-left: 4px solid var(--ai-info);
}

.insight-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.insight-card-icon {
    font-size: 1.2rem;
}

.insight-card-title {
    font-weight: 600;
    color: #374151;
}

.insight-card-text {
    font-size: 0.9rem;
    color: #6b7280;
    line-height: 1.5;
}

.insight-action-btn {
    margin-top: 10px;
    padding: 8px 16px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
}

.insight-action-btn:hover {
    background: #2563eb;
}

/* ============================================================
   PRODUCTIVITY CHART WIDGET
   ============================================================ */

.productivity-widget {
    grid-column: span 2;
}

.productivity-chart-container {
    height: 200px;
    margin-top: 15px;
}

.productivity-summary {
    display: flex;
    gap: 20px;
    margin-top: 15px;
}

.productivity-summary-item {
    flex: 1;
    padding: 12px;
    background: #f9fafb;
    border-radius: 10px;
    text-align: center;
}

.productivity-summary-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #374151;
}

.productivity-summary-label {
    font-size: 0.75rem;
    color: #6b7280;
}

.productivity-trend {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    margin-top: 5px;
}

.productivity-trend.up {
    color: var(--ai-success);
}

.productivity-trend.down {
    color: var(--ai-danger);
}

/* ============================================================
   DAILY BRIEFING WIDGET
   ============================================================ */

.briefing-widget {
    background: var(--ai-gradient);
    color: white;
}

.briefing-widget::before {
    display: none;
}

.briefing-greeting {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.briefing-date {
    opacity: 0.9;
    font-size: 0.9rem;
}

.briefing-stats {
    display: flex;
    gap: 15px;
    margin: 20px 0;
}

.briefing-stat {
    flex: 1;
    padding: 12px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    text-align: center;
}

.briefing-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.briefing-stat-label {
    font-size: 0.75rem;
    opacity: 0.9;
}

.briefing-quote {
    font-style: italic;
    opacity: 0.95;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    text-align: center;
}

/* ============================================================
   AI PANEL / SIDEBAR
   ============================================================ */

.ai-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -10px 0 50px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.ai-panel.open {
    right: 0;
}

.ai-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

.ai-panel-overlay.show {
    opacity: 1;
    visibility: visible;
}

.ai-panel-header {
    padding: 20px;
    background: var(--ai-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-panel-title {
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-panel-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.2s;
}

.ai-panel-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ai-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.ai-panel-section {
    margin-bottom: 25px;
}

.ai-panel-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

/* ============================================================
   GOAL TRACKER WIDGET
   ============================================================ */

.goals-widget {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.goal-item {
    padding: 15px;
    background: white;
    border-radius: 12px;
    margin-top: 10px;
}

.goal-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.goal-item-title {
    font-weight: 600;
    color: #374151;
}

.goal-item-progress {
    font-size: 0.85rem;
    color: var(--ai-primary);
    font-weight: 600;
}

.goal-progress-bar {
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    margin-top: 10px;
    overflow: hidden;
}

.goal-progress-fill {
    height: 100%;
    background: var(--ai-gradient);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.goal-deadline {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 8px;
}

/* ============================================================
   AI MODAL
   ============================================================ */

.ai-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

.ai-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.ai-modal {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.3s;
}

.ai-modal-overlay.show .ai-modal {
    transform: translateY(0);
}

.ai-modal-header {
    padding: 20px 25px;
    background: var(--ai-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-modal-title {
    font-size: 1.2rem;
    font-weight: 600;
}

.ai-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
}

.ai-modal-body {
    padding: 25px;
    max-height: 50vh;
    overflow-y: auto;
}

.ai-modal-footer {
    padding: 15px 25px;
    background: #f9fafb;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.ai-btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.ai-btn-primary {
    background: var(--ai-gradient);
    color: white;
}

.ai-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

.ai-btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.ai-btn-secondary:hover {
    background: #d1d5db;
}

/* ============================================================
   SCENARIO SIMULATOR
   ============================================================ */

.scenario-simulator {
    padding: 20px;
}

.scenario-option {
    padding: 15px;
    background: #f9fafb;
    border-radius: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.scenario-option:hover {
    background: #f3f4f6;
}

.scenario-option.selected {
    border-color: var(--ai-primary);
    background: #eff6ff;
}

.scenario-option-title {
    font-weight: 600;
    color: #374151;
    margin-bottom: 5px;
}

.scenario-option-desc {
    font-size: 0.85rem;
    color: #6b7280;
}

.scenario-result {
    margin-top: 20px;
    padding: 20px;
    background: #f0fdf4;
    border-radius: 12px;
    border-left: 4px solid var(--ai-success);
}

.scenario-result.warning {
    background: #fffbeb;
    border-color: var(--ai-warning);
}

.scenario-result.danger {
    background: #fef2f2;
    border-color: var(--ai-danger);
}

/* ============================================================
   TEAM INTELLIGENCE
   ============================================================ */

.team-member-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 12px;
}

.team-member-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--ai-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
}

.team-member-info {
    flex: 1;
}

.team-member-name {
    font-weight: 600;
    color: #374151;
}

.team-member-role {
    font-size: 0.85rem;
    color: #6b7280;
}

.team-member-workload {
    width: 60px;
}

.workload-ring {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: conic-gradient(var(--ai-success) var(--progress), #e5e7eb 0);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.workload-ring::before {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
}

.workload-ring span {
    position: relative;
    z-index: 1;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ============================================================
   NOTIFICATIONS & TOASTS
   ============================================================ */

.ai-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 15px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 3000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
}

.ai-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.ai-toast-icon {
    font-size: 1.5rem;
}

.ai-toast-content {
    flex: 1;
}

.ai-toast-title {
    font-weight: 600;
    color: #374151;
}

.ai-toast-message {
    font-size: 0.85rem;
    color: #6b7280;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.ai-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.streak-fire {
    animation: pulse 2s infinite;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1200px) {
    .ai-widgets-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .ai-widgets-grid {
        grid-template-columns: 1fr;
    }

    .productivity-widget {
        grid-column: span 1;
    }

    .ai-panel {
        width: 100%;
        right: -100%;
    }

    .ai-modal {
        width: 95%;
        margin: 10px;
    }

    .gamification-stats {
        grid-template-columns: repeat(3, 1fr);
    }

    .briefing-stats {
        flex-direction: column;
        gap: 10px;
    }
}