/* =============================
   Base Layout & Global Styles
============================= */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Segoe UI', sans-serif;
    background: url("/companion/bg.png") no-repeat center center fixed;
  background-size: cover;
}



.page-wrapper {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0;
  box-sizing: border-box;
  position: relative; /* ensures .exit-button stays within bounds */
}

/* =============================
   Header (Clean Left-Aligned)
============================= */
header {
  background-color: #1f2937;
  color: white;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  justify-content: flex-start; /* left-align */
  gap: 12px;
}

header img {
  width: 64px;
  height: 64px;
}

header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: normal;
}


/* =============================
   Tab Navigation
============================= */
.tab-container {
  width: 100%;
  overflow: hidden;
  background-color: #f8f8f8;
}

.tab-links {
  display: flex;
  overflow-x: auto;
  white-space: nowrap;
  border-bottom: 2px solid #ccc;
  -webkit-overflow-scrolling: touch;
}

.tab-button {
  flex-shrink: 0;
  padding: 20px 16px;
  border: none;
  background-color: #f1f1f1;
  cursor: pointer;
  transition: background-color 0.3s ease;
  border-left: 1px solid #ddd;
}

.tab-button:first-child {
  border-left: none;
}

.tab-button.active {
  background-color: #e0e0e0;
  border-bottom: 2px solid #73862F;
  font-weight: 600;
}

