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

:root {
  /* Color placeholders overridden by practice configurations */
  --primary-color: #0284c7;
  --secondary-color: #0d9488;
  --text-color: #1f2937;
  --bg-color: #f8fafc;
  
  /* Constant premium UI elements */
  --primary-light: hsla(200, 95%, 45%, 0.1);
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.4);
  --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05), 0 1px 1px rgba(0, 0, 0, 0.01);
  --hover-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.02);
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: 'Inter', sans-serif;
  --font-heading: 'Outfit', sans-serif;
}

/* CSS Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  color: var(--text-color);
  background-color: var(--bg-color);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 1rem;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition-smooth);
}

a:hover {
  color: var(--secondary-color);
}

.footer-link {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-link:hover,
.footer-link:focus-visible {
  color: #ffffff;
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Navigation header */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
  transition: var(--transition-smooth);
}

.navbar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 72px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2.5rem;
  position: relative;
  gap: 1rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text-color);
  flex: 1 1 auto;
  min-width: 0;
}

.nav-logo img {
  height: 40px;
  max-width: 100%;
  object-fit: contain;
}

.nav-logo span {
  display: inline-block;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.75rem;
  align-items: center;
}

.nav-link {
  font-weight: 500;
  font-size: 0.92rem;
  color: var(--text-color);
  opacity: 0.85;
  white-space: nowrap;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  border-radius: 2px;
  transition: width 0.25s ease;
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link:hover {
  color: var(--primary-color);
  opacity: 1;
}

.nav-links .btn {
  white-space: nowrap;
  padding: 0.6rem 1.4rem;
  font-size: 0.88rem;
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--hover-shadow);
}

.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-color);
  padding: 0.75rem;
  margin-left: 1rem;
  transition: color 0.2s ease;
}

.menu-toggle:hover {
  color: var(--primary-color);
}

.menu-toggle .hamburger {
  display: inline-block;
  width: 24px;
  height: 18px;
  position: relative;
}

.menu-toggle .hamburger span {
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.menu-toggle .hamburger span:nth-child(1) {
  top: 0;
}

.menu-toggle .hamburger span:nth-child(2) {
  top: 8px;
}

.menu-toggle .hamburger span:nth-child(3) {
  bottom: 0;
}

nav.mobile-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
  z-index: 90;
}

.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.726);
  z-index: 85;
}

.mobile-menu-overlay.active {
  display: block;
}

@media (max-width: 1024px) {
  .navbar-container {
    padding: 0 1rem;
    gap: 0.5rem;
  }

  .nav-logo {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 60%;
    overflow: hidden;
  }

  .nav-logo span {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-logo img {
    height: 38px;
    max-width: 100%;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    position: relative;
    z-index: 100;
  }

  nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 72px;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.2s ease;
    z-index: 90;
  }

  nav.mobile-open {
    display: block;
  }

  .nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.5rem 1rem 1.25rem;
    min-width: calc(100% - 2rem);
  }

  .nav-links li {
    width: 100%;
  }

  .nav-link {
    display: block;
    font-size: 1rem;
    padding: 0.75rem 0;
    color: var(--text-color);
  }

  .nav-link::after {
    display: none;
  }

  .nav-links .btn {
    width: 100%;
    font-size: 0.95rem;
    padding: 0.85rem 1rem;
  }

  .nav-links .btn-outline {
    width: 100%;
  }

  .nav-links .btn-primary {
    width: 100%;
  }
}

/* Custom premium buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.6rem;
  font-family: var(--font-heading);
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: none;
  gap: 0.5rem;
}

.btn-primary {
  background-color: var(--primary-color);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.btn-primary:hover {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  color: #ffffff;
}

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-outline:hover {
  background-color: var(--primary-color);
  color: #ffffff;
}

/* Hero Section */
.hero {
  padding: 8rem 0 6rem;
  text-align: center;
  background: radial-gradient(circle at 80% 20%, rgba(2, 132, 199, 0.05), transparent 45%),
              radial-gradient(circle at 10% 80%, rgba(13, 148, 136, 0.05), transparent 45%);
}

