/* ============================================
   PAGE STYLES - Pterodactyl Backup System
   ============================================ */

/* ============================================
   DASHBOARD PAGE
   ============================================ */

.page-dashboard {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-5);
}

.stat-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-5);
}

.stat-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.stat-icon svg {
  width: 24px;
  height: 24px;
}

.stat-icon-primary {
  background: var(--accent-primary-subtle);
  color: var(--accent-primary);
}

.stat-icon-success {
  background: var(--accent-success-subtle);
  color: var(--accent-success);
}

.stat-icon-warning {
  background: var(--accent-warning-subtle);
  color: var(--accent-warning);
}

.stat-icon-info {
  background: var(--accent-info-subtle);
  color: var(--accent-info);
}

.stat-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-5);
}

.dashboard-card {
  padding: 0;
  overflow: hidden;
}

.dashboard-card:nth-child(1) {
  grid-column: span 8;
}

.dashboard-card:nth-child(2) {
  grid-column: span 4;
}

.dashboard-card:nth-child(3) {
  grid-column: span 12;
}

@media (max-width: 1200px) {

  .dashboard-card:nth-child(1),
  .dashboard-card:nth-child(2) {
    grid-column: span 6;
  }
}

@media (max-width: 768px) {

  .dashboard-card:nth-child(1),
  .dashboard-card:nth-child(2),
  .dashboard-card:nth-child(3) {
    grid-column: span 12;
  }
}

/* Backup List */
.backup-list {
  display: flex;
  flex-direction: column;
}

.backup-item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-fast);
}

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

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

.backup-item-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-overlay);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  flex-shrink: 0;
}

.backup-item-icon svg {
  width: 18px;
  height: 18px;
}

.backup-item-info {
  flex: 1;
  min-width: 0;
}

.backup-item-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.backup-item-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.backup-item-size {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Tier Stats */
.tier-stats {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-2);
}

.tier-stat-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.tier-stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tier-stat-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tier-stat-bar {
  height: 6px;
  background: var(--bg-overlay);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.tier-stat-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-success));
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.tier-stat-size {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
}

/* Quick Actions */
.quick-actions-card {
  padding: 0;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-4);
  padding: var(--space-2);
}

.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5);
  background: var(--bg-overlay);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.quick-action:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.quick-action-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-primary-subtle);
  border-radius: var(--radius-md);
  color: var(--accent-primary);
}

.quick-action-icon svg {
  width: 24px;
  height: 24px;
}

.quick-action span {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.quick-action:hover span {
  color: var(--text-primary);
}

/* ============================================
   NODES PAGE
   ============================================ */

.page-nodes {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.nodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-4);
}

.node-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-5);
}

.node-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.node-card-title {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.node-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.node-id {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.node-card-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.node-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.node-stat:last-child {
  border-bottom: none;
}

.node-stat-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.node-stat-value {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

.node-card-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

/* Install Command Box */
.install-command-box {
  background: var(--bg-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  overflow-x: auto;
}

.install-command-box::-webkit-scrollbar {
  height: 6px;
}

.install-command-box::-webkit-scrollbar-track {
  background: var(--bg-subtle);
  border-radius: 3px;
}

.install-command-box::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 3px;
}

.install-command-box::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.install-command-box code {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent-success);
  white-space: pre;
  line-height: 1.5;
}

/* Backup Status Section */
.backup-status-section {
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-subtle);
}

.backup-tier-status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) 0;
  font-size: 0.75rem;
}

.tier-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tier-indicator.success {
  background: var(--accent-success);
  box-shadow: 0 0 6px var(--accent-success);
}

.tier-indicator.error {
  background: var(--accent-danger);
  box-shadow: 0 0 6px var(--accent-danger);
}

.tier-indicator.pending {
  background: var(--accent-warning);
}

.tier-name {
  color: var(--text-secondary);
  text-transform: capitalize;
  flex: 1;
}

.tier-time {
  color: var(--text-muted);
  font-size: 0.6875rem;
}

.backup-tier-status.error .tier-name,
.backup-tier-status.error .tier-time {
  color: var(--accent-danger);
}

/* ============================================
   BROWSE / BACKUPS PAGE
   ============================================ */

.page-browse {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  height: calc(100vh - 64px - var(--space-12));
}

.explorer-container {
  display: flex;
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.explorer-sidebar {
  width: 280px;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
}

.explorer-sidebar-header {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

.explorer-sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-3);
}

.explorer-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.explorer-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-overlay);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
  overflow-x: auto;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-2);
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-xs);
  white-space: nowrap;
}

.breadcrumb-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.breadcrumb-item.active {
  color: var(--text-primary);
  font-weight: 500;
}

