/* ============================================================
   NILLI — main.css
   Global styles: design tokens, typography, layout, utilities
   Mobile-first (320px+)
   ============================================================ */

/* ------------------------------------------------------------
   1. CSS Reset
   ------------------------------------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

img, svg, video {
  display: block;
  max-width: 100%;
}

button, input, select, textarea {
  font: inherit;
}

/* ------------------------------------------------------------
   2. Design Tokens & Custom Properties
   ------------------------------------------------------------ */
:root {
  /* Color tokens */
  --white:  #f5f4f0;
  --black:  #0a0a0a;
  --lime:   #c8ff00;
  --gray1:  #f0ede8;

  /* Extended palette */
  --gray2:  #e0ddd8;
  --gray3:  #b0ada8;
  --gray4:  #6b6864;
  --gray5:  #3a3836;

  /* Semantic */
  --bg:          var(--white);
  --surface:     #ffffff;
  --border:      var(--gray2);
  --text:        var(--black);
  --text-muted:  var(--gray4);

  /* Font families */
  --sans:  'Familjen Grotesk', system-ui, sans-serif;
  --display: 'Bebas Neue', var(--sans);
  --mono:  'JetBrains Mono', 'Courier New', monospace;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* Radius */
  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 16px;

  /* Transitions */
  --transition: 150ms ease;
}

/* ------------------------------------------------------------
   3. Base Body Styles
   ------------------------------------------------------------ */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ------------------------------------------------------------
   4. Typography
   ------------------------------------------------------------ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--display);
  line-height: 1.1;
  letter-spacing: 0.02em;
}

h1 { font-size: clamp(2rem, 8vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 5vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 4vw, 2rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
  max-width: 65ch;
}

a {
  color: inherit;
  text-decoration: underline;
}

a:hover {
  opacity: 0.75;
}

code, pre, kbd, samp {
  font-family: var(--mono);
  font-size: 0.875em;
}

pre {
  overflow-x: auto;
  padding: var(--space-4);
  background: var(--gray1);
  border-radius: var(--radius);
}

/* ------------------------------------------------------------
   5. Buttons
   ------------------------------------------------------------ */

/* Primary CTA: black background, lime text */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 20px;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--black);
  color: var(--lime);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: opacity var(--transition), background var(--transition), color var(--transition);
  white-space: nowrap;
  user-select: none;
}

.btn:hover {
  opacity: 0.85;
  text-decoration: none;
}

.btn:active {
  opacity: 0.7;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Outline variant */
.btn-outline {
  background: transparent;
  border-color: var(--black);
  color: var(--black);
}

.btn-outline:hover {
  background: var(--black);
  color: var(--lime);
  opacity: 1;
}

/* Small size */
.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

/* Large size */
.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
}

/* Lime/accent variant */
.btn-lime {
  background: var(--lime);
  color: var(--black);
}

/* ------------------------------------------------------------
   6. Admin Layout
   ------------------------------------------------------------ */

/* Admin page wrapper */
.admin-body {
  min-height: 100vh;
  background: var(--white);
}

/* Top navigation bar */
.admin-nav {
  position: sticky;
  top: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  padding: 0 var(--space-5);
  height: 56px;
  background: rgba(245, 244, 240, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

/* Clinic / brand name in nav */
.nav-brand {
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: 2px;
  text-decoration: none;
  color: var(--black);
}

/* Right-side user area */
.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.nav-username {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

/* Main content area */
.admin-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-5);
}

/* Tab bar */
.admin-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  padding: 0 var(--space-5);
  background: var(--surface);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.admin-tabs::-webkit-scrollbar {
  display: none;
}

/* Individual tab button */
.tab-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--gray4);
  padding: 0 16px;
  height: 48px;
  transition: color var(--transition), border-bottom-color var(--transition);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--black);
}

.tab-btn.active {
  color: var(--black);
  border-bottom-color: var(--black);
}

/* Tab content panels */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ------------------------------------------------------------
   7. Waiting Room Layout
   ------------------------------------------------------------ */
.wr-body {
  background: var(--white);
  min-height: 100vh;
}

.wr-container {
  max-width: 480px;
  margin: 0 auto;
  padding: var(--space-5) 20px;
}

/* ------------------------------------------------------------
   8. Responsive — 768px+
   ------------------------------------------------------------ */
@media (min-width: 768px) {
  .admin-main {
    padding: var(--space-7) var(--space-6);
  }

  .wr-container {
    padding: var(--space-7) var(--space-5);
  }

  .admin-nav {
    padding: 0 var(--space-6);
  }

  .admin-tabs {
    padding: 0 var(--space-6);
  }
}

/* ------------------------------------------------------------
   9. Utilities
   ------------------------------------------------------------ */

/* Screen-reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Text helpers */
.text-muted  { color: var(--text-muted); }
.text-center { text-align: center; }
.text-mono   { font-family: var(--mono); }

/* Flex helpers */
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2        { gap: var(--space-2); }
.gap-3        { gap: var(--space-3); }
.gap-4        { gap: var(--space-4); }

/* Spacing helpers */
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }


/* Notification styles */
@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.notification-success {
  background-color: #38a169;
  color: white;
}

.notification-error {
  background-color: #e53e3e;
  color: white;
}
