/*
 * Epic 19: Phase Ownership & Permissions CSS
 * Styles for ownership indicators, modals, notifications, and history
 */

/* ================================
   Phase Owner Indicator (Story 19.02)
   ================================ */
.phase-owner-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.owner-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.owner-badge-me {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border: 1px solid #81c784;
    color: #2e7d32;
}

.owner-badge-other {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border: 1px solid #64b5f6;
    color: #1565c0;
}

.owner-badge-none {
    background: #f5f5f5;
    border: 1px dashed #bdbdbd;
    color: #757575;
}

.owner-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #1976d2;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
}

.owner-badge-me .owner-avatar {
    background: #388e3c;
}

.owner-name {
    font-weight: 500;
}

.owner-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: #9e9e9e;
}

.permission-icon {
    margin-left: 0.25rem;
}

/* ================================
   Notification Bell (Story 19.08)
   ================================ */
.notification-container {
    position: relative;
}

.notification-bell {
    position: relative;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.notification-bell:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.notification-bell-icon {
    font-size: 1.25rem;
    color: white;
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    font-size: 0.65rem;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    color: white;
    background: #dc3545;
    border-radius: 9px;
    border: 2px solid #1e3a5f;
}

.notification-badge-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    max-height: 400px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow: hidden;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.notification-header h6 {
    margin: 0;
    font-weight: 600;
    color: #333;
}

.notification-list {
    max-height: 300px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.notification-item:hover {
    background-color: #f8f9fa;
}

.notification-item.unread {
    background-color: #e3f2fd;
    border-left: 3px solid #1976d2;
}

.notification-item.unread:hover {
    background-color: #bbdefb;
}

.notification-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e0e0e0;
    color: #616161;
}

.notification-item.unread .notification-icon {
    background: #1976d2;
    color: white;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 500;
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 0.125rem;
}

.notification-message {
    font-size: 0.8rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-time {
    font-size: 0.75rem;
    color: #9e9e9e;
    margin-top: 0.25rem;
}

.notification-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: #9e9e9e;
}

.notification-footer {
    padding: 0.5rem 1rem;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
    text-align: center;
}

/* ================================
   Ownership History (Story 19.09)
   ================================ */
.ownership-history {
    background: #fff;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #e0e0e0;
}

.ownership-timeline {
    position: relative;
    padding-left: 1.5rem;
}

.ownership-timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e0e0e0;
}

.ownership-timeline-item {
    position: relative;
    padding: 0.75rem 0;
    padding-left: 1rem;
}

.ownership-timeline-item::before {
    content: '';
    position: absolute;
    left: -1rem;
    top: 1rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #9e9e9e;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #e0e0e0;
}

.ownership-timeline-item.current::before {
    background: #1976d2;
    box-shadow: 0 0 0 2px #1976d2;
}

.ownership-timeline-content {
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.ownership-timeline-item.current .ownership-timeline-content {
    background: #e3f2fd;
    border-color: #90caf9;
}

.ownership-timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.ownership-timeline-user {
    font-weight: 500;
    color: #333;
}

.ownership-timeline-date {
    font-size: 0.8rem;
    color: #757575;
}

.ownership-timeline-meta {
    font-size: 0.8rem;
    color: #666;
}

/* ================================
   Assign Phase Owner Modal (Story 19.03)
   ================================ */
.ownership-modal .modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.ownership-user-select {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 250px;
    overflow-y: auto;
}

.ownership-user-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ownership-user-option:hover {
    background-color: #f5f5f5;
    border-color: #bdbdbd;
}

.ownership-user-option.selected {
    background-color: #e3f2fd;
    border-color: #1976d2;
}

.ownership-user-option .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #1976d2;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.ownership-user-option .user-info {
    flex: 1;
}

.ownership-user-option .user-name {
    font-weight: 500;
    color: #333;
}

.ownership-user-option .user-role {
    font-size: 0.8rem;
    color: #757575;
}

/* ================================
   Read-Only Field Wrapper (Story 19.04)
   ================================ */
.field-readonly-wrapper {
    position: relative;
}

.field-readonly-wrapper.is-readonly {
    opacity: 0.8;
}

.field-readonly-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.02);
    cursor: not-allowed;
    z-index: 1;
}

.field-readonly-wrapper.is-readonly input,
.field-readonly-wrapper.is-readonly select,
.field-readonly-wrapper.is-readonly textarea {
    pointer-events: none;
    background-color: #f5f5f5;
}

/* Field Lock Indicator */
.field-lock-indicator {
    display: inline-flex;
    align-items: center;
}

.field-editable {
    font-size: 0.75rem;
}

.field-locked {
    font-size: 0.75rem;
}

/* ================================
   Bulk Phase Assignment (Story 19.07)
   ================================ */
.bulk-assignment-matrix {
    overflow-x: auto;
}

.bulk-assignment-table {
    min-width: 100%;
}

.bulk-assignment-table th {
    position: sticky;
    top: 0;
    background: #f8f9fa;
    white-space: nowrap;
    padding: 0.5rem 0.75rem;
}

.bulk-assignment-cell {
    padding: 0.25rem !important;
    vertical-align: middle;
}

.bulk-assignment-select {
    width: 100%;
    min-width: 120px;
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: white;
}

.bulk-assignment-select:focus {
    border-color: #1976d2;
    outline: none;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

/* ================================
   Ownership History Section in PhaseCard
   ================================ */
.ownership-history-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #e0e0e0;
}
