/* Modern Admin Dashboard Styles */
:root {
  --primary: #2563eb;
  --primary-light: #3b82f6;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
  --danger-light: #ef4444;
  --success: #16a34a;
  --warning: #ca8a04;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --radius: 0.5rem;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  color: var(--gray-800);
  background: var(--gray-100);
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  background: white;
  padding: 1rem;
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow);
}

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

.header-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* Main Content */
main {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Cards */
.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

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

.card-content {
  padding: 1.5rem;
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.form-group.full-width {
  grid-column: span 2;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0;
}

.checkbox-group label {
  margin: 0;
  cursor: pointer;
}

label {
  font-weight: 500;
  color: var(--gray-700);
}

small {
  color: var(--gray-500);
  font-size: 0.875rem;
}

input:not([type="range"]), select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: border-color 0.15s;
}

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

input[type="range"] {
  width: 100%;
}

.datetime-input {
  font-family: inherit;
  color: inherit;
}

.form-actions {
  margin-top: 2rem;
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  font-size: 0.875rem;
  text-decoration: none;
}

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

.button.primary:hover {
  background: var(--primary-dark);
}

.button.danger {
  background: var(--danger);
  color: white;
}

.button.danger:hover {
  background: var(--danger-light);
}

.icon-button {
  padding: 0.5rem;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background-color 0.15s;
}

.icon-button:hover {
  background: var(--gray-100);
}

/* Table */
.card-content {
  padding: 1.5rem;
}

.experiments-table {
  min-height: 300px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
}

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

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

th {
  font-weight: 500;
  color: var(--gray-600);
  background: var(--gray-50);
  position: sticky;
  top: 0;
  z-index: 1;
}

tr:hover {
  background: var(--gray-50);
}

.empty-state {
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--gray-500);
  font-size: 0.875rem;
  background: white;
}

/* Status Badges */
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.status.running {
  background: rgba(22, 163, 74, 0.1);
  color: var(--success);
}

.status.paused {
  background: rgba(202, 138, 4, 0.1);
  color: var(--warning);
}

.status.stopped {
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger);
}

/* Search Box */
.search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  background: white;
}

.search-box input {
  border: none;
  padding: 0;
  font-size: 0.875rem;
}

.search-box input:focus {
  outline: none;
  box-shadow: none;
}

.search-box .material-icons {
  color: var(--gray-400);
  font-size: 1.25rem;
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 1rem 1.5rem;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transform: translateY(150%);
  transition: transform 0.3s ease-out;
}

.toast.show {
  transform: translateY(0);
}

.toast.success {
  background: var(--success);
  color: white;
}

.toast.error {
  background: var(--danger);
  color: white;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  padding: 2rem;
  overflow-y: auto;
}

.modal.show {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.modal-content {
  width: 100%;
  max-width: 800px;
  margin: auto;
  animation: modal-in 0.3s ease-out;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .form-group.full-width {
    grid-column: auto;
  }
  
  .card-header {
    flex-direction: column;
    gap: 1rem;
  }
  
  .search-box {
    width: 100%;
  }
  
  table {
    display: block;
    overflow-x: auto;
  }
}
