:root {
  /* Light Theme (Warm Grey/Beige) */
  --bg-color: #e8e6e1;
  --surface-color: #fdfbf7;
  --text-color: #2d2d2d;
  --text-light: #5f5f5f;
  --border-color: #dcdad5;
  --hover-color: #f0eeea;
  --primary-color: #2cb0f2;
  --input-bg: #fdfbf7;
  --input-border: #ccc;
  --danger-color: #f44336;
}

[data-theme="dark"] {
  /* Dark Theme */
  --bg-color: #1a1a1a;
  --surface-color: #2d2d2d;
  --text-color: #eee;
  --text-light: #aaa;
  --border-color: #444;
  --hover-color: #363636;
  --primary-color: #4fc3f7;
  --input-bg: #333;
  --input-border: #555;
}

body {
  font-family: Tahoma, Verdana, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  padding: 0;
  transition: background 0.2s, color 0.2s;
  min-height: 100vh;
}

/* --- Layout --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* --- Navbar --- */
.navbar {
  background-color: var(--surface-color);
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary-color) !important;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 15px;
}

.nav-item {
  cursor: pointer;
  color: var(--text-light);
}

/* --- Mobile Menu --- */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-color);
  z-index: 101;
  /* Above mobile menu overlay */
}

@media (max-width: 960px) {
  .hero-media {
    width: 96vw;
  }
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    width: 80%;
    min-width: 350px;
    max-width: 100vw;
    /* Prevent overflow on really tiny screens if min-width > viewport, though min-width usually wins. */
    height: 100vh;
    background: var(--surface-color);
    flex-direction: column;
    align-items: flex-start;
    padding: 80px 20px 20px 20px;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);

    /* Use transform for hiding/showing to handle fixed widths correctly */
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    z-index: 100;
  }

  .nav-links.open {
    transform: translateX(0);
  }

  /* Adjust gap and styles for mobile items */
  .nav-links .nav-item,
  .nav-links #userInfo {
    width: 100%;
    margin-bottom: 20px;
  }

  /* Force logout button to full width or nice placement */
  #logoutBtn {
    width: 100%;
    margin-top: 10px;
  }
}

.nav-item:hover {
  color: var(--text-color);
}

/* --- Auth Forms --- */
.auth-container {
  max-width: 400px;
  margin: 80px auto;
  background: var(--surface-color);
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-color);
  text-align: center;
}

input {
  width: 100%;
  padding: 12px;
  margin-bottom: 15px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text-color);
  border-radius: 6px;
  box-sizing: border-box;
}

/* --- Buttons --- */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.1s;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-google {
  background: #4285f4;
  color: white;
  margin-top: 10px;
  width: 100%;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 5px;
  border-radius: 4px;
}

.btn-icon:hover {
  background-color: var(--hover-color);
}

a {
  text-decoration: none;
  color: inherit;
}

a:visited {
  color: inherit;
}

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

/* --- Session Detail List --- */
.detail-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 15px;
  background: var(--surface-color);
  padding: 15px;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.1s;
}

.detail-item:first-child {
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.detail-item:last-child {
  border-bottom: none;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

.detail-item:hover {
  background-color: var(--hover-color);
}

.detail-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}

.detail-content {
  flex: 1;
  min-width: 0;
}

.detail-title {
  font-size: 1rem;
  color: var(--text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-url {
  font-size: 0.85rem;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-actions {
  display: flex;
  gap: 10px;
}

/* --- Search Group --- */
.search-group {
  display: flex;
  align-items: center;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.search-group:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(44, 176, 242, 0.2);
}

.search-group input {
  border: none;
  background: transparent;
  margin: 0;
  padding: 10px 15px;
  outline: none;
  width: 250px;
}

.search-group button {
  background: var(--primary-color);
  border: none;
  color: white;
  padding: 10px 15px;
  cursor: pointer;
  font-size: 1.1rem;
  /* Icon size */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.search-group button:hover {
  opacity: 0.9;
}

.error-msg {
  color: var(--danger-color);
  margin-bottom: 10px;
  font-size: 0.9rem;
}

/* --- Generic Modal --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  padding: 30px;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  transform: scale(0.95);
  transition: transform 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  text-align: center;
}

.modal-overlay.open .modal-container {
  transform: scale(1);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-color);
}

.modal-body {
    margin: 20px 0;
    color: var(--text-light);
    line-height: 1.5;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: center;
}
