/* ============================================================
   KU VSA Global CSS — Design Tokens & Utilities
   Follows Design.md strictly (no gradients, restrained radius)
   ============================================================ */

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

/* ── CSS Variables (Design Tokens) ─────────────────────────── */
:root {
  --brand-blue: #1e3a8a;
  --brand-light: #3b82f6;
  --brand-gold: #f59e0b;
  --brand-warm: #fff7ed;
  --body-bg: #f9fafb;
  --text-main: #374151;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --white: #ffffff;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.07), 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md:
    0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.07);
  --transition: 0.25s ease;
}

/* ── Base ───────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Prompt", sans-serif;
  background-color: var(--body-bg);
  color: var(--text-main);
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* ── Color Utility Classes ──────────────────────────────────── */
.text-brand-blue {
  color: var(--brand-blue) !important;
}
.text-brand-gold {
  color: var(--brand-gold) !important;
}
.text-brand-light {
  color: var(--brand-light) !important;
}

.bg-brand-blue {
  background-color: var(--brand-blue) !important;
}
.bg-brand-gold {
  background-color: var(--brand-gold) !important;
}
.bg-brand-warm {
  background-color: var(--brand-warm) !important;
}
.bg-brand-light {
  background-color: var(--brand-light) !important;
}

.border-brand-gold {
  border-color: var(--brand-gold) !important;
}
.border-brand-blue {
  border-color: var(--brand-blue) !important;
}

/* ── Typography ─────────────────────────────────────────────── */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Prompt", sans-serif;
}

.tracking-wider {
  letter-spacing: 0.08em;
}

/* ── Border Radius (restrained — per Design.md Anti-AI rule) ─ */
.rounded-sm {
  border-radius: var(--radius-sm) !important;
}
.rounded-md {
  border-radius: var(--radius-md) !important;
}
.rounded-xl {
  border-radius: var(--radius-lg) !important;
}
.rounded-2xl {
  border-radius: 10px !important;
}

/* ── Glassmorphism ──────────────────────────────────────────── */
.glass-panel {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ── Hover Animations (per Design.md) ──────────────────────── */
.transition-transform {
  transition:
    transform var(--transition),
    box-shadow var(--transition);
}

.hover-scale:hover {
  transform: scale(1.04);
}
.hover-translate-y:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg) !important;
}

/* ── Text Truncation ────────────────────────────────────────── */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Navbar ─────────────────────────────────────────────────── */
.nav-link-custom {
  color: rgba(255, 255, 255, 0.9) !important;
  font-weight: 500;
  font-size: 0.875rem;
  transition: color var(--transition);
  padding: 0.4rem 0.75rem !important;
}
.nav-link-custom:hover {
  color: var(--brand-gold) !important;
}
.nav-link-custom.active {
  color: var(--brand-gold) !important;
}

.navbar-scrolled {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  background-color: rgba(30, 58, 138, 0.97) !important;
  backdrop-filter: blur(8px);
}

/* ── Card Component ─────────────────────────────────────────── */
.card-kuvsa {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition:
    transform var(--transition),
    box-shadow var(--transition);
  background: var(--white);
}
.card-kuvsa:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.card-kuvsa .card-img-top {
  height: 192px;
  object-fit: cover;
  background: #f3f4f6;
}
.card-kuvsa .card-body {
  padding: 1.25rem 1.5rem;
}

/* ── Section Headers (per Design.md) ───────────────────────── */
.section-header {
  text-align: center;
  margin-bottom: 3rem;
}
.section-header .subtitle {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand-blue);
  margin-bottom: 0.5rem;
}
.section-header h2 {
  font-weight: 700;
  font-size: 2rem;
  color: #111827;
  margin-bottom: 0.75rem;
}
.section-header .divider {
  width: 80px;
  height: 3px;
  background: var(--brand-gold);
  margin: 0 auto;
  border-radius: 2px;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn-primary-kuvsa {
  background: var(--brand-blue);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  padding: 0.6rem 1.5rem;
  transition:
    opacity var(--transition),
    transform var(--transition);
}
.btn-primary-kuvsa:hover {
  background: var(--brand-blue);
  opacity: 0.9;
  color: #fff;
  transform: translateY(-1px);
}

.btn-gold-kuvsa {
  background: var(--brand-gold);
  color: var(--brand-blue);
  border: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  padding: 0.6rem 1.5rem;
  transition:
    opacity var(--transition),
    transform var(--transition);
}
.btn-gold-kuvsa:hover {
  background: var(--brand-gold);
  color: var(--brand-blue);
}

/* ── Status Badges ──────────────────────────────────────────── */
.badge-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-open {
  background: #dcfce7;
  color: #15803d;
}
.badge-closed {
  background: #f3f4f6;
  color: #6b7280;
}
.badge-draft {
  background: #fef3c7;
  color: #92400e;
}
.badge-published {
  background: #dbeafe;
  color: #1d4ed8;
}

/* ── Admin Sidebar ──────────────────────────────────────────── */
.admin-sidebar {
  width: 240px;
  height: 100vh;
  background: var(--brand-blue);
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transition:
    width 0.25s ease,
    transform 0.3s ease-in-out;
}
.admin-sidebar > * {
  flex-shrink: 0;
}
.admin-sidebar::-webkit-scrollbar {
  width: 5px;
}
.admin-sidebar::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}
.admin-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}
.admin-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}
.admin-sidebar .nav-link {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.875rem;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 0;
  transition:
    background var(--transition),
    color var(--transition);
}
.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-left: 3px solid var(--brand-gold);
  padding-left: 17px;
}
.admin-sidebar .nav-link i {
  width: 18px;
  text-align: center;
}

