/* Professional Dashboard Styles */
:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary-color: #64748b;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --background: #f8fafc;
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --border: #e2e8f0;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* Hide dashboard content by default - will be shown after login */
.header,
.main {
  display: none;
}

/* Header */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 2rem;
  height: 2rem;
  background: var(--primary-color);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 1.125rem;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--success-color);
  color: white;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
}

.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  background: white;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

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

/* Main Layout */
.main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

/* Grid System */
.grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

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

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* Metric Cards */
.metric-card {
  text-align: center;
  position: relative;
  overflow: hidden;
}

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

.metric-label {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.metric-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.metric-unit {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}

.metric-dual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.metric-primary {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.metric-secondary {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.metric-trend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.trend-up {
  color: var(--success-color);
}

.trend-down {
  color: var(--danger-color);
}

.trend-neutral {
  color: var(--text-muted);
}

/* Status Colors */
.status-excellent { color: var(--success-color); }
.status-good { color: #22c55e; }
.status-warning { color: var(--warning-color); }
.status-danger { color: var(--danger-color); }

/* Charts */
.chart-container {
  position: relative;
  height: 200px;
  margin-top: 1rem;
}

.chart-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: var(--background);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Player List */
.player-list {
  max-height: 300px;
  overflow-y: auto;
}

.player-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius);
  transition: background-color 0.2s ease;
}

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

.player-head {
  width: 2rem;
  height: 2rem;
  position: relative;
  flex-shrink: 0;
}

.player-head-image {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  border: 2px solid var(--border);
}

.player-avatar-fallback {
  width: 2rem;
  height: 2rem;
  background: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
  border: 2px solid var(--border);
}

.player-info {
  flex: 1;
}

.player-name {
  font-weight: 500;
  color: var(--text-primary);
}

.player-ping {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.player-location {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.125rem;
}

.player-dimension {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.125rem;
}

.player-location-link {
  font-size: 0.75rem;
  color: var(--primary-color);
  margin-top: 0.125rem;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.player-location-link:hover {
  color: var(--primary-color-hover, #4a9eff);
  text-decoration: none;
}

/* Tabs */
.tabs {
  display: flex;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 0.25rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.tab {
  flex: 1;
  padding: 0.75rem 1rem;
  text-align: center;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

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

.tab.active {
  color: var(--primary-color);
  background: var(--surface-elevated);
  box-shadow: var(--shadow-sm);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Controls */
.controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

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

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

.refresh-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.refresh-spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--border);
  border-top: 2px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Error States */
.error-state {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
}

.error-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* Success States */
.success-state {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--success-color);
  border-radius: var(--radius-lg);
  margin: 1rem;
  box-shadow: var(--shadow-md);
}

.success-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.8;
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.skeleton {
  background: linear-gradient(90deg, var(--background) 25%, var(--border) 50%, var(--background) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: var(--radius);
}

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

/* Responsive Design */
@media (max-width: 768px) {
  .header {
    padding: 1rem;
  }
  
  .header-content {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
  
  .main {
    padding: 1rem;
  }
  
  .grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .metric-value {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .card {
    padding: 1rem;
  }
  
  .metric-value {
    font-size: 1.75rem;
  }
}

/* Settings Form */
.settings-form {
  max-width: 500px;
}

.form-group {
  margin-bottom: 1.5rem;
}

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

.form-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: border-color 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

.form-help {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 2rem;
}

.grid-1 {
  grid-template-columns: 1fr;
}

/* Console Styles */
.console-container {
  display: flex;
  flex-direction: column;
  height: 500px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.console-output {
  flex: 1;
  padding: 1rem;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  line-height: 1.4;
  background: #1a1a1a;
  color: #00ff00;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.console-output::-webkit-scrollbar {
  width: 8px;
}

.console-output::-webkit-scrollbar-track {
  background: #2a2a2a;
}

.console-output::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 4px;
}

.console-output::-webkit-scrollbar-thumb:hover {
  background: #777;
}

.console-input-container {
  display: flex;
  padding: 1rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
  gap: 0.5rem;
}

.console-input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-primary);
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
}

.console-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.console-controls {
  display: flex;
  gap: 0.5rem;
}

.console-line {
  margin-bottom: 0.25rem;
}

.console-line.error {
  color: #ff6b6b;
}

.console-line.warning {
  color: #ffd93d;
}

.console-line.info {
  color: #4dabf7;
}

.console-line.success {
  color: #51cf66;
}

.console-line.command {
  color: #ffd43b;
}

.console-line.output {
  color: #00ff00;
}

.console-line.server {
  color: #ffffff;
}

/* New Feature Styles */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  padding: 1rem;
}

.stat-item {
  text-align: center;
  padding: 1rem;
  background: var(--background);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.entity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
  padding: 1rem;
}

.entity-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-align: center;
  min-height: 100px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.entity-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.entity-tile.clickable {
  cursor: pointer;
}

.entity-tile.clickable:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

.entity-count-large {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.25rem;
}

.entity-type-small {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.2;
  word-break: break-word;
}

.entity-image {
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
}

.entity-icon {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.entity-fallback {
  font-size: 24px;
  line-height: 1;
}

.mod-info {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.mod-info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mod-info-label {
  font-weight: 500;
  color: var(--text-secondary);
}

.mod-info-value {
  font-weight: 600;
  color: var(--text-primary);
}

.mod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  padding: 1rem;
}

.mod-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-align: center;
  min-height: 80px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mod-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.mod-name-large {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  text-align: center;
  line-height: 1.2;
  word-break: break-word;
}

.mod-version-small {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.2;
}

.mod-sections {
  padding: 1rem;
}

.mod-section {
  margin-bottom: 1.5rem;
}

.mod-section-header {
  cursor: pointer;
  padding: 0.75rem;
  background: var(--background);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 0.5rem;
  transition: background-color 0.2s ease;
}

.mod-section-header:hover {
  background: var(--surface);
}

.mod-section-title {
  display: flex;
  align-items: center;
  font-weight: 600;
  color: var(--text-primary);
}

.mod-section-arrow {
  margin-right: 0.5rem;
  transition: transform 0.2s ease;
  color: var(--text-secondary);
}

.mod-section-arrow.expanded {
  transform: rotate(90deg);
}

.mod-section-count {
  margin-left: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.mod-section-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.mod-section-content.expanded {
  max-height: 2000px;
}

.mod-tile.user-mod {
  border: 2px solid var(--primary-color);
  background: var(--surface-elevated);
}

.mod-tile.user-mod:hover {
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
  .entity-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
  }
  
  .mod-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
  }
  
  .entity-tile,
  .mod-tile {
    min-height: 70px;
    padding: 0.75rem;
  }
  
  .entity-count-large {
    font-size: 1.25rem;
  }
  
  .entity-type-small,
  .mod-name-large {
    font-size: 0.7rem;
  }
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-dialog {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  z-index: 1001;
}

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

.modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius);
  transition: color 0.2s ease, background-color 0.2s ease;
}

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

.modal-content {
  padding: 1.5rem;
  max-height: 60vh;
  overflow-y: auto;
}

/* Entity Locations List */
.entity-locations-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.location-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem;
  background: var(--surface-elevated);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: border-color 0.2s ease;
}

.location-item:hover {
  border-color: var(--primary-color);
}

.location-coords {
  display: flex;
  gap: 1rem;
  align-items: center;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
}

.coord-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.coord-value {
  color: var(--primary-color);
  font-weight: 600;
  background: var(--surface);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.location-world {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Location Item Layout */
.location-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.location-info {
  flex: 1;
}

/* Teleport Button */
.teleport-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.teleport-btn:hover {
  background: var(--primary-color-dark, #1d4ed8);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.teleport-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.teleport-icon {
  font-size: 1rem;
}

/* Player Selection Modal */
.player-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.player-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: var(--surface-elevated);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: border-color 0.2s ease;
}

.player-item:hover {
  border-color: var(--primary-color);
}

.player-info {
  flex: 1;
}

.player-name {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.player-ping {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.select-player-btn {
  padding: 0.5rem 1rem;
  background: var(--success-color, #10b981);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.select-player-btn:hover {
  background: var(--success-color-dark, #059669);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.select-player-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Notifications */
.notification {
  position: fixed;
  top: 2rem;
  right: 2rem;
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  color: white;
  font-weight: 500;
  z-index: 2000;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}

.notification.show {
  transform: translateX(0);
}

.notification-info {
  background: var(--info-color, #3b82f6);
}

.notification-success {
  background: var(--success-color, #10b981);
}

.notification-error {
  background: var(--error-color, #ef4444);
}

.notification-warning {
  background: var(--warning-color, #f59e0b);
}

/* Login Form Styles */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--background) 0%, var(--surface) 100%);
  padding: 2rem;
}

.login-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  padding: 3rem;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.login-header h1 {
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
  font-size: 1.75rem;
  font-weight: 700;
}

.login-header p {
  margin: 0 0 2rem 0;
  color: var(--text-secondary);
  font-size: 1rem;
}


.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: left;
}

.form-group label {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.form-group input {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
  color: var(--text-primary);
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.login-btn:hover:not(:disabled) {
  background: var(--primary-color-dark, #1d4ed8);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.login-icon {
  font-size: 1.125rem;
}

.login-error {
  background: var(--error-color, #ef4444);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 1rem;
}

.login-error.success {
  background: var(--success-color, #10b981);
}

/* User Info in Header */
.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
}

.user-name {
  font-weight: 600;
  color: var(--text-primary);
}

.op-badge {
  background: var(--warning-color, #f59e0b);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.logout-btn {
  padding: 0.5rem 1rem;
  background: var(--error-color, #ef4444);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.logout-btn:hover {
  background: var(--error-color-dark, #dc2626);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Admin Portal Styles */
.admin-container {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.admin-content {
  padding: 1.5rem;
}

.admin-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  align-items: center;
}

.btn-icon {
  margin-right: 0.5rem;
}

.users-table-container {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

.users-table th {
  background: var(--background);
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
}

.users-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

.users-table tr:hover {
  background: var(--background);
}

.loading-row {
  text-align: center;
  color: var(--text-secondary);
  font-style: italic;
}

.admin-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: var(--warning-color);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.user-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: var(--secondary-color);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
}

.btn-small {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
}

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

.btn-secondary:hover {
  background: #475569;
}

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

.btn-danger:hover {
  background: #dc2626;
}

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

.btn-warning:hover {
  background: #d97706;
}

/* Create User Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-dialog {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
}

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

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
}

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

.modal-content {
  margin-bottom: 1.5rem;
}

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

/* BlueMap Integration Styles */
.map-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.map-content {
  position: relative;
  height: 600px;
  background: var(--background);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

.bluemap-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: var(--surface);
  display: none;
}

.bluemap-iframe.loaded {
  display: block;
}

.map-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  z-index: 10;
}

.loading-spinner {
  width: 3rem;
  height: 3rem;
  border: 3px solid var(--border);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

.loading-text {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 500;
}

.map-error {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  padding: 2rem;
  text-align: center;
  z-index: 10;
}

.error-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.6;
}

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

.error-message {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 400px;
  line-height: 1.5;
}

.error-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.map-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.map-config-panel {
  margin-top: 1.5rem;
}

.map-config-content {
  padding: 1.5rem;
}

/* Fullscreen Map Styles */
.map-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  background: var(--surface);
}

.map-fullscreen .map-content {
  height: 100vh;
  border-radius: 0;
  border: none;
}

.map-fullscreen .card {
  height: 100vh;
  border-radius: 0;
  border: none;
  box-shadow: none;
}

.map-fullscreen .card-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.map-fullscreen .bluemap-iframe {
  margin-top: 80px;
  height: calc(100vh - 80px);
}

/* Dark mode fullscreen adjustments */
@media (prefers-color-scheme: dark) {
  .map-fullscreen .card-header {
    background: rgba(30, 41, 59, 0.95);
  }
}

/* Responsive Map Styles */
@media (max-width: 768px) {
  .map-content {
    height: 400px;
  }
  
  .map-controls {
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
  }
  
  .map-controls .btn {
    width: 100%;
    justify-content: center;
  }
  
  .error-actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .error-actions .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .map-content {
    height: 300px;
  }
  
  .error-message {
    font-size: 0.875rem;
  }
  
  .error-title {
    font-size: 1.25rem;
  }
}

/* Map Configuration Form Styles */
.map-config-content .form-group {
  margin-bottom: 1.5rem;
}

.map-config-content .form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.map-config-content .form-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.map-config-content .form-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.map-config-content .form-help {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
  line-height: 1.4;
}

.map-config-content .form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.map-config-content .form-actions .btn {
  flex: 1;
  min-width: 120px;
}

/* Connection Status Indicators */
.map-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.map-status.connected {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success-color);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.map-status.disconnected {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger-color);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.map-status.loading {
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary-color);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --background: #0f172a;
    --surface: #1e293b;
    --surface-elevated: #334155;
    --border: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
  }
}
