/* ================================================
   NSecurity - Component Styles
   Professional Command Center UI
   ================================================ */

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dark));
  color: #000;
  border-color: var(--accent-gold);
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 4px 15px rgba(252, 209, 22, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-color: var(--border-default);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
}

.btn-danger {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
  background: #c53030;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.btn-ghost.active {
  background: var(--bg-elevated);
  color: var(--accent-gold);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
}

.btn-icon.btn-sm {
  width: 28px;
  height: 28px;
}

/* ========== Cards ========== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-default);
  background: rgba(0, 0, 0, 0.1);
}

.card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.card-body {
  padding: 1.25rem;
}

.card-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-default);
  background: rgba(0, 0, 0, 0.05);
}

/* ========== Stat Cards ========== */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--stat-color, var(--accent-gold));
}

.stat-card-icon {
  width: 40px;
  height: 40px;
  background: var(--stat-bg, rgba(252, 209, 22, 0.1));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--stat-color, var(--accent-gold));
  margin-bottom: 1rem;
}

.stat-card-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-card-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.stat-card-change {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.6875rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  background: var(--bg-elevated);
  color: var(--text-muted);
}

.stat-card-change.positive {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.stat-card-change.negative {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

/* ========== Forms ========== */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  transition: all 0.15s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(252, 209, 22, 0.1);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.form-check-input {
  width: 16px;
  height: 16px;
  border: 1px solid var(--border-default);
  border-radius: 4px;
  background: var(--bg-input);
  cursor: pointer;
  accent-color: var(--accent-gold);
}

.form-check-label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  user-select: none;
}

.input-group {
  display: flex;
  gap: 0.5rem;
}

.input-group .form-input {
  flex: 1;
}

/* ========== Tables ========== */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  overflow: hidden;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 0.875rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-default);
}

.table th {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(0, 0, 0, 0.1);
}

.table td {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.table tbody tr:hover {
  background: var(--bg-elevated);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table code {
  background: var(--bg-elevated);
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--intel-cyan);
}

/* ========== Status Badges ========== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-active {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.status-inactive {
  background: rgba(107, 114, 128, 0.1);
  color: var(--text-muted);
}

.status-pending {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.status-critical {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

/* ========== Risk Indicators ========== */
.risk-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 600;
}

.risk-critical {
  background: rgba(220, 38, 38, 0.15);
  color: var(--risk-critical);
}

.risk-high {
  background: rgba(234, 88, 12, 0.15);
  color: var(--risk-high);
}

.risk-medium {
  background: rgba(234, 179, 8, 0.15);
  color: var(--risk-medium);
}

.risk-low {
  background: rgba(34, 197, 94, 0.15);
  color: var(--risk-low);
}

/* ========== Badges ========== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 500;
}

.badge-primary {
  background: rgba(252, 209, 22, 0.15);
  color: var(--accent-gold);
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.badge-info {
  background: rgba(6, 182, 212, 0.15);
  color: var(--intel-cyan);
}

/* ========== Avatar ========== */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--ghana-gold), var(--ghana-green));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  color: #000;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 0.75rem;
}

.avatar-lg {
  width: 56px;
  height: 56px;
  font-size: 1.25rem;
}

/* ========== Activity Feed ========== */
.activity-feed {
  display: flex;
  flex-direction: column;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-default);
  transition: background 0.15s ease;
}

.activity-item:hover {
  background: var(--bg-elevated);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.activity-text {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

.activity-text strong {
  color: var(--text-primary);
}

.activity-time {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  display: block;
}

/* ========== Tabs ========== */
.tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--bg-elevated);
  border-radius: 10px;
  margin-bottom: 1rem;
}

.tab {
  flex: 1;
  padding: 0.5rem 1rem;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab:hover {
  color: var(--text-primary);
}

.tab.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

/* ========== Modal ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

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

.modal {
  width: 90%;
  max-width: 500px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 16px;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-default);
}

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

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.25rem;
  transition: all 0.15s ease;
}

.modal-close:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-default);
  background: var(--bg-card);
}

/* ========== Alert Notification Panel ========== */
.alert-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  overflow: hidden;
}

.alert-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-default);
  background: rgba(239, 68, 68, 0.05);
}

.alert-panel-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--danger);
}

.alert-panel-title::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.alert-list {
  max-height: 400px;
  overflow-y: auto;
}

.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-default);
  transition: background 0.15s ease;
  cursor: pointer;
}

.alert-item:hover {
  background: var(--bg-elevated);
}

.alert-item:last-child {
  border-bottom: none;
}

.alert-item.unread {
  background: rgba(239, 68, 68, 0.02);
}

.alert-item.unread::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--danger);
}

.alert-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.alert-icon.critical {
  background: rgba(220, 38, 38, 0.15);
  color: var(--risk-critical);
}

.alert-icon.warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.alert-icon.info {
  background: rgba(6, 182, 212, 0.15);
  color: var(--intel-cyan);
}

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

.alert-title {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.alert-description {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.alert-time {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 0.375rem;
}

.alert-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* ========== Command Status ========== */
.command-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--success);
}

.command-status::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

/* ========== Empty State ========== */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  background: var(--bg-elevated);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.empty-state-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.empty-state-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* ========== Loading Spinner ========== */
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-default);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========== Progress Bar ========== */
.progress {
  width: 100%;
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-gold-light));
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* ========== Tooltip ========== */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 0.5rem 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--text-primary);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.15s ease;
  z-index: 700;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
}

/* ========== Skeleton Loading ========== */
.skeleton {
  background: linear-gradient(90deg, 
    var(--bg-elevated) 25%, 
    var(--bg-card-hover) 50%, 
    var(--bg-elevated) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}

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

.skeleton-text {
  height: 1rem;
  margin-bottom: 0.5rem;
}

.skeleton-title {
  height: 1.5rem;
  width: 60%;
  margin-bottom: 1rem;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}
