/* Content Pool System - Dashboard CSS */
/* Redesign: größere Schriften, mehr Farben, modernes Brand-Feel */

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

:root {
  --primary: #2563EB;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --accent: #7C3AED;
  --accent-dark: #6d28d9;
  --accent-light: #ede9fe;
  --success: #059669;
  --success-light: #d1fae5;
  --warning: #D97706;
  --warning-light: #fef3c7;
  --danger: #DC2626;
  --danger-light: #fee2e2;
  --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;
  --white: #ffffff;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 32px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  font-size: 15px;
}

/* ============ LOGIN ============ */
.login-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #1e1b4b 0%, #2563EB 60%, #7C3AED 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.login-box {
  background: var(--white);
  padding: 48px 40px;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  width: 380px;
  text-align: center;
}

.login-box h1 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--gray-900);
  letter-spacing: -0.5px;
}

.login-box p {
  color: var(--gray-400);
  margin-bottom: 28px;
  font-size: 15px;
}

.login-box input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 15px;
  margin-bottom: 16px;
  transition: border-color 0.2s;
}

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

.login-box button {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.2px;
  transition: opacity 0.2s;
}

.login-box button:hover {
  opacity: 0.92;
}

/* ============ LAYOUT ============ */
.app-container {
  display: none;
}

.app-container.visible {
  display: flex;
  min-height: 100vh;
}

/* ============ SIDEBAR ============ */
.sidebar {
  width: 256px;
  background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 100%);
  color: white;
  padding: 24px 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 0 24px 28px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 16px;
}

.sidebar-logo h2 {
  font-size: 20px;
  font-weight: 700;
  color: white;
  letter-spacing: -0.3px;
}

.sidebar-logo span {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  margin-top: 2px;
  display: block;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 24px;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}

.sidebar nav a:hover {
  background: rgba(255,255,255,0.07);
  color: white;
}

.sidebar nav a.active {
  background: rgba(124,58,237,0.25);
  color: white;
  border-left-color: var(--accent);
}

.sidebar nav a .icon {
  width: 22px;
  text-align: center;
  font-size: 17px;
}

/* ============ MAIN ============ */
.main-content {
  flex: 1;
  margin-left: 256px;
  padding: 28px 32px;
}

.page-header {
  margin-bottom: 28px;
}

.page-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.5px;
}

.page-header p {
  color: var(--gray-400);
  font-size: 15px;
  margin-top: 4px;
}

/* ============ METRIC CARDS ============ */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.metric-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-100);
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: var(--radius) var(--radius) 0 0;
}

.metric-card .label {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-500);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-card .value {
  font-size: 36px;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -1px;
}

.metric-card .value.blue { color: var(--primary); }
.metric-card .value.green { color: var(--success); }
.metric-card .value.yellow { color: var(--warning); }
.metric-card .value.red { color: var(--danger); }

/* ============ CARDS ============ */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-100);
  margin-bottom: 24px;
}

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

.card-header h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--gray-900);
}

.card-body {
  padding: 24px;
}

/* ============ TABLES ============ */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}

table th {
  text-align: left;
  padding: 11px 16px;
  background: var(--gray-50);
  color: var(--gray-500);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 2px solid var(--gray-200);
}

table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
}

table tr:last-child td {
  border-bottom: none;
}

table tr:hover td {
  background: #f5f3ff;
}

/* ============ BADGES ============ */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.badge-pending { background: var(--gray-100); color: var(--gray-600); }
.badge-sent { background: var(--primary-light); color: var(--primary); }
.badge-approved { background: var(--success-light); color: var(--success); }
.badge-changes { background: var(--warning-light); color: var(--warning); }
.badge-published { background: #d1fae5; color: #065f46; }
.badge-high { background: var(--danger-light); color: var(--danger); }
.badge-medium { background: var(--warning-light); color: var(--warning); }
.badge-normal { background: var(--gray-100); color: var(--gray-600); }
.badge-low { background: var(--gray-50); color: var(--gray-400); }
.badge-accent { background: var(--accent-light); color: var(--accent); }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  letter-spacing: 0.1px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}

.btn-primary:hover {
  opacity: 0.9;
  box-shadow: 0 4px 12px rgba(37,99,235,0.35);
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, var(--success), #0d9488);
  color: white;
  box-shadow: 0 2px 8px rgba(5,150,105,0.25);
}

.btn-success:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

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

