@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-dark: #0b0f19;
  --bg-card: #151a28;
  --bg-card-hover: #1e2436;
  --bg-sidebar: #111623;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --border-light: #252d43;
  --border-focus: #3b82f6;
  
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #0ea5e9;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition-fast: 0.15s ease-in-out;
  --transition-normal: 0.3s ease-in-out;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

@media (min-width: 768px) {
  .layout { flex-direction: row; }
}

/* Sidebar */
.sidebar {
  width: 100%;
  background: var(--bg-sidebar);
  padding: 24px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .sidebar {
    width: 260px;
    height: 100vh;
    position: sticky;
    top: 0;
    border-bottom: none;
    border-right: 1px solid var(--border-light);
  }
}

.sidebar h2 {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 32px;
  background: linear-gradient(90deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.sidebar nav {
  display: flex;
  flex-direction: row;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
}

@media (min-width: 768px) {
  .sidebar nav {
    flex-direction: column;
    overflow-x: visible;
    padding-bottom: 0;
  }
}

.sidebar nav a {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.sidebar nav a:hover, .sidebar nav a.active {
  background: var(--bg-card);
  color: #fff;
}

.logout-container {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

@media (min-width: 768px) {
  .logout-container { margin-top: auto; }
}

.logout-container a {
  color: var(--danger);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  display: block;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.logout-container a:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* Main Content */
.main {
  flex: 1;
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

@media (min-width: 768px) {
  .main { padding: 40px; }
}

.header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}

@media (min-width: 576px) {
  .header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.header h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all var(--transition-fast);
  font-family: 'Inter', sans-serif;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.39);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.23);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: var(--bg-card);
  color: #fff;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
  transition: transform var(--transition-normal), border-color var(--transition-normal);
}

/* Forms */
.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-muted);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-dark);
  color: var(--text-main);
  font-size: 15px;
  outline: none;
  font-family: inherit;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

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

.hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--success);
  color: #fff;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  display: none;
  z-index: 200;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease-out forwards;
}

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

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Utilities */
.status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

.status-draft { background: rgba(148, 163, 184, 0.1); color: var(--text-muted); border: 1px solid rgba(148, 163, 184, 0.2); }
.status-running { background: rgba(16, 185, 129, 0.1); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.2); }
.status-completed { background: rgba(59, 130, 246, 0.1); color: var(--primary); border: 1px solid rgba(59, 130, 246, 0.2); }
.status-failed { background: rgba(239, 68, 68, 0.1); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.2); }
.status-paused { background: rgba(245, 158, 11, 0.1); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.2); }

/* File Upload Zone */
.file-upload-zone {
  background: var(--bg-dark);
  border-radius: var(--radius-md);
  padding: 32px 24px;
  border: 2px dashed var(--border-light);
  text-align: center;
  transition: all var(--transition-fast);
  cursor: pointer;
  margin-bottom: 24px;
}

.file-upload-zone:hover, .file-upload-zone.dragover {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.05);
}

.file-upload-zone h3 {
  font-size: 15px;
  margin-bottom: 8px;
  color: #fff;
}

.file-upload-zone p {
  font-size: 13px;
  color: var(--text-muted);
}