.hero-tag {
  display: inline-block;
  padding: 0.4rem 1rem;
  background: var(--primary-light);
  color: var(--primary-color);
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: 3.5rem;
  color: var(--text-color);
  max-width: 800px;
  margin: 0 auto 1.5rem;
}

.hero-subtitle {
  font-size: 1.25rem;
  max-width: 600px;
  margin: 0 auto 2.5rem;
  opacity: 0.8;
}

/* Card Section */
.section {
  padding: 6rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-title {
  font-size: 2.25rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2.5rem;
}

.card {
  background: #ffffff;
  border-radius: 20px;
  padding: 2.5rem;
  border: 1px solid rgba(0,0,0,0.03);
  box-shadow: var(--card-shadow);
  transition: var(--transition-smooth);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--hover-shadow);
}

/* Exit Warning Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: #ffffff;
  border-radius: 24px;
  max-width: 500px;
  width: 90%;
  padding: 2.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.8);
  text-align: center;
}

@media (max-width: 1024px) {
  .hero {
    padding: 4.5rem 1rem 3.5rem;
  }

  .hero-tag {
    margin-bottom: 1rem;
    font-size: 0.8rem;
    padding: 0.35rem 0.85rem;
  }

  .hero-title {
    font-size: 2.4rem;
    max-width: 100%;
    margin-bottom: 1.25rem;
  }

  .hero-subtitle {
    font-size: 1rem;
    max-width: 100%;
    margin-bottom: 1.75rem;
  }

  .hero .btn {
    min-width: 180px;
    width: 100%;
    max-width: 100%;
  }

  .hero > .container > div {
    gap: 1rem;
    justify-content: center;
  }

  .section {
    padding: 4rem 0;
  }

  .section-header {
    margin-bottom: 2rem;
  }

  .section-title {
    font-size: 1.9rem;
  }

  .grid {
    gap: 1.5rem;
  }

  .card {
    padding: 1.75rem;
  }

  .section .container > div[style*="display: flex"] {
    flex-direction: column !important;
    width: 100% !important;
  }

  .section .container > div[style*="flex: 1 1 520px;"] {
    flex: 1 1 100% !important;
  }

  .section .container > div[style*="flex: 1 1 320px;"] {
    flex: 1 1 100% !important;
    border-left: none !important;
    padding-left: 0 !important;
    border-top: 4px solid var(--primary-color) !important;
  }

  .section .container > div[style*="display: grid"] {
    grid-template-columns: 1fr !important;
  }

  .section .container > div[style*="display: flex; gap: 1rem;"] {
    justify-content: stretch !important;
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* =====================================================
   Admin Sidebar Layout System
   ===================================================== */

:root {
  --sidebar-width: 250px;
  --sidebar-collapsed-width: 68px;
  --sidebar-bg: #0f172a;
  --sidebar-text: #cbd5e1;
  --sidebar-text-active: #ffffff;
  --sidebar-accent: var(--primary-color);
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --sidebar-active-bg: rgba(255, 255, 255, 0.1);
  --sidebar-transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  --topbar-height: 56px;
}

/* Body layout when admin sidebar is active */
body.admin-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg-color);
}

/* Sidebar container */
.admin-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow: hidden;
  transition: var(--sidebar-transition);
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.15);
}

/* Brand header area */
.sidebar-brand {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  min-height: 64px;
  display: flex;
  align-items: center;
  color: var(--sidebar-text-active);
  overflow: hidden;
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.2s ease;
}

/* Section Labels */
.sidebar-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.3);
  padding: 1.25rem 1.25rem 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.2s ease;
}

/* Navigation links area */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.5rem 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1.25rem;
  margin: 2px 0.5rem;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: 10px;
  transition: var(--sidebar-transition);
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}

.sidebar-link svg {
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.sidebar-link:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-active);
}

.sidebar-link:hover svg {
  opacity: 1;
}

.sidebar-link.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-text-active);
  font-weight: 600;
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: -0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  border-radius: 0 4px 4px 0;
  background: var(--sidebar-accent);
}

