/* User Profile Component Styles */

.user-profile-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.profile-header {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 20px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: bold;
}

.profile-info h2 {
    margin: 0 0 5px 0;
    color: var(--text-primary);
}

.profile-username {
    margin: 0 0 5px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.profile-email {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.profile-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.profile-content {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.roles-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.role-card {
    padding: 15px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.role-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.role-id {
    font-size: 12px;
    color: var(--text-secondary);
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* Profile Stats Widgets */
.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-lg);
    background: var(--surface);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.stat-widget {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--background);
    border-radius: 8px;
    transition: all var(--transition);
}

.stat-widget:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    flex-shrink: 0;
}

.stat-icon-tasks {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-icon-incidents {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-icon-learning {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: var(--spacing-xs);
}

.stat-sublabel {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Profile Dashboard */
.profile-dashboard {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.dashboard-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: var(--spacing-lg);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border);
}

.section-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-primary);
}

.section-header h3 i {
    color: var(--accent);
}

.btn-sm {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.875rem;
}

/* Tasks List */
.tasks-list, .incidents-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.task-item, .incident-item {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: all var(--transition);
}

.task-item:hover, .incident-item:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 4px var(--shadow);
}

.task-item input[type="checkbox"] {
    margin-top: 4px;
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.task-content, .incident-content {
    flex: 1;
}

.task-title, .incident-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.task-meta, .incident-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.task-due, .incident-due {
    color: var(--text-secondary);
}

.task-priority, .incident-priority {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.priority-low {
    background: var(--success-bg);
    color: var(--success);
}

.priority-medium {
    background: var(--info-bg);
    color: var(--info);
}

.priority-high {
    background: var(--warning-bg);
    color: var(--warning);
}

.priority-critical {
    background: var(--error-bg);
    color: var(--error);
}

.task-status, .incident-status-label {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-todo, .status-new {
    background: var(--info-bg);
    color: var(--info);
}

.status-in_progress {
    background: var(--warning-bg);
    color: var(--warning);
}

.status-blocked {
    background: var(--error-bg);
    color: var(--error);
}

.status-done, .status-resolved, .status-closed {
    background: var(--success-bg);
    color: var(--success);
}

.incident-item {
    position: relative;
}

.incident-status {
    width: 4px;
    height: 100%;
    border-radius: 2px;
    flex-shrink: 0;
    margin-top: 2px;
}

.incident-status.status-new {
    background: var(--info);
}

.incident-status.status-assigned {
    background: var(--warning);
}

.incident-status.status-in_progress {
    background: var(--warning);
}

.incident-status.status-resolved {
    background: var(--success);
}

.incident-status.status-closed {
    background: var(--text-secondary);
}

/* Learning Progress */
.learning-progress {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.progress-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.progress-label {
    min-width: 150px;
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--background);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-hover) 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-value {
    min-width: 50px;
    text-align: right;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent);
}

.progress-note {
    padding: var(--spacing-sm);
    background: var(--info-bg);
    border: 1px solid var(--info-border);
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--info-text);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.progress-note i {
    color: var(--info);
}

/* Full Lists */
.tasks-full-list, .incidents-full-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border);
}

.list-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .profile-stats {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }

    .list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }

    .progress-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .progress-label {
        min-width: auto;
    }

    .progress-value {
        min-width: auto;
        text-align: left;
    }
}