.breadcrumb-separator {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.explorer-view-toggle {
  display: flex;
  background: var(--bg-overlay);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.view-toggle-btn {
  padding: var(--space-2);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: all var(--transition-fast);
}

.view-toggle-btn:hover {
  color: var(--text-primary);
}

.view-toggle-btn.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.view-toggle-btn svg {
  width: 16px;
  height: 16px;
}

.explorer-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.file-item.selected {
  background: var(--accent-primary-subtle);
}

.file-item-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.file-item-icon.folder {
  background: var(--accent-warning-subtle);
  color: var(--accent-warning);
}

.file-item-icon.file {
  background: var(--bg-overlay);
  color: var(--text-muted);
}

.file-item-icon.archive {
  background: var(--accent-primary-subtle);
  color: var(--accent-primary);
}

.file-item-icon svg {
  width: 18px;
  height: 18px;
}

.file-item-info {
  flex: 1;
  min-width: 0;
}

.file-item-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-item-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.file-item-size {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.file-item-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* File Grid View */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-4);
}

.file-grid .file-item {
  flex-direction: column;
  padding: var(--space-4);
  text-align: center;
}

.file-grid .file-item-icon {
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-2);
}

.file-grid .file-item-icon svg {
  width: 24px;
  height: 24px;
}

.file-grid .file-item-info {
  width: 100%;
}

.file-grid .file-item-name {
  text-align: center;
}

.file-grid .file-item-meta {
  display: none;
}

/* ============================================
   SERVER FILES PAGE
   ============================================ */

.page-server-files {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  height: calc(100vh - 64px - var(--space-12));
}

.server-files-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.server-selector {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.server-selector label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.server-selector select {
  min-width: 200px;
}

.node-status-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--bg-overlay);
  border-radius: var(--radius-full);
}

.node-offline-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 11, 14, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  z-index: 10;
}

.node-offline-overlay svg {
  width: 48px;
  height: 48px;
  color: var(--accent-danger);
  opacity: 0.5;
}

.node-offline-overlay p {
  font-size: 1rem;
  color: var(--text-secondary);
}

/* ============================================
   AUDIT LOG PAGE
   ============================================ */

.page-audit {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.audit-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.audit-filters .filter-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.audit-filters .filter-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.audit-table-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.audit-entry {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-fast);
}

.audit-entry:last-child {
  border-bottom: none;
}

.audit-entry:hover {
  background: var(--bg-hover);
}

.audit-entry-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.audit-entry-icon.success {
  background: var(--accent-success-subtle);
  color: var(--accent-success);
}

.audit-entry-icon.error {
  background: var(--accent-danger-subtle);
  color: var(--accent-danger);
}

.audit-entry-icon svg {
  width: 18px;
  height: 18px;
}

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

.audit-entry-action {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

.audit-entry-details {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.audit-entry-user {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.audit-entry-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ============================================
   PROFILE PAGE
   ============================================ */

.page-profile {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  max-width: 1200px;
}

.profile-header-card {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding: var(--space-6);
}

.profile-avatar {
  position: relative;
}

.profile-avatar img,
.profile-avatar-placeholder {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border-default);
}

.profile-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-overlay);
  color: var(--text-muted);
}

.profile-avatar-placeholder svg {
  width: 48px;
  height: 48px;
}

.profile-info {
  flex: 1;
}

.profile-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.profile-id {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

.profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.profile-login-method {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  background: var(--bg-overlay);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.profile-login-method svg {
  width: 14px;
  height: 14px;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
}

.profile-stat-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5);
}

.profile-stat-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-primary-subtle);
  border-radius: var(--radius-md);
  color: var(--accent-primary);
}

.profile-stat-icon svg {
  width: 24px;
  height: 24px;
}

.profile-stat-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.profile-stat-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.profile-activity {
  display: flex;
  flex-direction: column;
}

.activity-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.activity-title {
  font-size: 1.125rem;
  font-weight: 600;
}

.activity-list {
  display: flex;
  flex-direction: column;
}

.activity-item {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border-subtle);
}

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

.activity-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-overlay);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  flex-shrink: 0;
}

.activity-icon svg {
  width: 16px;
  height: 16px;
}

.activity-content {
  flex: 1;
}

.activity-action {
  font-size: 0.875rem;
  color: var(--text-primary);
}

.activity-target {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-primary);
  background: var(--accent-primary-subtle);
  padding: 0 var(--space-1);
  border-radius: var(--radius-xs);
}

.activity-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--space-1);
}

/* ============================================
   ERROR PAGE
   ============================================ */

.page-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  padding: var(--space-6);
  background: var(--bg-base);
}

.error-code {
  font-size: 8rem;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-danger));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: var(--space-4);
}

.error-message {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.error-description {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: var(--space-6);
  max-width: 400px;
}