/* =============================================
   NSRP - Activity Log Styles
   ============================================= */

/* Activity Log Button */
.activity-log-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    position: relative;
    margin-right: 0.5rem;
}

.activity-log-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    color: #a78bfa;
}

.activity-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    border-radius: 9px;
    font-size: 0.65rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.activity-badge.hidden {
    display: none;
}

/* Activity Log Panel */
.activity-log-panel {
    position: fixed;
    top: 70px;
    right: 20px;
    width: 420px;
    max-height: calc(100vh - 100px);
    background: rgba(30, 41, 59, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(71, 85, 105, 0.4);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    pointer-events: none;
}

.activity-log-panel.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

/* Panel Header */
.activity-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(71, 85, 105, 0.3);
    border-radius: 16px 16px 0 0;
}

.activity-panel-header h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.activity-panel-header h4 i {
    color: #a78bfa;
}

.activity-panel-actions {
    display: flex;
    gap: 0.35rem;
}

.activity-panel-actions button {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.activity-panel-actions button:hover {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

/* Filters */
.activity-filters {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid rgba(71, 85, 105, 0.2);
}

.activity-filters select {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(71, 85, 105, 0.3);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.8rem;
    cursor: pointer;
}

.activity-filters select:focus {
    outline: none;
    border-color: #8b5cf6;
}

/* Search */
.activity-search {
    position: relative;
    padding: 0.5rem 1.25rem;
    border-bottom: 1px solid rgba(71, 85, 105, 0.2);
}

.activity-search i {
    position: absolute;
    left: 1.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.activity-search input {
    width: 100%;
    padding: 0.6rem 0.75rem 0.6rem 2rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(71, 85, 105, 0.3);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.activity-search input:focus {
    outline: none;
    border-color: #8b5cf6;
}

/* Activity List */
.activity-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
    max-height: 400px;
}

.activity-list::-webkit-scrollbar {
    width: 6px;
}

.activity-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.activity-list::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.3);
    border-radius: 3px;
}

/* Date Headers */
.activity-date-header {
    padding: 0.5rem 1.25rem;
    margin-top: 0.5rem;
}

.activity-date-header span {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Activity Item */
.activity-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.activity-item:hover {
    background: rgba(139, 92, 246, 0.05);
}

.activity-item.critical {
    border-left-color: #ef4444;
}

.activity-item.high {
    border-left-color: #f97316;
}

.activity-item.medium {
    border-left-color: #eab308;
}

.activity-item.low {
    border-left-color: transparent;
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

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

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.25rem;
}

.activity-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.activity-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.activity-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0 0 0.35rem 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.activity-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.activity-type-label {
    background: rgba(139, 92, 246, 0.1);
    color: #a78bfa;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.activity-user {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Empty State */
.activity-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.activity-empty i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.activity-empty p {
    margin: 0;
    font-size: 0.9rem;
}

/* Panel Footer */
.activity-panel-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(71, 85, 105, 0.3);
    border-radius: 0 0 16px 16px;
}

#activity-count {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.activity-panel-footer button {
    padding: 0.4rem 0.75rem;
    background: transparent;
    border: 1px solid rgba(71, 85, 105, 0.3);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s ease;
}

.activity-panel-footer button:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: #8b5cf6;
    color: #a78bfa;
}

/* Activity Detail Modal */
.activity-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.activity-detail-modal.show {
    opacity: 1;
}

.activity-detail-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.2s ease;
}

.activity-detail-modal.show .activity-detail-content {
    transform: scale(1);
}

.activity-detail-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.activity-detail-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.activity-detail-header h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.activity-detail-type {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.activity-detail-header .modal-close {
    margin-left: auto;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.activity-detail-header .modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.activity-detail-body {
    padding: 1.25rem;
    overflow-y: auto;
}

.detail-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 1.25rem 0;
}

.detail-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.detail-meta-item {
    background: var(--bg-tertiary);
    padding: 0.75rem;
    border-radius: 8px;
}

.detail-meta-item label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.detail-meta-item span {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
}

.detail-meta-item .severity-critical { color: #ef4444; }
.detail-meta-item .severity-high { color: #f97316; }
.detail-meta-item .severity-medium { color: #eab308; }
.detail-meta-item .severity-low { color: #22c55e; }

.detail-meta-item .activity-id {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.detail-data {
    margin-top: 1rem;
}

.detail-data label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.detail-data pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    overflow-x: auto;
    margin: 0;
}

.activity-detail-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

.activity-detail-footer button {
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.activity-detail-footer .btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.activity-detail-footer .btn-secondary:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: #8b5cf6;
    color: #a78bfa;
}

.activity-detail-footer .btn-primary {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    border: none;
    color: white;
}

.activity-detail-footer .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .activity-log-panel {
        width: 100%;
        right: 0;
        top: auto;
        bottom: 0;
        max-height: 70vh;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
    }

    .activity-log-panel.active {
        transform: translateY(0);
    }

    .activity-detail-content {
        width: 95%;
        max-height: 90vh;
    }
}

/* Animation for new items */
@keyframes slideInActivity {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.activity-item:first-child {
    animation: slideInActivity 0.3s ease;
}
