/* ==========================================================================
   TRIPODCARE DESIGN SYSTEM & UTILITY STYLES
   Official Design Tokens & Custom CSS Stylesheet for Tripod Medical Centre
   ========================================================================== */

:root {
  /* Color Tokens - Light Theme (Tripod Logo Colors) */
  --primary: #185A88; /* Tripod Logo Blue */
  --primary-hover: #12486D;
  --primary-active: #0D3652;
  --primary-tint: #EBF3F8;
  --secondary: #2EAD5C; /* Tripod Logo Green */
  --secondary-hover: #248A49;
  --accent: #E1794E;
  --accent-tint: #FBEAE1;
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-elevated: #FFFFFF;
  --border: #E2E8E6;
  --border-strong: #CBD6D2;
  --text-primary: #101A18;
  --text-secondary: #4B5B57;
  --text-muted: #8A9A96;
  
  /* Status Color Tokens */
  --success: #1F9D6C;
  --success-bg: #E4F6EE;
  --warning: #B8791A;
  --warning-bg: #FBF1DF;
  --error: #C7443D;
  --error-bg: #FBEAEA;
  --info: #2B6CB0;
  --info-bg: #E8F0FA;

  /* Border Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(16, 26, 24, 0.04), 0 1px 1px rgba(16, 26, 24, 0.02);
  --shadow-md: 0 4px 16px rgba(16, 26, 24, 0.05), 0 2px 4px rgba(16, 26, 24, 0.02);
  --shadow-lg: 0 16px 36px rgba(16, 26, 24, 0.08), 0 4px 12px rgba(16, 26, 24, 0.04);
}

.dark {
  /* Color Tokens - Dark Theme */
  --bg: #0A0F0E;
  --surface: #101B19;
  --surface-elevated: #162623;
  --border: #1B2E2A;
  --border-strong: #27423D;
  --text-primary: #F0F6F4;
  --text-secondary: #AEC2BC;
  --text-muted: #6F857F;
  --primary-tint: #14354B;
  --accent-tint: #35261F;
  --secondary: #248A49;
  --secondary-hover: #2EAD5C;
  
  /* Status Color Tokens - Dark Theme */
  --success: #2CD192;
  --success-bg: #113628;
  --warning: #DF9B34;
  --warning-bg: #3F2C10;
  --error: #E55C55;
  --error-bg: #3E1B1B;
  --info: #4C97E2;
  --info-bg: #14283A;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   RESET & SYSTEM WRAPPERS
   ========================================================================== */

* {
  box-sizing: border-box;
  outline-color: var(--primary);
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color 0.25s ease, border-color 0.25s ease;
  overflow-x: hidden;
}

/* Font Classes */
.font-display {
  font-family: 'Fraunces', Georgia, serif;
}

.font-mono {
  font-family: 'IBM Plex Mono', Courier, monospace;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* ==========================================================================
   COMPONENT SPECIFIC OVERRIDES
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  text-align: center;
  vertical-align: middle;
  border: 1px solid transparent;
  padding: 12px 20px;
  font-size: 14px;
  border-radius: var(--radius-md);
  transition: all 0.15s ease-in-out;
  cursor: pointer;
}

.btn-primary {
  color: #fff !important;
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
}

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

.btn-ghost {
  background-color: transparent !important;
  border-color: var(--border-strong) !important;
  color: var(--text-secondary) !important;
}

.btn-ghost:hover {
  background-color: var(--primary-tint) !important;
  color: var(--primary) !important;
}

.btn-primary-glow {
  box-shadow: 0 0 0 0px rgba(14, 110, 94, 0.2);
  transition: box-shadow 0.2s ease-in-out;
}

.btn-primary-glow:focus {
  box-shadow: 0 0 0 4px rgba(14, 110, 94, 0.25);
}

/* Form controls */
.label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  background: var(--surface);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3.5px var(--primary-tint);
}
select.input {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234B5B57' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px;
}

.dark select.input {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23AEC2BC' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

/* Animations */
.animate-fade-in {
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-slide-up {
  animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-pulse-ring {
  animation: pulseRing 1.8s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--border-strong) 37%, var(--border) 63%);
  background-size: 400% 100%;
  animation: skeletonLoad 1.4s ease infinite;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseRing {
  0% { transform: scale(0.95); opacity: 0.8; box-shadow: 0 0 0 0 rgba(31, 157, 108, 0.4); }
  70% { transform: scale(1); opacity: 0.5; box-shadow: 0 0 0 8px rgba(31, 157, 108, 0); }
  100% { transform: scale(0.95); opacity: 0.8; box-shadow: 0 0 0 0 rgba(31, 157, 108, 0); }
}

@keyframes skeletonLoad {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ==========================================================================
   RESPONSIVE PORTAL LAYOUT STYLES (FULL-SCREEN DECK & MOBILE NAV)
   ========================================================================== */

body {
  background: var(--bg);
  min-height: 100vh;
  box-sizing: border-box;
}

#demo-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.portal-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background: var(--bg);
}

.portal-sidebar {
  width: 260px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  flex-shrink: 0;
  z-index: 10;
}

.portal-main {
  flex: 1;
  padding: 32px 40px;
  background: var(--bg);
  overflow-y: auto;
}

/* Sidebar navigation links */
.sidebar-link {
  display: block;
  width: 100%;
  padding: 10px 14px;
  text-align: left;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.15s ease;
  margin-bottom: 4px;
}

.sidebar-link:hover {
  background: var(--primary-tint);
  color: var(--primary);
}

.sidebar-link.active {
  background: var(--primary);
  color: #fff !important;
}

/* Bottom navigation (mobile only) */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: none;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.04);
}

.bn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  background: transparent;
  border: none;
  cursor: pointer;
}

.bn-item.active {
  color: var(--primary);
}

.bn-item-home {
  width: 50px;
  height: 50px;
  margin-top: -24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 16px rgba(14, 110, 94, 0.35);
  color: #fff;
  border: none;
  cursor: pointer;
}

/* Step Dots */
.step-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}
.step-dot.current {
  background: var(--primary);
  color: #fff;
}
.step-dot.done {
  background: var(--success);
  color: #fff;
}

/* Responsive Overrides */
@media (max-width: 767px) {
  .portal-sidebar {
    display: none !important;
  }
  .portal-main {
    padding: 20px 16px 84px; /* extra bottom padding for navbar space */
  }
  .bottom-nav {
    display: flex;
  }
}

/* Telemedicine call layouts */
.video-screen-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  height: calc(100vh - 44px);
}

@media (max-width: 1023px) {
  .video-screen-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1.2fr;
  }
}

/* Visibility Helper Classes */
@media (max-width: 767px) {
  .desktop-only {
    display: none !important;
  }
}
@media (min-width: 768px) {
  .mobile-only {
    display: none !important;
  }
}


