/* ================================================================
   MedPublish CI4 - PT. Papaya Utama Sehat
   Design System - Modern Medical Publication Portal
   Enterprise Security & Medical Typography Theme
   ================================================================ */

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

:root {
  --primary:         #1565C0;
  --primary-dark:    #0D47A1;
  --primary-light:   #1976D2;
  --primary-bg:      #E3F2FD;
  --accent:          #F57C00;
  --accent-light:    #FFB74D;
  --green:           #2E7D32;
  --green-light:     #4CAF50;
  --white:           #FFFFFF;
  --surface:         #F8FAFC;
  --gray-50:         #F8FAFC;
  --gray-100:        #F1F5F9;
  --gray-200:        #E2E8F0;
  --gray-300:        #CBD5E1;
  --gray-400:        #94A3B8;
  --gray-500:        #64748B;
  --gray-700:        #334155;
  --gray-800:        #1E293B;
  --gray-900:        #0F172A;
  --dark-blue:       #0A192F;
  --dark-blue-light: #112240;
  --success:         #059669;
  --danger:          #DC2626;
  --warning:         #D97706;
  --shadow-xs:       0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm:       0 1px 3px rgba(0,0,0,0.08);
  --shadow:          0 4px 12px rgba(0,0,0,0.10);
  --shadow-md:       0 8px 24px rgba(0,0,0,0.12);
  --shadow-lg:       0 16px 40px rgba(0,0,0,0.14);
  --shadow-xl:       0 24px 60px rgba(0,0,0,0.18);
  --radius-sm:       6px;
  --radius:          10px;
  --radius-md:       14px;
  --radius-lg:       20px;
  --radius-xl:       28px;
  --radius-full:     9999px;
  --transition:      all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--gray-800);
  background-color: var(--surface);
  line-height: 1.65;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--gray-900);
}

.fw-black {
  font-weight: 900 !important;
}

.tracking-tight {
  letter-spacing: -0.025em;
}

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

/* Backgrounds & Colors */
.bg-surface {
  background-color: var(--surface) !important;
}

.bg-dark-blue {
  background-color: var(--dark-blue) !important;
}

.bg-primary-subtle {
  background-color: #E3F2FD !important;
}

.bg-accent {
  background-color: var(--accent) !important;
}

.bg-accent-subtle {
  background-color: #FFF3E0 !important;
}

.text-accent {
  color: var(--accent) !important;
}

.text-accent-light {
  color: var(--accent-light) !important;
}

.text-white-90 {
  color: rgba(255, 255, 255, 0.9);
}

.text-white-80 {
  color: rgba(255, 255, 255, 0.8);
}

.text-white-75 {
  color: rgba(255, 255, 255, 0.75);
}

.text-white-60 {
  color: rgba(255, 255, 255, 0.6);
}

.hover-white:hover {
  color: #FFFFFF !important;
}

.hover-primary:hover {
  color: var(--primary) !important;
}

.hover-bg-white:hover {
  background-color: #FFFFFF !important;
}

.hover-text-primary:hover {
  color: var(--primary) !important;
}

/* ── Top Bar & Navbar ─────────────────────────────────────── */
.top-bar {
  background-color: #071526;
  font-size: 0.8rem;
}

.main-navbar {
  border-bottom: 1px solid var(--gray-200);
  transition: var(--transition);
}

.brand-logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-logo-img {
  max-height: 48px;
  max-width: 140px;
  object-fit: contain;
}

.brand-logo-fallback {
  width: 44px;
  height: 44px;
  background: var(--primary-bg);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--primary-dark);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.main-navbar .nav-link {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--gray-700);
  transition: var(--transition);
  border-radius: var(--radius-full);
}

.main-navbar .nav-link:hover {
  color: var(--primary);
  background-color: var(--gray-100);
}

.main-navbar .nav-link.active {
  color: var(--primary) !important;
}