.sidebar-link.active svg {
  opacity: 1;
  color: var(--sidebar-accent);
}

.sidebar-link-text {
  transition: opacity 0.2s ease;
}

/* Logout link */
.sidebar-logout {
  color: #f87171 !important;
}
.sidebar-logout:hover {
  background: rgba(248, 113, 113, 0.1) !important;
  color: #fca5a5 !important;
}

/* Sidebar Footer */
.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.5rem 0;
  flex-shrink: 0;
}

/* Main content area offset */
.admin-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: var(--sidebar-transition);
  width: calc(100% - var(--sidebar-width));
}

/* Mobile topbar (hidden on desktop by default) */
.admin-topbar {
  display: none;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-color);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--sidebar-transition);
}

.sidebar-toggle:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* Overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 190;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
}

/* =====================================================
   Desktop Collapsed State
   ===================================================== */

body.sidebar-collapsed .admin-sidebar {
  width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .admin-content {
  margin-left: var(--sidebar-collapsed-width);
  width: calc(100% - var(--sidebar-collapsed-width));
}

body.sidebar-collapsed .sidebar-brand-text,
body.sidebar-collapsed .sidebar-link-text,
body.sidebar-collapsed .sidebar-section-label {
  opacity: 0;
  pointer-events: none;
}

body.sidebar-collapsed .sidebar-link {
  justify-content: center;
  padding: 0.7rem;
  margin: 2px 0.35rem;
}

body.sidebar-collapsed .sidebar-link svg {
  opacity: 0.9;
}

body.sidebar-collapsed .sidebar-brand {
  justify-content: center;
  padding: 1.25rem 0.5rem;
}

/* Tooltip on hover when collapsed */
body.sidebar-collapsed .sidebar-link {
  position: relative;
}

body.sidebar-collapsed .sidebar-link:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(var(--sidebar-collapsed-width) - 0.25rem);
  top: 50%;
  transform: translateY(-50%);
  background: var(--sidebar-bg);
  color: var(--sidebar-text-active);
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8rem;
  white-space: nowrap;
  z-index: 300;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

/* Desktop toggle button (visible on desktop) */
@media (min-width: 769px) {
  .admin-topbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: transparent;
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .admin-topbar > span {
    display: none; /* Hide brand name on desktop topbar — it's in the sidebar */
  }
}

/* =====================================================
   Mobile / Tablet Responsive (≤768px)
   ===================================================== */

@media (max-width: 768px) {
  .admin-sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width);
    box-shadow: none;
  }

  body.sidebar-mobile-open .admin-sidebar {
    transform: translateX(0);
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.3);
  }

  body.sidebar-mobile-open .sidebar-overlay {
    display: block;
  }

  .admin-content {
    margin-left: 0;
    width: 100%;
    padding-top: var(--topbar-height);
  }

  .admin-topbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1rem;
    height: var(--topbar-height);
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 150;
  }

  /* Don't apply sidebar collapsed state on mobile */
  body.sidebar-collapsed .admin-content {
    margin-left: 0;
    width: 100%;
  }
}

/* Rich text editor content display overrides (Quill HTML outputs) */
.rich-content ul {
  list-style-type: disc !important;
  margin-left: 1.5rem !important;
  margin-bottom: 1rem !important;
  padding-left: 0.5rem !important;
  display: block !important;
}
.rich-content ol {
  list-style-type: none !important;
  margin-left: 1.5rem !important;
  margin-bottom: 1rem !important;
  padding-left: 0.5rem !important;
  display: block !important;
}
.rich-content ol li {
  list-style-type: decimal !important;
}
.rich-content ol li[data-list="bullet"] {
  list-style-type: disc !important;
}
.rich-content li {
  margin-bottom: 0.5rem !important;
  display: list-item !important;
}
.rich-content h1, .rich-content h2, .rich-content h3 {
  color: var(--text-color);
  font-family: var(--font-heading);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-weight: 700;
}
.rich-content h1 { font-size: 2rem; }
.rich-content h2 { font-size: 1.6rem; }
.rich-content h3 { font-size: 1.3rem; }