/* =============================
   Tab Content Container
============================= */
.tab-content-container {
  background-color: #ffffff;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  padding: 15px;
  margin: 0;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.scrollable-tab-content {
  height: calc(99dvh - 160px);
  background: #fff !important;   /* Force background white */
  overflow-y: auto;
  padding-bottom: 40px;
}

/* =============================
   Dashboard Tab
============================= */
.dashboard-wrapper {
  background-color: #fff;
  margin: 16px;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.dash-heading {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 10px;
  color: #333;
}

.clean-summary p {
  margin: 6px 0;
  font-size: 15px;
  color: #444;
}

.breakdown-text {
  font-size: 14px;
  color: #777;
  margin: 10px 0;
  text-align: center;
}

/* =============================
   Badge Display
============================= */
.badge-label {
  font-size: 14px;
  font-weight: 500;
  margin-top: 20px;
  margin-bottom: 8px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.badge {
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  background-color: #999;
  user-select: none;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.badge[data-days="30"] { background-color: #f39c12; }
.badge[data-days="60"] { background-color: #3498db; }
.badge[data-days="90"] { background-color: #27ae60; }
.badge[data-days="365"] { background-color: #e74c3c; }
.badge[data-days="1825"] { background-color: #8e44ad; }
.badge[data-days="3650"] { background-color: #34495e; }
.badge[data-days="7300"] { background-color: #b7950b; }

.badge[title] {
  cursor: help;
}

/* =============================
   Events Tab
============================= */
.events-wrapper {
  background-color: #fff;
  margin: 16px;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.events-wrapper h2 {
  font-size: 22px;
  font-weight: 600;
  color: #333;
  margin-bottom: 20px;
}

.event-card {
  background-color: #f9f9f9;
  padding: 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  border-left: 4px solid #73862F;
}

.event-card h3,
.event-card p,
.event-card .event-meta,
.event-card .event-description {
  font-size: 14px;
  margin: 4px 0;
  color: #444;
}

.event-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: #1f2937;
}

/* =============================
   Preferences Tab
============================= */
.preferences-wrapper {
  background-color: #fff;
  margin: 16px;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.preferences-wrapper h2 {
  font-size: 22px;
  font-weight: 600;
  color: #333;
  margin-bottom: 20px;
}

.preferences-wrapper label {
  display: block;
  margin: 12px 0 4px;
  font-size: 14px;
  color: #444;
  font-weight: 500;
}

.preferences-wrapper input,
.preferences-wrapper select {
  width: 100%;
  padding: 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
  background-color: #fafafa;
}

.preferences-wrapper select[multiple] {
  height: auto;
  min-height: 100px;
}

.preferences-wrapper input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
  vertical-align: middle;
}

.pin-settings {
  margin-top: 16px;
  background-color: #f9f9f9;
  padding: 12px;
  border-radius: 8px;
  border: 1px dashed #ccc;
}

.preferences-wrapper button {
  margin-top: 20px;
  padding: 10px 16px;
  font-size: 15px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background-color: #73862F;
  color: #fff;
  transition: background-color 0.3s ease;
}

.preferences-wrapper button:hover {
  background-color: #0056b3;
}

.pref-button {
  background-color: #2563eb;
  color: white;
  padding: 10px 18px;
  font-size: 16px;
  border-radius: 8px;
  margin-top: 10px;
  cursor: pointer;
}

.pref-button:hover {
  background-color: #1d4ed8;
}

#erasePrefs {
  background-color: #e74c3c;
  margin-left: 10px;
}

#erasePrefs:hover {
  background-color: #c0392b;
}

.empty-preferences {
  text-align: center;
  margin: 30px auto;
  padding: 20px;
}

/* NFC Permissions Block */
.nfc-permission-block {
  background-color: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  color: #333;
  max-width: 600px;
  margin: 20px auto;
  text-align: left;
}

.nfc-permission-block h3 {
  font-size: 22px;
  margin-bottom: 12px;
  color: #222;
}

.nfc-permission-block p,
.nfc-permission-block li {
  font-size: 15px;
  margin: 10px 0;
  line-height: 1.5;
}

.nfc-permission-block h4 {
  font-size: 16px;
  margin: 20px 0 10px;
  color: #73862F;
}

.nfc-permission-block ol {
  padding-left: 20px;
  margin-bottom: 20px;
}

.nfc-permission-block button {
  padding: 10px 20px;
  font-size: 15px;
  background-color: #73862F;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.nfc-permission-block button:hover {
  background-color: #0056b3;
}

.theme-button {
  padding: 10px 16px;
  font-size: 14px;
  background-color: #73862F;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.theme-button:hover {
  background-color: #374151;
}

/* =============================
   Checkin Tab
============================= */

/* Check-In card container (copy of .dashboard-wrapper) */
.checkin-wrapper {
  background-color: #fff;
  margin: 16px;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* Check-In heading (copy of .dash-heading, separate class) */
.checkin-heading {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 10px;
  color: #333;
}

/* Optional: shared body text for the check-in card */
.checkin-wrapper p {
  margin: 6px 0;
  font-size: 15px;
  color: #444;
}


/* =============================
   Meetings Tab
============================= */
.meetings-wrapper {
  background-color: #fff;
  margin: 16px;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.meetings-wrapper h2 {
  font-size: 22px;
  font-weight: 600;
  color: #333;
  margin-bottom: 20px;
}

.meeting-card {
  background-color: #f9f9f9;
  padding: 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  border-left: 4px solid #73862F;
}

.meeting-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: #1f2937;
}

.meeting-card p {
  font-size: 14px;
  color: #444;
  margin: 4px 0;
}

.meeting-card .drive-button {
  display: block;
  margin-top: 18px;
  padding: 12px 16px;
  background-color: #28a745;
  color: white;
  font-weight: 600;
  font-size: 14px;
  border-radius: 8px;
  text-decoration: none;
  width: 100px;
  
}


.meeting-card .drive-button:hover {
  background-color: #1e7e34;
}

/* =============================
   Phone List Tab
============================= */
.phone-card {
  background-color: #f0f8ff;
  border-left: 4px solid #28a745;
  padding: 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.phone-card p {
  font-size: 14px;
  color: #333;
}

.phone-card a {
  color: #73862F;
  text-decoration: none;
}

.phone-card a:hover {
  text-decoration: underline;
}

.phone-actions {
  margin-top: 16px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.phone-actions button {
  padding: 10px 16px;
  font-size: 14px;
  background-color: #73862F;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.phone-actions button:hover {
  background-color: #0056b3;
}

#clearPhoneList {
  background-color: #e74c3c;
}

#clearPhoneList:hover {
  background-color: #c0392b;
}

/* =============================
   About Tab
============================= */
.about-wrapper {
  padding: 20px;
  line-height: 1.6;
  color: #333;
}

.about-wrapper h2,
.about-wrapper h3 {
  color: #1f2937;
  margin-top: 0;
}

.about-wrapper p {
  margin-bottom: 1em;
}

.about-wrapper blockquote {
  border-left: 4px solid #1f2937;
  padding-left: 15px;
  font-style: italic;
  color: #555;
  margin: 1em 0;
}

.about-wrapper a {
  color: #1f2937;
  text-decoration: underline;
}

.about-wrapper a:hover {
  text-decoration: none;
}

/* =============================
   Exit Button (PWA Only)
============================= */
.exit-button {
  position: fixed;
  top: 16px;
  right: 16px;
  background-color: #f3f4f6; /* soft gray */
  color: #1f2937;
  border: none;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  z-index: 999;
  transition: background-color 0.3s ease;
}

.exit-button:hover {
  background-color: #e5e7eb;
}


.exit-button:hover {
  background-color: #1d4ed8;
}


.exit-button:hover {
  background-color: #d1d5db;
}



.app-header {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: #1f2937;
  color: white;
  padding: 15px 20px;
}

.app-header img {
  width: 64px;
  height: 64px;
  
}

.app-header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: normal;
  
}


.header-left,
.header-center,
.header-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* On small screens, allow wrapping */
@media (max-width: 480px) {
  .app-header {
    flex-direction: column;
    gap: 10px;
  }
  
  .app-header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: normal;
  margin-bottom: 10px;
  
}

  .header-left, .header-center, .header-right {
    justify-content: center;
    width: 100%;
  }

  .exit-button {
    margin-top: 5px;
  }
}


html, body {
  height: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden; /* No page scroll! */
}

.page-wrapper {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: url("/table/bg.png") no-repeat center center fixed;
  background-size: cover;
}

/* Make .tab-container fill space under header */
.tab-container {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden; /* Crucial: hide overflow, push scrolling down */
}



/* Content container always fills the rest */
.tab-content-container {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* This prevents jumps */
  padding: 0;
  margin: 0;
}

/* The ONLY scrollable area! */
#tab-content-area, .scrollable-tab-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  /* Don't set hard height! Let flex handle it */
  padding: 0;
}


/* Make any image inside #ShowBirthday fill its container */
#ShowBirthday img {
  width: 100%;
  height: auto;
  display: block;
}

/* Welcome banner on Dashboard */
.welcome-banner {
  background-color: #f0f9ff;       /* light blue accent */
  border: 1px solid #a5d8ff;       /* slightly darker border */
  border-radius: 8px;              /* soft corners */
  padding: 16px 24px;              /* room to breathe */
  margin: 20px auto;               /* space above/below, centered */
  max-width: 600px;                /* don’t stretch too wide */
  color: #1e3a8a;                  /* deep blue text */
  font-size: 1.125rem;             /* slightly larger text */
  line-height: 1.5;                /* good readability */
  text-align: center;              /* center the message */
  box-shadow: 0 2px 8px rgba(0,0,0,0.08); /* subtle depth */
}



/* Style for the daily quote container */
#dailyQuote {
  position: relative;
  display: inline-block;
  font-style: italic;
  font-size: 1.2rem;
  line-height: 1.4;
  max-width: 600px; /* optional for wrapping nicely */
  color: #333; /* adjust for your theme */
}

/* Add opening and closing quotes using pseudo-elements */
#dailyQuote::before {
  content: open-quote;
  font-size: 1.6rem;
  vertical-align: top;
  margin-right: 0.1em;
  color: #888; /* softer than text */
}

#dailyQuote::after {
  content: close-quote;
  font-size: 1.6rem;
  vertical-align: bottom;
  margin-left: 0.1em;
  color: #888;
}

/* its wrapper around #dailyQuote */
.quote-card {
  text-align: center;
}



header { position: relative; z-index: 2; }
header::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;   /* overlap the seam */
  height: 14px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,0.35), rgba(0,0,0,0));
}
.tab-container { position: relative; z-index: 1; }