/* ── Hero Section ─────────────────────────────────────────── */
.hero-section {
  background: linear-gradient(135deg, #0D47A1 0%, #1565C0 50%, #00897B 100%);
  position: relative;
}

.hero-particles {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

.hero-title {
  line-height: 1.15;
}

.hero-search-box {
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.backdrop-blur {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ── Stats Bar ────────────────────────────────────────────── */
.stats-bar-section {
  background-color: var(--white);
}

.stat-card {
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
}

/* ── Cards & Hover Effects ────────────────────────────────── */
.transition-hover {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.transition-hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md) !important;
}

.category-card {
  position: relative;
  background: var(--white);
}

.category-stripe {
  height: 5px;
  width: 100%;
}

.publication-card {
  background: var(--white);
}

.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;
}

/* ── Article Reader ───────────────────────────────────────── */
.article-reader-content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--gray-800);
}

.article-reader-content h2 {
  color: var(--primary-dark);
  border-bottom: 2px solid var(--primary-bg);
  padding-bottom: 8px;
}

.article-reader-content h3 {
  color: var(--gray-900);
  font-size: 1.3rem;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
}

.btn-primary:hover, .btn-primary:focus {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
}

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

.btn-accent:hover {
  background-color: #E65100;
  border-color: #E65100;
  color: var(--white);
}

.btn-xs {
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
}

.back-to-top {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 44px;
  height: 44px;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  font-size: 1rem;
}

/* ── Admin Sidebar Layout ─────────────────────────────────── */
.admin-body {
  background-color: #F1F5F9;
}

.admin-sidebar {
  width: 260px;
  min-height: 100vh;
  background-color: var(--dark-blue);
  flex-shrink: 0;
}

.admin-logo-img {
  max-height: 38px;
  max-width: 100px;
  object-fit: contain;
}

.admin-sidebar-nav .nav-link {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius);
  transition: var(--transition);
}

.admin-sidebar-nav .nav-link:hover {
  color: #FFFFFF;
  background-color: rgba(255, 255, 255, 0.08);
}

.admin-sidebar-nav .nav-link.active {
  color: #FFFFFF !important;
  background-color: var(--primary) !important;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(21, 101, 192, 0.35);
}

.admin-topbar {
  min-height: 60px;
}

/* ── Footer ───────────────────────────────────────────────── */
.footer-logo-img {
  max-height: 42px;
  max-width: 120px;
  object-fit: contain;
}

.footer-links a {
  transition: var(--transition);
}

.footer-links a:hover {
  color: #FFFFFF !important;
  transform: translateX(3px);
  display: inline-block;
}

/* ── Responsive & Mobile Browser Enhancements ──────────────── */
.mobile-bottom-nav {
  z-index: 1040;
  height: 62px;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.mobile-nav-item {
  color: var(--gray-500);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 10px;
  transition: var(--transition);
}

.mobile-nav-item i {
  font-size: 1.15rem;
  margin-bottom: 2px;
}

.mobile-nav-item.active,
.mobile-nav-item:hover {
  color: var(--primary);
}

.admin-sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 1045;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.admin-sidebar-backdrop.show {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 991.98px) {
  .admin-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -270px;
    width: 260px;
    z-index: 1050;
    overflow-y: auto;
    transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .admin-sidebar.show {
    left: 0;
  }
  .admin-main {
    width: 100%;
    min-width: 0;
  }
  .hero-title {
    font-size: 2rem;
  }
  .back-to-top {
    bottom: 76px;
    right: 16px;
  }
}

@media (max-width: 575.98px) {
  body {
    overflow-x: hidden;
  }
  .hero-section {
    padding-top: 2rem !important;
    padding-bottom: 2.2rem !important;
  }
  .hero-title {
    font-size: 1.65rem;
  }
  .hero-desc {
    font-size: 0.95rem !important;
  }
  .brand-logo-img {
    max-height: 38px;
  }
  .brand-subtitle {
    font-size: 0.68rem;
  }
  .stat-card .stat-value {
    font-size: 1.5rem !important;
  }
}
