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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
}

#root {
  min-height: 100vh;
}

.admin-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.admin-header {
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.admin-header h1 {
  color: #1a1a1a;
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.admin-header p {
  color: #2d2d2d;
  font-size: 1.1rem;
}

.stations-list {
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/*
 * Force the admin panel to display exactly three station cards per row on
 * larger screens.  Using a fixed three-column grid ensures the cards
 * align neatly regardless of the available space, while the mobile
 * media query below collapses the layout to a single column for small
 * screens.  This approach avoids relying on auto-fill and minmax
 * calculations, guaranteeing a consistent three-across presentation.
 */
.stations-grid {
  display: grid;
  /* Create three equal-width columns for the station cards */
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.station-item {
  background: rgba(255, 255, 255, 0.6);
  border-radius: 15px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.7);
  transition: all 0.3s ease;
}

.station-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.station-item h3 {
  color: #1a1a1a;
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.station-item .frequency {
  display: inline-block;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.station-item .info {
  color: #2d2d2d;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

.button-group {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.btn {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

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

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.8);
  color: #333;
}

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

.btn-danger {
  background: #e74c3c;
  color: white;
}

.btn-danger:hover {
  background: #c0392b;
  transform: translateY(-2px);
}

.add-station-btn {
  margin-bottom: 1.5rem;
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 2rem;
}

.modal {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
  background: linear-gradient(135deg, #667eea, #764ba2);
  padding: 1.5rem 2rem;
  border-radius: 20px 20px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  color: white;
  font-size: 1.8rem;
}

.close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.modal-content {
  padding: 2rem;
}

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

.form-group label {
  display: block;
  color: #1a1a1a;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.8rem;
  border: 2px solid rgba(102, 126, 234, 0.3);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.8);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #667eea;
  background: white;
}

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

.form-group small {
  display: block;
  color: #666;
  margin-top: 0.3rem;
  font-size: 0.85rem;
}

.image-upload {
  border: 2px dashed rgba(102, 126, 234, 0.3);
  border-radius: 10px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.5);
}

.image-upload:hover {
  border-color: #667eea;
  background: rgba(255, 255, 255, 0.8);
}

.image-upload input[type="file"] {
  display: none;
}

.image-preview {
  margin-top: 1rem;
  max-width: 200px;
  border-radius: 10px;
  overflow: hidden;
}

.image-preview img {
  width: 100%;
  height: auto;
  display: block;
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid rgba(0, 0, 0, 0.1);
}

.loading {
  text-align: center;
  padding: 4rem;
  color: white;
  font-size: 1.2rem;
}

.error {
  background: #e74c3c;
  color: white;
  padding: 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
}

.success {
  background: #27ae60;
  color: white;
  padding: 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
}

@media (max-width: 768px) {
  .admin-container {
    padding: 1rem;
  }
  
  .stations-grid {
    grid-template-columns: 1fr;
  }
  
  .modal {
    margin: 1rem;
  }
  
  .modal-content {
    padding: 1.5rem;
  }
}