.admin-main {
  margin-left: 240px;
  padding: 80px 28px 40px;
  min-height: 100vh;
}

@media (max-width: 991.98px) {
  .admin-sidebar {
    transform: translateX(-100%);
    width: 260px;
    position: fixed;
    height: 100vh;
    padding-top: 0;
    z-index: 1045;
  }
  .admin-sidebar.show {
    transform: translateX(0);
  }
  .admin-main {
    margin-left: 0;
    padding-top: 80px;
  }
  .navbar.fixed-top {
    margin-left: 0 !important;
  }
}

/* ── Forms ──────────────────────────────────────────────────── */
.form-control,
.form-select {
  border-radius: var(--radius-md);
  border-color: var(--border);
  font-family: "Prompt", sans-serif;
  font-size: 0.9rem;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.12);
}
.form-label {
  font-weight: 500;
  font-size: 0.875rem;
  margin-bottom: 4px;
  color: #374151;
}

/* ── DataTable customization ────────────────────────────────── */
.dataTables_wrapper .dataTables_filter input {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  font-family: "Prompt", sans-serif;
  font-size: 0.875rem;
}

/* ── Alert / Flash ──────────────────────────────────────────── */
.alert {
  border-radius: var(--radius-md);
  border: none;
  font-size: 0.9rem;
}
.alert-success {
  background: #f0fdf4;
  color: #166534;
  border-left: 4px solid #22c55e;
}
.alert-danger {
  background: #fef2f2;
  color: #991b1b;
  border-left: 4px solid #ef4444;
}
.alert-warning {
  background: #fffbeb;
  color: #92400e;
  border-left: 4px solid #f59e0b;
}
.alert-info {
  background: #eff6ff;
  color: #1e40af;
  border-left: 4px solid #3b82f6;
}

/* ── Utilities ──────────────────────────────────────────────── */
.cursor-pointer {
  cursor: pointer;
}
.object-cover {
  object-fit: cover;
}

/* ── Page View Counter (footer) ─────────────────────────────── */
.visitor-badge {
  background: rgba(0, 0, 0, 0.25);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
}

/* ── QuillJS Editor ─────────────────────────────────────────── */
.ql-container {
  font-family: "Prompt", sans-serif;
  font-size: 0.9rem;
}
.ql-toolbar {
  border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
  border-color: var(--border) !important;
}
.ql-container.ql-snow {
  border-radius: 0 0 var(--radius-md) var(--radius-md) !important;
  border-color: var(--border) !important;
  min-height: 200px;
}

/* ── Select2 Overrides ──────────────────────────────────────── */
.select2-container .select2-selection--single {
  height: 38px;
  border-color: var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
}
.select2-container--default
  .select2-selection--single
  .select2-selection__rendered {
  padding: 0 12px;
  font-size: 0.9rem;
  font-family: "Prompt", sans-serif;
}
.select2-container--default .select2-results__option--highlighted {
  background: var(--brand-blue) !important;
}

/* ── Drag & Drop Sortable ───────────────────────────────────── */
.sortable-item {
  cursor: grab;
}
.sortable-item:active {
  cursor: grabbing;
  opacity: 0.7;
}
.sortable-item.ghost {
  opacity: 0.4;
  border: 2px dashed var(--brand-gold);
}

/* ── Print styles ───────────────────────────────────────────── */
@media print {
  .admin-sidebar,
  .navbar,
  .btn,
  .no-print {
    display: none !important;
  }
  .admin-main {
    margin-left: 0 !important;
    padding: 0 !important;
  }
}