.btn-danger:hover {
  background: #b91c1c;
}

.btn-outline {
  background: transparent;
  color: var(--gray-600);
  border: 1.5px solid var(--gray-200);
}

.btn-outline:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 13px;
}

/* ============ FORMS ============ */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  color: var(--gray-800);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.1);
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

/* ============ MODAL ============ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.55);
  z-index: 500;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.modal-overlay.visible {
  display: flex;
}

.modal {
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 580px;
  max-height: 85vh;
  overflow-y: auto;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
  border-radius: 16px 16px 0 0;
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--gray-900);
}

.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--gray-400);
  line-height: 1;
  transition: color 0.15s;
}

.modal-close:hover {
  color: var(--gray-700);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--gray-50);
  border-radius: 0 0 16px 16px;
}

/* ============ TABS ============ */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 24px;
  overflow-x: auto;
}

.tab {
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-400);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
  white-space: nowrap;
}

.tab:hover {
  color: var(--gray-700);
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.tab-content {
  display: none;
}

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

/* ============ AUDIENCE MIX SLIDER ============ */
.mix-slider-container {
  padding: 16px 0;
}

.mix-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 10px;
  font-weight: 600;
}

.mix-slider-labels .left { color: var(--primary); }
.mix-slider-labels .right { color: var(--accent); }

.mix-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  background: linear-gradient(to right, var(--primary) 0%, var(--accent) 100%);
  border-radius: 4px;
  outline: none;
}

.mix-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  background: white;
  border: 2px solid var(--accent);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}

.mix-slider-value {
  text-align: center;
  margin-top: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-700);
}

/* ============ IMAGE GRID ============ */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px;
}

.image-card {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid var(--gray-100);
  transition: border-color 0.2s;
}

.image-card:hover {
  border-color: var(--accent);
}

.image-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-card .image-actions {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(15,23,42,0.75));
  padding: 20px 6px 8px;
  display: flex;
  justify-content: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.image-card:hover .image-actions {
  opacity: 1;
}

/* ============ UPLOAD ZONE ============ */
.upload-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 36px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 18px;
  background: var(--gray-50);
}

.upload-zone:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.upload-zone .icon {
  font-size: 36px;
  margin-bottom: 10px;
}

.upload-zone p {
  color: var(--gray-500);
  font-size: 14.5px;
}

/* ============ POST PREVIEW ============ */
.post-card {
  background: var(--white);
  border: 1.5px solid var(--gray-100);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.post-card:hover {
  border-color: var(--accent-light);
  box-shadow: 0 4px 16px rgba(124,58,237,0.08);
}

.post-meta {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.post-caption {
  font-size: 14.5px;
  color: var(--gray-800);
  margin-bottom: 10px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.post-hashtags {
  font-size: 13.5px;
  color: var(--accent);
  margin-bottom: 10px;
  font-weight: 500;
}

.post-image-suggestion {
  font-size: 13px;
  color: var(--gray-500);
  background: var(--gray-50);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  border-left: 3px solid var(--accent-light);
}

.post-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ============ EMPTY STATE ============ */
.empty-state {
  text-align: center;
  padding: 52px 20px;
  color: var(--gray-400);
}

.empty-state .icon {
  font-size: 52px;
  margin-bottom: 14px;
  opacity: 0.6;
}

.empty-state p {
  font-size: 15px;
}

/* ============ SECTION PAGES ============ */
.page-section {
  display: none;
}

.page-section.active {
  display: block;
}

/* ============ TOAST ============ */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--gray-900);
  color: white;
  padding: 14px 22px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-weight: 500;
  z-index: 2000;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.3s;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.success { background: linear-gradient(135deg, var(--success), #0d9488); }
.toast.error { background: linear-gradient(135deg, var(--danger), #b91c1c); }

/* ============ SECTION TITLE BAR ============ */
.section-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.section-title-bar h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-800);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .sidebar {
    width: 64px;
    padding: 12px 0;
  }

  .sidebar-logo h2,
  .sidebar-logo span,
  .sidebar nav a span:not(.icon) {
    display: none;
  }

  .sidebar nav a {
    justify-content: center;
    padding: 14px;
    border-left: none;
  }

  .sidebar nav a.active {
    background: rgba(124,58,237,0.2);
  }

  .main-content {
    margin-left: 64px;
    padding: 16px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .modal {
    width: 95%;
  }
}
