/* Admin Panel Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #fff;
  padding: 20px;
  min-height: 100vh;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
}

/* Header */
header {
  background: rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

h1 {
  font-size: 2em;
}

.nav-links {
  display: flex;
  gap: 10px;
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1em;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-danger {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  padding: 8px 15px;
  font-size: 0.9em;
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(245, 87, 108, 0.4);
}

.btn-success {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  color: #1a1a2e;
  padding: 8px 15px;
  font-size: 0.9em;
  font-weight: 600;
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(67, 233, 123, 0.4);
}

/* Tab Navigation */
.tabs {
  display: flex;
  gap: 5px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.05);
  padding: 5px;
  border-radius: 10px;
}

.tab-button {
  flex: 1;
  padding: 15px 20px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  font-size: 1.1em;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.tab-button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
}

.tab-button.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.tab-content {
  display: none;
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Objects Tab */
.objects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.object-card {
  background: rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.object-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  border-color: #667eea;
}

.object-card h3 {
  margin-bottom: 15px;
  color: #667eea;
  text-align: center;
  font-size: 1.1em;
}

.object-preview {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

.object-sprite {
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.5);
}

.object-grid {
  flex: 1;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.5);
  display: inline-block;
}

.form-group {
  margin-bottom: 10px;
}

.form-group label {
  display: block;
  font-size: 0.9em;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 5px;
}

.form-input {
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.3);
  color: white;
  font-size: 1em;
}

.info-box {
  padding: 8px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 5px;
  font-size: 0.9em;
}

.info-box small {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8em;
}

.object-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.object-actions .btn {
  flex: 1;
}

/* Users Tab */
.users-table {
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 20px;
}

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

.users-table th,
.users-table td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.users-table th {
  background: rgba(102, 126, 234, 0.2);
  font-weight: bold;
  text-transform: uppercase;
  font-size: 0.9em;
}

.users-table tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

.role-select,
.money-input {
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.3);
  color: white;
  font-size: 1em;
  cursor: pointer;
}

.money-input {
  width: 120px;
}

/* Logs Tab */
.logs-filters {
  background: rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.filter-group label {
  font-size: 0.9em;
  color: rgba(255, 255, 255, 0.7);
}

.filter-group input,
.filter-group select {
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.3);
  color: white;
  font-size: 1em;
}

.logs-table {
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
}

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

.logs-table th,
.logs-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logs-table th {
  background: rgba(102, 126, 234, 0.2);
  font-weight: bold;
  text-transform: uppercase;
  font-size: 0.85em;
}

.logs-table tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
}

.pagination button {
  padding: 8px 15px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  cursor: pointer;
}

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

.pagination button:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.2);
}

.action-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.85em;
  font-weight: bold;
}

.action-badge.placed {
  background: #4caf50;
}
.action-badge.removed {
  background: #f44336;
}
.action-badge.expanded {
  background: #2196f3;
}
.action-badge.island-removed {
  background: #ff9800;
}

.money-change {
  font-weight: bold;
}

.money-change.negative {
  color: #f44336;
}
.money-change.positive {
  color: #4caf50;
}

/* Settings Section */
.settings-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 800px;
}

.setting-card {
  background: rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.setting-card h3 {
  margin-bottom: 15px;
  color: #667eea;
  font-size: 1.1em;
}

/* Ground Layer Styles */
.sprite-map-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}

.sprite-map-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sprite-map-row label {
  width: 150px;
  font-size: 0.9em;
  color: rgba(255, 255, 255, 0.8);
}

.sprite-coord {
  width: 60px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  color: #fff;
  font-size: 0.9em;
}

.ground-layer-type-card {
  background: rgba(255, 255, 255, 0.08);
  padding: 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ground-layer-type-card .type-info {
  flex: 1;
}

.ground-layer-type-card .type-info h4 {
  margin: 0 0 4px 0;
  color: #667eea;
}

.ground-layer-type-card .type-info p {
  margin: 0;
  font-size: 0.85em;
  opacity: 0.7;
}

.ground-layer-type-card .type-actions {
  display: flex;
  gap: 8px;
}

/* Sprite map rows with previews */
.sprite-map-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  transition: background 0.15s;
}

.sprite-map-row:hover {
  background: rgba(255, 255, 255, 0.08);
}

.sprite-map-row label {
  width: 140px;
  font-size: 0.9em;
  color: rgba(255, 255, 255, 0.8);
  flex-shrink: 0;
}

.sprite-preview-canvas {
  width: 48px;
  height: 48px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  cursor: pointer;
  image-rendering: pixelated;
  background: rgba(0, 0, 0, 0.3);
  transition: border-color 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}

.sprite-preview-canvas:hover {
  border-color: #667eea;
  box-shadow: 0 0 8px rgba(102, 126, 234, 0.5);
}

.sprite-coord-info {
  font-size: 0.8em;
  color: rgba(255, 255, 255, 0.45);
  min-width: 55px;
}

.sprite-pick-btn {
  padding: 4px 10px;
  font-size: 0.8em;
  background: rgba(102, 126, 234, 0.3);
  border: 1px solid rgba(102, 126, 234, 0.5);
  color: #a8b8ff;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}

.sprite-pick-btn:hover {
  background: rgba(102, 126, 234, 0.5);
  color: #fff;
}

/* Tile picker modal */
.tile-picker-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.tile-picker-content {
  background: #1e2030;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.tile-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tile-picker-header h3 {
  margin: 0;
  font-size: 1em;
  color: #667eea;
}

.tile-picker-body {
  overflow: auto;
  padding: 12px;
}

.tile-picker-body canvas {
  cursor: crosshair;
  image-rendering: pixelated;
  border-radius: 4px;
}
