﻿/* ============================================================
   Website Tracking Alumni — Main Stylesheet
   ============================================================ */

/* ── CSS Custom Properties ─────────────────────────────────── */
:root {
  --color-primary:       #2563eb;
  --color-primary-dark:  #1d4ed8;
  --color-primary-light: #dbeafe;
  --color-secondary:     #64748b;
  --color-success:       #16a34a;
  --color-warning:       #d97706;
  --color-danger:        #dc2626;
  --color-info:          #0891b2;
  --color-bg:            #f8fafc;
  --color-surface:       #ffffff;
  --color-border:        #e2e8f0;
  --color-text:          #1e293b;
  --color-text-muted:    #64748b;
  --font-sans:           'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono:           'Consolas', 'Courier New', monospace;
  --radius-sm:           4px;
  --radius-md:           8px;
  --radius-lg:           12px;
  --shadow-sm:           0 1px 3px rgba(0,0,0,.08);
  --shadow-md:           0 4px 12px rgba(0,0,0,.10);
  --shadow-lg:           0 8px 24px rgba(0,0,0,.12);
  --transition:          0.2s ease;
  --sidebar-width:       240px;
  --navbar-height:       60px;
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* ── Typography ─────────────────────────────────────────────── */
h1 { font-size: 1.875rem; font-weight: 700; line-height: 1.2; }
h2 { font-size: 1.5rem;   font-weight: 600; line-height: 1.3; }
h3 { font-size: 1.25rem;  font-weight: 600; line-height: 1.4; }
h4 { font-size: 1.125rem; font-weight: 600; }
h5 { font-size: 1rem;     font-weight: 600; }
p  { margin-bottom: .75rem; }
small { font-size: .875rem; color: var(--color-text-muted); }

/* ── Layout ─────────────────────────────────────────────────── */
.app-wrapper { display: flex; min-height: 100vh; }

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding-top: var(--navbar-height);
  min-height: 100vh;
  transition: margin-left var(--transition);
}

.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1rem; }

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: var(--sidebar-width); right: 0;
  height: var(--navbar-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.navbar-brand { font-size: 1.125rem; font-weight: 700; color: var(--color-primary); }
.navbar-right { display: flex; align-items: center; gap: 1rem; }
.navbar-user { display: flex; align-items: center; gap: .5rem; font-size: .9rem; }
.navbar-user .avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .8rem;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: #1e293b;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid #334155;
  display: flex; align-items: center; gap: .75rem;
}
.sidebar-logo-icon {
  width: 36px; height: 36px;
  background: var(--color-primary);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 1rem;
}
.sidebar-logo-text { font-weight: 700; font-size: .95rem; color: #f1f5f9; }

.sidebar-nav { flex: 1; padding: .75rem 0; }
.sidebar-section { padding: .5rem 1rem .25rem; font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: #64748b; }

.sidebar-link {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem 1rem;
  color: #94a3b8;
  font-size: .9rem;
  transition: background var(--transition), color var(--transition);
  border-radius: 0;
}
.sidebar-link:hover, .sidebar-link.active {
  background: #334155;
  color: #f1f5f9;
  text-decoration: none;
}
.sidebar-link.active { border-left: 3px solid var(--color-primary); }
.sidebar-link .icon { width: 18px; text-align: center; flex-shrink: 0; }

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid #334155;
}

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 1rem; font-weight: 600; }
.card-body { padding: 1.25rem; }
.card-footer {
  padding: .75rem 1.25rem;
  border-top: 1px solid var(--color-border);
  background: #f8fafc;
}

