:root {
  --primary-blue: #005ae0;
  --blue-600: #004dc2;
  --blue-700: #0041a6;
  --text: #111111;
  --text-muted: #6b7280;
  --bg: #f5f7fb;
  --white: #ffffff;
  --border: #e5e7eb;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body {
  font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

.parallax-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

header {
  position: sticky;
  top: 0;
  z-index: 10;
}

main {
  flex: 1 1 auto;
  overflow: hidden;
}

footer {
  position: sticky;
  bottom: 0;
  z-index: 9;
}

.side-menu {
  position: fixed;
  left: -260px;
  top: 0;
  width: 260px;
  height: 100vh;
  background: #0b1220;
  color: var(--white);
  transition: left 0.3s ease;
  z-index: 1000;
  overflow-y: auto;
}

.side-menu.active {
  left: 0;
}

.menu-header {
  padding: 2px 16px 2px 2px;
  background: var(--primary-blue);
  color: var(--white);
  text-align: right;
}

.side-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.side-menu li {
  border-bottom: 1px solid #1f2937;
}

.side-menu a {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  color: var(--white);
  text-decoration: none;
}

.side-menu a:hover {
  background: #0f4ec2;
}

.side-menu .menu-label {
  margin-left: 10px;
}

.side-menu .has-submenu > .submenu {
  display: none;
  background: rgba(255,255,255,0.03);
}

.side-menu .has-submenu.open > .submenu {
  display: block;
}

.side-menu .submenu a {
  padding-left: 36px;
}

.menu-toggle {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 1100;
  width: 36px;
  height: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
}

.menu-toggle .bar {
  width: 20px;
  height: 2px;
  background: var(--text-color);
  margin: 2px 0;
}

.color-change { display: none; }

button {
  background: var(--primary-blue);
  color: var(--white);
  border: 1px solid transparent;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
}

button:hover { background: var(--blue-600); }

/* Log items */
.log-entry {
  display: flex;
  align-items: flex-start;
  padding: 10px;
  border-bottom: 1px solid var(--border);
  background: var(--white);
  border-radius: 6px;
}

.log-icon-container {
  width: 40px;
  height: 40px;
  margin-right: 12px;
  border-radius: 50%;
  overflow: hidden;
  background: #e5e7eb;
  flex-shrink: 0;
}

.log-icon { width: 100%; height: 100%; object-fit: cover; }

.log-header { display: flex; justify-content: space-between; margin-bottom: 4px; }
.log-type { font-weight: 600; color: var(--text); font-size: 14px; }
.log-time { color: var(--text-muted); font-size: 12px; }
.log-message { color: var(--text); word-wrap: break-word; }

/* Modal */
.settings-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1200;
}

/* Generic popup overlay (used by confirm dialogs, notifications, etc.) */
.popup {
  display: none; /* toggled to block by JS */
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1300; /* above side menu (1000) and header/footer */
}

.popup .popup-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--surface);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  border-radius: 8px;
  padding: 16px;
  width: 92%;
  max-width: 480px;
  max-height: 80vh;
  overflow: auto;
}

.popup #confirmTitle {
  text-align: center;
  margin: 2px 2px 16px 2px;
}

.popup #confirmMessage {
  margin: 10px 10px 24px 10px;
}

.popup .confirm-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

/* Time adjust dialog aligns with popup theme */
#timeAdjustDialog .popup-content label {
  color: var(--text-color);
}
#timeAdjustDialog .popup-content input[type="number"] {
  background: var(--surface);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 6px 8px;
}

/* Ensure headings inside popup follow theme text color (not global header color) */
.popup .popup-content h1,
.popup .popup-content h2,
.popup .popup-content h3,
.popup .popup-content h4,
.popup .popup-content h5 {
  color: var(--text-color);
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  width: 92%;
  max-width: 560px;
  max-height: 80vh;
  overflow: auto;
}

.close-modal { position: absolute; right: 12px; top: 8px; cursor: pointer; font-size: 22px; }
.modal-title { margin: 0 0 12px 0; text-align: center; color: var(--text); }
.settings-grid { display: grid; gap: 10px; }
.setting-item { display: flex; align-items: center; justify-content: space-between; padding: 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; }

.avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.item-details { flex: 1; min-width: 0; }
.item-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-number-member { color: var(--text-muted); font-size: 13px; }

/* Global scrollbars - thin and rounded */
* { scrollbar-width: thin; scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track); }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 9999px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }
*::-webkit-scrollbar-track { background: var(--scrollbar-track); border-radius: 9999px; }
