/* ========================================
   FULL VALUE DAN - UGC Campaign Aggregator
   Slickdeals-Inspired Design
   ======================================== */

:root {
  --bg: #f5f5f5;
  --card-bg: #ffffff;
  --text-primary: #222222;
  --text-secondary: #666666;
  --text-muted: #999999;
  --accent: #e53935;
  --accent-hover: #c62828;
  --green: #2e7d32;
  --green-bg: #e8f5e9;
  --orange: #ef6c00;
  --orange-bg: #fff3e0;
  --blue: #1565c0;
  --blue-bg: #e3f2fd;
  --border: #e0e0e0;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
  --radius: 10px;
  --radius-sm: 6px;
  --header-bg: #1a1a2e;
  --nav-height: 52px;
  --max-width: 1100px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}

/* ===== HEADER ===== */
.header {
  background: var(--header-bg);
  color: white;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
  padding: 0 16px;
}

.logo {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  text-decoration: none;
  color: white;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo span { color: var(--accent); }

.header-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-nav a {
  color: #ccc;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.2s;
}
.header-nav a:hover { color: white; }
.header-nav a.active { color: white; }

.nav-highlight {
  background: var(--accent);
  color: white !important;
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 600 !important;
}

/* ===== FILTER BAR ===== */
.filter-bar {
  background: white;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: var(--nav-height);
  z-index: 99;
}

.filter-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-inner select,
.filter-inner input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: white;
  color: var(--text-primary);
}

.filter-inner select:focus,
.filter-inner input:focus {
  outline: none;
  border-color: var(--accent);
}

.filter-inner .count {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: auto;
}

/* ===== CAMPAIGN GRID ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px;
}

.campaign-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ===== CAMPAIGN CARD (Slickdeals Style) ===== */
.campaign-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, border-color 0.2s;
  display: flex;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}

.campaign-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: #ccc;
}

/* Left - Payout Column */
.card-payout {
  width: 140px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
  flex-shrink: 0;
  background: var(--green-bg);
  border-right: 1px solid var(--border);
}

.card-payout .amount {
  font-size: 24px;
  font-weight: 800;
  color: var(--green);
  line-height: 1.1;
}

.card-payout .bonus {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 600;
}

.card-payout .label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Middle - Content */
.card-content {
  flex: 1;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-content .brand {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-content .brand .category-tag {
  font-size: 10px;
  font-weight: 600;
  background: var(--blue-bg);
  color: var(--blue);
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-content .description {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.card-meta .platform {
  color: var(--text-secondary);
  font-weight: 500;
}

.card-meta .date {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Right - Action */
.card-action {
  width: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-left: 1px solid var(--border);
  flex-shrink: 0;
}

.card-action .arrow {
  font-size: 20px;
  color: var(--text-muted);
  transition: color 0.2s, transform 0.2s;
}

.campaign-card:hover .card-action .arrow {
  color: var(--accent);
  transform: translateX(3px);
}

/* ===== STATUS BADGE ===== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-active {
  background: var(--green-bg);
  color: var(--green);
}

.status-closed {
  background: #fbe9e7;
  color: #bf360c;
}

/* ===== SECTION HEADER ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
}

.section-header h2 {
  font-size: 18px;
  font-weight: 700;
}

.section-header .subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

/* ===== DETAIL PAGE ===== */
.detail-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 16px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 20px;
}

.back-link:hover { color: var(--accent); }

.detail-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.detail-header {
  background: var(--green-bg);
  padding: 24px;
  border-bottom: 1px solid var(--border);
}

.detail-header .brand {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.detail-header .payout-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 4px;
}

.detail-header .payout-amount {
  font-size: 28px;
  font-weight: 800;
  color: var(--green);
}

.detail-header .payout-bonus {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.detail-body {
  padding: 24px;
}

.detail-body h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 20px 0 8px;
  color: var(--text-primary);
}

.detail-body h3:first-child { margin-top: 0; }

.detail-body p, .detail-body ul {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.detail-body ul {
  padding-left: 20px;
  list-style: disc;
}

.detail-body ul li { margin-bottom: 4px; }

.detail-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin: 16px 0;
}

.detail-meta-item {
  display: flex;
  flex-direction: column;
}

.detail-meta-item .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.detail-meta-item .value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.apply-btn {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 12px 32px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  transition: background 0.2s;
  margin-top: 16px;
  border: none;
  cursor: pointer;
}

.apply-btn:hover { background: var(--accent-hover); }

.apply-btn .ref-note {
  display: block;
  font-size: 11px;
  font-weight: 400;
  opacity: 0.8;
  margin-top: 2px;
}

/* ===== ADMIN ===== */
.admin-container {
  max-width: 600px;
  margin: 40px auto;
  padding: 0 16px;
}

.admin-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}

.admin-card h2 {
  font-size: 22px;
  margin-bottom: 24px;
  text-align: center;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
}

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

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
}

.submit-btn {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.submit-btn:hover { background: var(--accent-hover); }

.admin-header {
  background: var(--header-bg);
  color: white;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-header a {
  color: #ccc;
  text-decoration: none;
  font-size: 13px;
}
.admin-header a:hover { color: white; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--bg);
  border-bottom: 2px solid var(--border);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.admin-table tr:hover td { background: #fafafa; }

.edit-link { color: var(--blue); text-decoration: none; font-weight: 600; }
.delete-link { color: var(--accent); text-decoration: none; font-weight: 600; }

/* ===== NOTIFICATIONS ===== */
.notification {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 500;
}

.notification.success {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid #c8e6c9;
}

.notification.error {
  background: #fbe9e7;
  color: #bf360c;
  border: 1px solid #ffccbc;
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.pagination a {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 13px;
  color: var(--text-primary);
  background: white;
  transition: all 0.2s;
}

.pagination a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pagination a.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* ===== FOOTER ===== */
.footer {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-muted);
  font-size: 12px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .card-payout {
    width: 100px;
    min-height: 100px;
    padding: 12px 8px;
  }
  .card-payout .amount { font-size: 18px; }
  .card-content .brand { font-size: 14px; }
  .card-content .description { font-size: 12px; }
  .filter-inner { gap: 8px; }
  .filter-inner select,
  .filter-inner input { font-size: 12px; padding: 6px 10px; }
  .detail-meta-grid { grid-template-columns: 1fr; }
  .header-nav a:not(.nav-highlight) { display: none; }
}