/* Soft shadow only on the bottom edge */
header {
  position: relative;           /* anchor for z-index */
  z-index: 2;                   /* sit above tabs so shadow shows */
  box-shadow: 0 6px 12px -8px rgba(0,0,0,0.45); /* bottom-only feel */
}
.tab-container { z-index: 1; position: relative; } /* ensure it's under the header */


.tab-links { border-bottom-color: #d7d7d7; }







/* =============================
   EASTER-EGG DASH THEME (Dashboard only)
   Paste at END of your CSS. Replaces old body[data-egg="1"] rules.
============================= */

/* Card + base text */
body[data-egg="1"] .dashboard-wrapper {
  background: linear-gradient(180deg, #0f1020, #151735);
  color: #e9ecff;
  border-radius: 14px;
  border: 1px solid #2a2e6a;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.04);
}

/* Headline */
body[data-egg="1"] .dashboard-wrapper .dash-heading {
  color: #ff5fa2;
  text-shadow: 0 1px 0 rgba(0,0,0,0.4);
}

/* Sub / meta text */
body[data-egg="1"] .dashboard-wrapper .clean-summary p,
body[data-egg="1"] .dashboard-wrapper .breakdown-text {
  color: #b9c0ff;
}

/* Rules */
body[data-egg="1"] .dashboard-wrapper hr {
  border: 0;
  height: 1px;
  margin: 14px 0;
  background: linear-gradient(90deg, rgba(0,0,0,0), #ff5fa2 35%, #6ab3ff 65%, rgba(0,0,0,0));
  opacity: 1;
}

/* Badges */
body[data-egg="1"] .dashboard-wrapper .badge-row { gap: 12px; }
body[data-egg="1"] .dashboard-wrapper .badge {
  background: transparent;
  border: 1px solid rgba(233,236,255,0.35);
  color: #e9ecff;
  box-shadow: none;
  letter-spacing: .2px;
}

/* Optional: custom colors per milestone in egg theme */
body[data-egg="1"] .dashboard-wrapper .badge[data-days="30"]  { background:#3f2a00; border-color:#ffb84d; color:#ffb84d; }
body[data-egg="1"] .dashboard-wrapper .badge[data-days="60"]  { background:#082033; border-color:#6ab3ff; color:#6ab3ff; }
body[data-egg="1"] .dashboard-wrapper .badge[data-days="90"]  { background:#042a1d; border-color:#49d69e; color:#49d69e; }
body[data-egg="1"] .dashboard-wrapper .badge[data-days="365"] { background:#2b0e12; border-color:#ff6b6b; color:#ff6b6b; }
body[data-egg="1"] .dashboard-wrapper .badge[data-days="1825"]{ background:#230c37; border-color:#c082ff; color:#c082ff; }
body[data-egg="1"] .dashboard-wrapper .badge[data-days="3650"]{ background:#0d1a26; border-color:#7aa6c7; color:#7aa6c7; }
body[data-egg="1"] .dashboard-wrapper .badge[data-days="7300"]{ background:#2a2205; border-color:#e5c15a; color:#e5c15a; }

/* Daily quote */
body[data-egg="1"] .dashboard-wrapper #dailyQuote {
  color: #e9ecff;
  quotes: "“" "”" "‘" "’";
}
body[data-egg="1"] .dashboard-wrapper #dailyQuote::before,
body[data-egg="1"] .dashboard-wrapper #dailyQuote::after {
  color: #ff5fa2;
}

/* Buttons inside the dashboard card */
body[data-egg="1"] .dashboard-wrapper .theme-button {
  background: #ff5fa2;
  color: #0f1020;
  border: 1px solid #ff95c0;
}
body[data-egg="1"] .dashboard-wrapper .theme-button:hover {
  background: #ffa4cb;
}

/* Meeting today panel (if present) */
body[data-egg="1"] .dashboard-wrapper #meetingTodaySection {
  background: rgba(255, 255, 255, 0.06) !important;
  border-radius: 10px;
  color: #e9ecff;
}

/* Birthday banner image looks cleaner with a subtle frame */
body[data-egg="1"] .dashboard-wrapper #ShowBirthday img {
  border-radius: 10px;
  outline: 1px solid rgba(233,236,255,0.2);
}

/* Make sure normal page chrome doesn't get recolored unintentionally */
body[data-egg="1"] .dash-heading { color: inherit; } /* neutralize any global egg rule */
