/* System Health Page Styles */
.system-health {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
  box-sizing: border-box;
}

/* Header */
.health-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--color-border-light);
}

.health-title h1 {
  margin: 0 0 8px 0;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.health-title p {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 1.1rem;
}

.health-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.last-refresh {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

.refresh-btn {
  background: var(--color-primary);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.refresh-btn:hover:not(:disabled) {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
}

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

.refresh-btn.refreshing {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Health Overview Grid - Using AdminCard */
.health-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-light);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.status-item:hover {
  background: var(--color-bg-tertiary);
  transform: translateY(-1px);
}

.status-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
}

.status-content h3 {
  margin: 0 0 8px 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-value {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-primary);
}

/* Health Details - Now using AdminCard components */
.system-health .admin-card {
  margin-bottom: 24px;
  word-wrap: break-word;
}

.system-health .admin-card:last-child {
  margin-bottom: 0;
}

.health-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.health-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border-light);
}

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

.health-label {
  font-weight: 500;
  color: var(--color-text-primary);
  flex: 1;
}

.health-value {
  color: var(--color-text-secondary);
  font-weight: 500;
  text-align: right;
}

/* Health status colors using new status-* pattern */
.health-value.status-healthy {
  color: var(--color-success);
  font-weight: 600;
}

.health-value.status-warning {
  color: var(--color-warning);
  font-weight: 600;
}

.health-value.status-error {
  color: var(--color-danger);
  font-weight: 600;
}

.health-value.status-info {
  color: var(--color-info);
  font-weight: 600;
}

.health-detail {
  font-size: 0.85em;
  opacity: 0.8;
  font-weight: normal;
}

/* Storage usage colors */
.health-value.healthy {
  color: var(--color-success);
}

.health-value.warning {
  color: var(--color-warning);
}

.health-value.error {
  color: var(--color-danger);
}

/* Enhanced Storage Section - AdminCard Compatible */
.storage-overview {
  margin-bottom: 20px;
}

.disk-usage-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border-light);
}

.disk-usage-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  max-width: 300px;
}

.disk-usage-bar {
  flex: 1;
  height: 8px;
  background: var(--color-border-light);
  border-radius: 4px;
  overflow: hidden;
}

.disk-usage-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.disk-usage-fill.healthy {
  background-color: var(--color-success);
}

.disk-usage-fill.warning {
  background-color: var(--color-warning);
}

.disk-usage-fill.error {
  background-color: var(--color-danger);
}

.disk-usage-text {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

/* Directory Cards Grid */
.storage-directories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.directory-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-light);
  border-radius: 8px;
  padding: 12px;
  transition: all 0.2s ease;
}

.directory-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.directory-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.directory-icon {
  font-size: 1.2rem;
}

.directory-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-text-primary);
  flex: 1;
  margin-left: 6px;
}

.directory-status {
  font-size: 0.9rem;
  font-weight: bold;
}

.directory-status.healthy {
  color: var(--color-success);
}

.directory-status.error {
  color: var(--color-danger);
}

.directory-stats {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.stat {
  text-align: center;
  flex: 1;
}

.stat-value {
  display: block;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-text-primary);
  line-height: 1.2;
}

.stat-label {
  display: block;
  font-size: 0.7rem;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.directory-error {
  margin-top: 8px;
  padding: 6px 8px;
  background: var(--color-danger-light);
  border: 1px solid var(--color-danger);
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--color-danger-dark);
}

/* Security Warnings */
.security-warnings {
  margin-bottom: 20px;
}

.security-warning {
  background: var(--color-danger-light);
  border: 2px solid var(--color-danger);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 8px;
  color: var(--color-danger-dark);
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: pulse-warning 2s infinite;
}

@keyframes pulse-warning {
  0%,
  100% {
    background: var(--color-danger-light);
  }
  50% {
    background: var(--color-danger-light);
    opacity: 0.8;
  }
}

/* Quick Actions */
.health-actions-section {
  background: var(--color-bg-primary);
  padding: 24px;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border-light);
  margin-bottom: 20px;
}

.health-actions-section h2 {
  margin: 0 0 20px 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-light);
  border-radius: 8px;
  color: var(--color-text-primary);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background: var(--color-bg-tertiary);
  border-color: var(--color-border);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.action-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* Error State */
.system-health-error {
  text-align: center;
  padding: 60px 20px;
  background: var(--color-bg-primary);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border-light);
  margin: 20px;
}

.system-health-error h2 {
  margin: 0 0 10px 0;
  color: var(--color-danger);
  font-size: 1.5rem;
}

.system-health-error p {
  margin: 0 0 20px 0;
  color: var(--color-text-secondary);
  font-size: 1.1rem;
}

.retry-btn {
  background: var(--color-primary);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-size: 1rem;
}

.retry-btn:hover {
  background: var(--color-primary-dark);
}

/* Admin Page Loading - Centered within admin content area */
.admin-page-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 140px); /* Account for header and padding */
  width: 100%;
}

/* Responsive Design - Sidebar-aware breakpoints */
/* Large desktop screens - sidebar + content fits comfortably */

/* Medium desktop - account for sidebar width (1024px - 280px = 744px content) */

/* Small desktop/large tablet - sidebar significantly reduces available width */

/* Small tablets and large mobile screens */

/* Mobile phone screens */

/* Very small mobile screens */

/* Dark theme specific adjustments for SystemHealth */
[data-theme='dark'] .directory-card {
  background: var(--color-bg-tertiary);
  border-color: var(--color-border);
}

[data-theme='dark'] .directory-card:hover {
  background: var(--color-bg-secondary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme='dark'] .health-actions-section {
  background: var(--color-bg-secondary);
  border-color: var(--color-border);
}

[data-theme='dark'] .action-btn {
  background: var(--color-bg-tertiary);
  border-color: var(--color-border);
  color: var(--color-text-primary);
}

[data-theme='dark'] .action-btn:hover {
  background: var(--color-bg-primary);
  border-color: var(--color-border-light);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

[data-theme='dark'] .system-health-error {
  background: var(--color-bg-secondary);
  border-color: var(--color-border);
}

[data-theme='dark'] .health-item {
  border-bottom-color: var(--color-border);
}

[data-theme='dark'] .disk-usage-bar {
  background: var(--color-border);
}

[data-theme='dark'] .status-item {
  background: var(--color-bg-tertiary);
  border-color: var(--color-border);
}

[data-theme='dark'] .status-item:hover {
  background: var(--color-bg-secondary);
}

[data-theme='dark'] .health-header {
  border-bottom-color: var(--color-border);
}

[data-theme='dark'] .disk-usage-container {
  border-bottom-color: var(--color-border);
}