/* Stat cards */
.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  box-shadow: var(--shadow-sm);
}
.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.stat-icon.blue   { background: #dbeafe; color: var(--color-primary); }
.stat-icon.green  { background: #dcfce7; color: var(--color-success); }
.stat-icon.orange { background: #fef3c7; color: var(--color-warning); }
.stat-icon.purple { background: #f3e8ff; color: #7c3aed; }
.stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: .85rem; color: var(--color-text-muted); margin-top: .25rem; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: .9rem; font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

.btn-primary   { background: var(--color-primary);   color: #fff; border-color: var(--color-primary); }
.btn-primary:hover { background: var(--color-primary-dark); border-color: var(--color-primary-dark); }
.btn-secondary { background: var(--color-secondary); color: #fff; border-color: var(--color-secondary); }
.btn-success   { background: var(--color-success);   color: #fff; border-color: var(--color-success); }
.btn-danger    { background: var(--color-danger);    color: #fff; border-color: var(--color-danger); }
.btn-warning   { background: var(--color-warning);   color: #fff; border-color: var(--color-warning); }
.btn-outline   { background: transparent; color: var(--color-primary); border-color: var(--color-primary); }
.btn-outline:hover { background: var(--color-primary); color: #fff; }
.btn-ghost     { background: transparent; color: var(--color-text-muted); border-color: transparent; }
.btn-ghost:hover { background: var(--color-border); color: var(--color-text); }
.btn-sm { padding: .3rem .7rem; font-size: .8rem; }
.btn-lg { padding: .75rem 1.5rem; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }

/* ── Forms ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: .9rem; font-weight: 500; margin-bottom: .4rem; color: var(--color-text); }
.form-label .required { color: var(--color-danger); margin-left: .2rem; }

.form-control {
  display: block; width: 100%;
  padding: .5rem .75rem;
  font-size: .95rem; font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition), box-shadow var(--transition);
  line-height: 1.5;
}
.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.form-control.is-invalid { border-color: var(--color-danger); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(220,38,38,.15); }

textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }

.form-text { font-size: .8rem; color: var(--color-text-muted); margin-top: .3rem; }
.invalid-feedback { font-size: .8rem; color: var(--color-danger); margin-top: .3rem; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

/* ── Alerts / Flash Messages ─────────────────────────────────── */
.alert {
  padding: .875rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  margin-bottom: 1rem;
  display: flex; align-items: flex-start; gap: .75rem;
  font-size: .9rem;
}
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert-danger   { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning  { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-info     { background: #f0f9ff; border-color: #bae6fd; color: #075985; }
.alert-close { margin-left: auto; cursor: pointer; opacity: .7; background: none; border: none; font-size: 1.1rem; color: inherit; }
.alert-close:hover { opacity: 1; }

/* ── Tables ──────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--color-border); }
.table {
  width: 100%; border-collapse: collapse;
  font-size: .9rem;
}
.table th {
  background: #f8fafc;
  padding: .75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}
.table td {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #f8fafc; }
.table-actions { display: flex; gap: .4rem; flex-wrap: wrap; }

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .75rem; font-weight: 600;
  white-space: nowrap;
}
.badge-bekerja         { background: #dcfce7; color: #166534; }
.badge-wirausaha       { background: #dbeafe; color: #1e40af; }
.badge-studi           { background: #f3e8ff; color: #6b21a8; }
.badge-belum-bekerja   { background: #fef3c7; color: #92400e; }
.badge-belum-diperbarui{ background: #f1f5f9; color: #475569; }
.badge-admin           { background: #fee2e2; color: #991b1b; }
.badge-alumni          { background: #dbeafe; color: #1e40af; }

/* ── Pagination ──────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.page-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px;
  padding: 0 .5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: .875rem;
  color: var(--color-text);
  transition: all var(--transition);
}
.page-link:hover { background: var(--color-primary-light); border-color: var(--color-primary); color: var(--color-primary); text-decoration: none; }
.page-link.active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.page-link.disabled { opacity: .5; pointer-events: none; }

/* ── Profile ─────────────────────────────────────────────────── */
.profile-header {
  display: flex; align-items: flex-start; gap: 1.5rem;
  padding: 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
}
.profile-avatar {
  width: 96px; height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--color-border);
  flex-shrink: 0;
}
.profile-avatar-placeholder {
  width: 96px; height: 96px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 700;
  flex-shrink: 0;
}
.profile-info h2 { margin-bottom: .25rem; }
.profile-meta { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin-top: .5rem; font-size: .875rem; color: var(--color-text-muted); }

/* ── Forum ───────────────────────────────────────────────────── */
.topic-item {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  display: flex; gap: 1rem;
  transition: background var(--transition);
}
.topic-item:last-child { border-bottom: none; }
.topic-item:hover { background: #f8fafc; }
.topic-meta { font-size: .8rem; color: var(--color-text-muted); margin-top: .3rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.topic-count { display: flex; align-items: center; gap: .3rem; }

.comment-item {
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: .75rem;
  background: var(--color-surface);
}
.comment-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.comment-author { font-weight: 600; font-size: .9rem; }
.comment-date   { font-size: .8rem; color: var(--color-text-muted); }

/* ── Auth Pages ──────────────────────────────────────────────── */
.auth-wrapper {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  padding: 1rem;
}
.auth-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 440px;
  padding: 2rem;
}
.auth-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}
.auth-logo-icon {
  width: 56px; height: 56px;
  background: var(--color-primary);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto .75rem;
  font-size: 1.5rem; color: #fff;
}
.auth-title { font-size: 1.375rem; font-weight: 700; text-align: center; margin-bottom: .25rem; }
.auth-subtitle { text-align: center; color: var(--color-text-muted); font-size: .9rem; margin-bottom: 1.5rem; }

/* ── Search & Filter Bar ─────────────────────────────────────── */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end;
  padding: 1rem 1.25rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--color-border);
}
.filter-bar .form-group { margin-bottom: 0; }
.filter-bar .form-control { min-width: 160px; }

/* ── Page Header ─────────────────────────────────────────────── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem; flex-wrap: wrap; gap: .75rem;
}
.page-title { font-size: 1.375rem; font-weight: 700; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ── Breadcrumb ──────────────────────────────────────────────── */
.breadcrumb { display: flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--color-text-muted); margin-bottom: 1rem; flex-wrap: wrap; }
.breadcrumb a { color: var(--color-primary); }
.breadcrumb-sep { color: var(--color-border); }

/* ── Empty State ─────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 3rem 1rem;
  color: var(--color-text-muted);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; opacity: .4; }
.empty-state h3 { font-size: 1.1rem; margin-bottom: .5rem; color: var(--color-text); }

/* ── Chart Container ─────────────────────────────────────────── */
.chart-container { position: relative; height: 280px; }

/* ── Utility Classes ─────────────────────────────────────────── */
.d-flex   { display: flex; }
.d-grid   { display: grid; }
.d-block  { display: block; }
.d-none   { display: none; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-1 { gap: .25rem; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: .75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .25rem; }
.mb-2 { margin-bottom: .5rem; }
.mb-3 { margin-bottom: .75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.p-0  { padding: 0; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--color-text-muted); }
.text-danger { color: var(--color-danger); }
.text-success{ color: var(--color-success); }
.text-primary{ color: var(--color-primary); }
.text-sm { font-size: .875rem; }
.text-xs { font-size: .75rem; }
.fw-bold { font-weight: 700; }
.fw-600  { font-weight: 600; }
.w-100   { width: 100%; }
.rounded { border-radius: var(--radius-md); }
.rounded-full { border-radius: 999px; }
.overflow-hidden { overflow: hidden; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Divider ─────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--color-border); margin: 1.25rem 0; }

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.modal {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto;
}
.modal-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-weight: 600; }
.modal-close { background: none; border: none; font-size: 1.25rem; cursor: pointer; color: var(--color-text-muted); }
.modal-body   { padding: 1.25rem; }
.modal-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--color-border); display: flex; justify-content: flex-end; gap: .5rem; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }
  .sidebar { transform: translateX(-100%); transition: transform var(--transition); }
  .sidebar.open { transform: translateX(0); --sidebar-width: 240px; }
  .main-content { margin-left: 0; }
  .navbar { left: 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .filter-bar { flex-direction: column; }
  .filter-bar .form-control { min-width: 100%; }
  .profile-header { flex-direction: column; align-items: center; text-align: center; }
  .profile-meta { justify-content: center; }
  .table th, .table td { padding: .5rem .75rem; }
}

@media (max-width: 480px) {
  .auth-card { padding: 1.5rem; }
  .page-container { padding: 1rem; }
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
}

/* ── Print ───────────────────────────────────────────────────── */
@media print {
  .sidebar, .navbar, .btn, .filter-bar, .pagination, .no-print { display: none !important; }
  .main-content { margin-left: 0; padding-top: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; }
  body { background: #fff; }
  a { color: inherit; text-decoration: none; }
}
