:root {
  /* Monochrome Theme - Light Mode */
  --primary: #000000;
  --primary-dark: #080808;
  --secondary: #666666;
  --success: #27ae60;
  --danger: #c0392b;
  --warning: #f39c12;
  --info: #8e44ad;
  
  /* Backgrounds */
  --bg-body: #f5f5f5;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --bg-hover: #f0f0f0;
  
  /* Text */
  --text-main: #111111;
  --text-muted: #666666;
  --text-light: #ffffff;
  
  /* Borders */
  --border-color: #e0e0e0;
  --radius: 8px;
  --radius-sm: 4px;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.05);
  
  /* Transitions */
  --transition: all 0.2s ease;
}

[data-theme="dark"] {
  /* Monochrome Theme - Dark Mode */
  --primary: #ffffff;
  --primary-dark: #cccccc;
  
  --bg-body: #121212;      /* Very dark gray, almost black */
  --bg-card: #ff0000;      /* Slightly lighter for cards */
  --bg-input: #2d2d2d;
  --bg-hover: #2d2d2d;
  
  --text-main: #ffffff;
  --text-muted: #aaaaaa;
  --text-light: #000000;   /* Text on primary buttons in dark mode */
  
  --border-color: #333333;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  transition: var(--transition);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.logo {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-actions {
  display: flex;
  gap: 15px;
  align-items: center;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  transition: var(--transition);
}

.btn-primary { 
  background: var(--primary); 
  color: var(--text-light); 
}
.btn-primary:hover { 
  background: var(--primary-dark); 
  transform: translateY(-1px); 
}

/* In dark mode, primary button text needs to be black */
[data-theme="dark"] .btn-primary {
  color: #000000;
}

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #219150; transform: translateY(-1px); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #c0392b; }

.btn-outline { 
  background: transparent; 
  border: 1px solid var(--border-color); 
  color: var(--text-main); 
}
.btn-outline:hover { 
  background: var(--bg-hover); 
  border-color: var(--text-main); 
}

.btn-icon { padding: 8px; border-radius: 50%; min-width: 36px; min-height: 36px; }

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

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

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

label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: var(--text-main);
}

input[type="text"],
input[type="url"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 10px 15px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 14px;
  transition: var(--transition);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

textarea { resize: vertical; min-height: 100px; }

/* Grid Layouts */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
}

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

th {
  background: var(--bg-hover);
  font-weight: 600;
  color: var(--text-muted);
}

tr:hover { background: var(--bg-hover); }

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid transparent;
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
}

.modal.active { display: flex; }

.modal-content {
  background: var(--bg-card);
  padding: 30px;
  border-radius: var(--radius);
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: slideIn 0.3s ease;
  border: 1px solid var(--border-color);
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.close-modal {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 300px;
  animation: slideLeft 0.3s ease;
  border: 1px solid var(--border-color);
}

.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }

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

/* Utilities */
.text-center { text-align: center; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.d-none { display: none !important; }
.d-flex { display: flex; }
.flex-col { flex-direction: column; }
.gap-2 { gap: 0.5rem; }
.w-100 { width: 100%; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.text-main { color: var(--text-main); }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-danger { color: var(--danger); }
.text-sm { font-size: 0.875rem; }

/* Drag and Drop Zone */
.drop-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  margin-bottom: 20px;
  transition: var(--transition);
  cursor: pointer;
  background: var(--bg-hover);
}

.drop-zone:hover {
  border-color: var(--primary);
}

.drop-zone.dragover {
  border-color: var(--primary);
  background: rgba(128, 128, 128, 0.1);
}

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.tab-btn {
  padding: 10px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition);
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

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