/* ----------------------------------------------
   GLOBAL RESET & BASE
---------------------------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

html {
  min-height: 100%;
  background-color: var(--bg);
}

body {
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--text);
}


/* ----------------------------------------------
   THEME VARIABLES
---------------------------------------------- */
:root {
  --bg: #f5f5f5;
  --card-bg: #ffffff;
  --text: #222;
  --muted: #666;
  --border: #ddd;

  --accent: #0078d4;
  --accent-light: #e6f2ff;

  --success: #16a34a;
  --danger: #dc2626;

  --bubble-bg: #f0f7ff;
  --shadow: rgba(0,0,0,0.05);
}

body.dark {
  --bg: #111;
  --card-bg: #1a1a1a;
  --text: #eee;
  --muted: #aaa;
  --border: #333;

  --accent: #0ea5ff;
  --accent-light: #112233;

  --bubble-bg: #112233;
  --shadow: rgba(0,0,0,0.4);
}

/* ----------------------------------------------
   WRAP LAYOUT
---------------------------------------------- */
.wrap {
  max-width: 1200px;
  margin: auto;
  padding: 20px;
}

/* ----------------------------------------------
   HEADER
---------------------------------------------- */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 1000;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  background: var(--accent);
  width: 44px;
  height: 44px;
  border-radius: 10px;
  color: #fff;
  font-weight: 700;
  font-size: 22px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.subtitle {
  color: var(--muted);
  font-size: 14px;
  margin-top: 2px;
}

.row {
  display: flex;
  align-items: center;
}

.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ----------------------------------------------
   GRID LAYOUT
---------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.left-col {
  display: flex;
  flex-direction: column;
}

@media (min-width: 900px) {
  .grid {
    grid-template-columns: 2fr 1fr;
  }
}

/* ----------------------------------------------
   CARD COMPONENT
---------------------------------------------- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 2px 4px var(--shadow);
}

/* ----------------------------------------------
   TEXT HELPERS
---------------------------------------------- */
.section-title {
  font-size: 18px;
  font-weight: 700;
}

.small {
  font-size: 14px;
  color: var(--muted);
}

.tiny {
  font-size: 12px;
  color: var(--muted);
}

.user-display {
  font-size: 18px;
  font-weight: 700;
}

/* ----------------------------------------------
   BUTTONS (GLOBAL)
---------------------------------------------- */
button, .authBtn {
  padding: 10px 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 15px;
  transition: 0.2s ease;
}

button:hover, .authBtn:hover {
  opacity: 0.9;
}

.loginBtn {
  width: 100%;
  border-radius: 8px;
  padding: 12px;
}

.ghost {
  background: #eee;
  color: #111;
  border: 1px solid #ddd;
}

.ghost:hover {
  background: #e0e0e0;
}

/* Auth buttons */
.authBtn {
  padding: 10px;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
}

.authBtn.google {
  border-left: 4px solid #4285f4;
}

.authBtn.anon {
  border-left: 4px solid #888;
}

/* ----------------------------------------------
   INPUTS & SELECTS
---------------------------------------------- */
input, select {
  width: 100%;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  font-size: 14px;
}

.country-select {
  width: 100%;
  margin-bottom: 6px;
}

/* ----------------------------------------------
   BUBBLES
---------------------------------------------- */
.bubble {
  background: var(--bubble-bg);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--accent-light);
  font-size: 15px;
  line-height: 1.4;
}

/* ----------------------------------------------
   CONTROLS
---------------------------------------------- */
.controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ----------------------------------------------
   TABLE (Session Log)
---------------------------------------------- */
table {
  width: 100%;
  margin-top: 12px;
  border-collapse: collapse;
}

table th {
  text-align: left;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

table td {
  padding: 8px 4px;
  font-size: 14px;
  border-bottom: 1px solid #ececec;
}

table tr:last-child td {
  border-bottom: none;
}

/* ----------------------------------------------
   HIDDEN CLASS
---------------------------------------------- */
.hidden {
  display: none !important;
}

/* ----------------------------------------------
   GUEST TIMER FLOATING BANNER
---------------------------------------------- */
/* ----------------------------------------------
   ACCESS / BILLING CARD
---------------------------------------------- */
.access-card {
  max-width: 320px;
  margin-bottom: 16px;
  text-align: center;
}

.access-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.access-title {
  font-size: 14px;
  color: var(--muted);
}

.access-badge {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 12px;
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}

.access-badge.paid {
  background: #d1fae5;
  color: #065f46;
}

.access-timer {
  font-size: 36px;
  font-weight: 700;
  margin: 12px 0;
  letter-spacing: 1px;
}

.access-buy {
  width: 100%;
  margin-top: 6px;
}


/* ----------------------------------------------
   AUTH PAGE
---------------------------------------------- */
.auth-container {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  /* min-height: calc(100vh - 80px);*/
}

.auth-card {
  width: 100%;
  max-width: 400px;
}

/* ----------------------------------------------
   RESPONSIVE
---------------------------------------------- */
@media (max-width: 600px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .controls {
    flex-direction: column;
  }

  button, .authBtn {
    width: 100%;
  }
}

/* Two-column layout for dashboard */
.grid-2col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.grid-2col .col {
  display: flex;
  flex-direction: column;
}

/* On wider screens → two columns */
@media (min-width: 900px) {
  .grid-2col {
    grid-template-columns: 1fr 1fr;
  }
}

.card .row-between button {
  padding: 6px 12px;
}

/* Scrollable table container */
.table-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* Prevent table from shrinking */
.table-scroll table {
  min-width: 800px;  /* ensures scroll appears if columns overflow */
  width: 100%;
  border-collapse: collapse;
}

/* Improve scroll smoothness */
.table-scroll::-webkit-scrollbar {
  height: 8px;
}

.table-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.table-scroll::-webkit-scrollbar-track {
  background: transparent;
}

/* Sticky table header */
.table-scroll thead th {
  position: sticky;
  top: 0;
  background: var(--card-bg);
  z-index: 2;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Make header row visually distinct */
.table-scroll thead th {
  font-weight: 600;
  padding: 10px 6px;
  border-bottom: 1px solid var(--border);
}

.table-scroll tbody tr:hover {
  background: rgba(0,0,0,0.04);
}

body.dark .table-scroll tbody tr:hover {
  background: rgba(255,255,255,0.06);
}

.howto-list {
  margin-top: 10px;
  padding-left: 18px;
}

.howto-list li {
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 1.4;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal.hidden {
  display: none;
}

.modal-card {
  background: var(--card-bg);
  color: var(--text);
  padding: 20px;
  border-radius: 12px;
  width: 320px;
  text-align: center;
}

.lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}

.lang-tile {
  padding: 10px 8px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.08);
  background: var(--card-bg, #f9fafb);
  text-align: center;
  font-size: 13px;
  font-weight: 500;
}

body.dark .lang-tile {
  border-color: rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
}

