/* ✅ RESET & BASE */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body, html {
  font-family: 'Segoe UI', sans-serif;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

/* ✅ GENERAL STYLING */
input, select, textarea, button {
  font-size: 15px;
}
input, select, textarea {
  width: 100%;
  padding: 10px;
  margin-bottom: 20px;
  border-radius: 5px;
  border: 1px solid #ccc;
}
input:focus {
  outline: none;
  border-color: #0b7d77;
}

/* ✅ BUTTONS */
.btn {
  background-color: #0b7d77;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
}
.btn:hover {
  background-color: #095f5a;
}

/* ✅ ADMIN ACTION BUTTONS */
button.promote-btn {
  background-color: #28a745;
  color: white;
  padding: 6px 12px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}
button.promote-btn:hover {
  background-color: #218838;
}
button.delete-btn {
  background-color: #dc3545;
  color: white;
  padding: 6px 12px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}
button.delete-btn:hover {
  background-color: #c82333;
}

/* ✅ DARK MODE SUPPORT */
.dark {
  background-color: #1a1a1a;
  color: white;
}
.dark .floating-box,
.dark .home-container {
  background-color: #2c2c2c;
}
.dark input, .dark select, .dark textarea {
  background-color: #333;
  color: white;
  border-color: #555;
}
.dark .sidebar-fixed {
  background-color: #202020;
}
.dark .background-strip {
  background-color: #111;
}

/* ✅ HOME PAGE */
.home-body {
  background: linear-gradient(to right, #e6f0f0, #cce5e5);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}
.home-container {
  background-color: white;
  padding: 40px;
  border-radius: 15px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  max-width: 400px;
  width: 90%;
  text-align: center;
}
.home-container p.tagline {
  font-size: 16px;
  margin-bottom: 15px;
}

.home-buttons .btn {
  margin: 20px;
}
.highlight {
  color: #0b7d77;
}

/* ✅ DASHBOARD LAYOUT */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
}

/* ✅ FLOATING BOX */
.floating-box {
  background-color: white;
  padding: 50px;
  border-radius: 20px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

/* ✅ INFO GRID */
.info-grid {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 15px 20px;
  margin-top: 30px;
}
.info-label {
  font-weight: bold;
}
.info-value {
  word-break: break-word;
}

/* ✅ CHAT WINDOW */
.chat-window {
  flex-grow: 1;
  overflow-y: auto;
  background-color: #f9f9f9;
  border: 1px solid #ccc;
  padding: 1rem;
  height: 250px;
  margin: 1rem 0;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
}
.chat-message {
  padding: 10px 14px;
  margin: 6px 0;
  border-radius: 10px;
  max-width: 75%;
  word-wrap: break-word;
}
.chat-message.you {
  align-self: flex-end;
  background-color: #dcf8c6;
  color: #222;
}
.chat-message.other {
  align-self: flex-start;
  background-color: #eee;
  color: #111;
}
.dark .chat-message.you {
  background-color: #0b7d77;
}
.dark .chat-message.other {
  background-color: #444;
  color: #eee;
}

/* ✅ CHAT FORM */
.chat-form {
  display: flex;
  gap: 10px;
}
.chat-form input {
  flex: 1;
}
.chat-form button {
  background-color: #0b7d77;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
}
.chat-form button:hover {
  background-color: #02726c;
}

/* ✅ RECORDS LIST */
.record-list {
  margin-top: 40px;
}
.record-list ul {
  list-style: none;
  padding-left: 0;
}
.record-list li {
  background: #e8f2f2;
  padding: 10px 15px;
  margin-bottom: 10px;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.record-list a {
  color: #0b7d77;
  font-weight: bold;
  text-decoration: none;
}
.dark .record-list li {
  background-color: #2c2c2c;
}
.dark .record-list a {
  color: #5fdde5;
}

/* ✅ ADMIN STATS */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  margin: 30px 0;
}
.stat-card {
  background: #f0f8f8;
  padding: 20px;
  border-radius: 10px;
  font-weight: bold;
  font-size: 16px;
  text-align: center;
  box-shadow: 0 0 6px rgba(0,0,0,0.1);
}
.dark .stat-card {
  background-color: #2a2a2a;
  color: #eee;
}

/* ✅ TABLES */
table {
  width: 100%;
  margin-top: 20px;
  border-collapse: collapse;
}
table th, table td {
  padding: 12px;
  border: 1px solid #ccc;
  text-align: left;
}
.dark table {
  color: #eee;
}
.dark table th, .dark table td {
  border-color: #444;
}

/* ✅ DARK MODE TOGGLE */
.dark-mode-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 110;
  background: #fff;
  color: #0b7d77;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: all 0.3s ease;
}

.dark-mode-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ✅ SIDEBAR STYLES */
.sidebar-fixed {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  max-width: 90vw;
  height: 100vh;
  background: #0b7d77;
  color: white;
  padding: 30px 20px;
  box-shadow: 2px 0 8px rgba(0,0,0,0.08);
  z-index: 100;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
  overflow-y: auto;
}
.sidebar-fixed.active {
  transform: translateX(0);
}
.sidebar-fixed h2 {
  margin-bottom: 30px;
}
.sidebar-fixed ul {
  list-style: none;
}
.sidebar-fixed ul li {
  margin-bottom: 15px;
}
.sidebar-fixed ul li a {
  color: white;
  text-decoration: none;
  font-weight: bold;
}
.sidebar-fixed ul li a:hover {
  text-decoration: underline;
}

/* ✅ SIDEBAR OVERLAY */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.4);
  z-index: 99;
  transition: opacity 0.3s;
}
.sidebar-overlay.active {
  display: block;
}

/* ✅ SIDEBAR TOGGLE BUTTON */
.sidebar-toggle {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 110;
  background: #0b7d77;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  cursor: pointer;
}

/* ✅ BACKGROUND STRIP */
.background-strip {
  width: 80px;
  background-color: #e1e8e8;
}

/* ✅ DASHBOARD CONTENT */
.dashboard-content {
  flex: 1;
  padding: 60px 30px;
  background-color: #f8f8f8;
  position: relative;
  overflow-x: hidden;
}

/* ✅ DESKTOP STYLES */
@media (min-width: 769px) {
  .sidebar-fixed {
    position: static;
    width: 220px;
    max-width: none;
    height: auto;
    transform: none !important;
    box-shadow: none;
    background: #0b7d77;
    color: white;
  }
  .sidebar-overlay {
    display: none !important;
  }
  .sidebar-toggle {
    position: static;
    margin-bottom: 16px;
    box-shadow: none;
  }
  .dark-mode-toggle {
    position: absolute;
    top: 15px;
    right: 15px;
    width: auto;
    height: auto;
    border-radius: 0;
    background: none;
    color: inherit;
    box-shadow: none;
    font-size: 22px;
  }
}

/* ✅ MOBILE RESPONSIVENESS */
@media screen and (max-width: 768px) {
  .dashboard-layout {
    flex-direction: column;
  }
  .background-strip {
    display: none;
  }
  .dashboard-content {
    padding: 20px;
  }
  .floating-box {
    padding: 20px;
  }
  .info-grid {
    grid-template-columns: 1fr;
  }
  .chat-form {
    flex-direction: column;
  }
  .chat-form button {
    width: 100%;
  }
  table th, table td {
    font-size: 14px;
    padding: 8px;
  }
  .admin-stats {
    grid-template-columns: 1fr;
  }
}

/* ✅ LANDING PAGE STYLES */
body.home-body {
  background: #fff;
  color: #0b7d77;
  font-family: 'Segoe UI', Arial, sans-serif;
  margin: 0;
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

.dark-mode {
  background: #0b7d77;
  color: #fff;
}

.dark-mode .hero-section,
.dark-mode .features-grid {
  background: #0b7d77;
  color: #fff;
}

.hero-section {
  max-width: 600px;
  margin: 2em auto 1em auto;
  text-align: center;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(11,125,119,0.08);
  padding: 2em 1.5em 1.5em 1.5em;
  transition: background 0.3s, color 0.3s;
  width: 90%;
}

.hero-section h1 {
  font-size: 2.3em;
  margin-bottom: 0.5em;
  color: #0b7d77;
  font-weight: bold;
}

.hero-desc {
  font-size: 1.1em;
  margin-bottom: 2em;
  color: #0b7d77;
}

.home-buttons {
  margin-top: 1.5em;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5em;
  max-width: 900px;
  margin: 2em auto 1em auto;
  padding: 0 1em;
  width: 100%;
}

.feature-box {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 18px rgba(11,125,119,0.10);
  padding: 2em 1.2em 1.5em 1.2em;
  text-align: center;
  color: #0b7d77;
  font-size: 1.08em;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s cubic-bezier(.23,1.01,.32,1), transform 0.7s cubic-bezier(.23,1.01,.32,1);
}

.feature-box .feature-icon {
  font-size: 2.2em;
  margin-bottom: 0.5em;
}

.feature-box .feature-title {
  font-weight: 600;
  font-size: 1.08em;
}

.feature-box.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(.23,1.01,.32,1), transform 0.8s cubic-bezier(.23,1.01,.32,1);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Desktop styles for landing page */
@media (min-width: 1024px) {
  .hero-section {
    max-width: 800px;
    padding: 3em 2.5em 2.5em 2.5em;
    margin: 3em auto 2em auto;
  }
  .hero-section h1 {
    font-size: 3em;
  }
  .hero-desc {
    font-size: 1.3em;
    line-height: 1.6;
  }
  .features-grid {
    max-width: 1200px;
    grid-template-columns: repeat(3, 1fr);
    gap: 2em;
    padding: 0 2em;
  }
  .feature-box {
    padding: 2.5em 1.5em 2em 1.5em;
    font-size: 1.2em;
  }
  .feature-box .feature-icon {
    font-size: 2.8em;
  }
}

/* Tablet styles */
@media (min-width: 768px) and (max-width: 1023px) {
  .hero-section {
    max-width: 700px;
    padding: 2.5em 2em 2em 2em;
  }
  .hero-section h1 {
    font-size: 2.5em;
  }
  .hero-desc {
    font-size: 1.2em;
  }
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.8em;
    padding: 0 1.5em;
  }
  .feature-box {
    padding: 2em 1.3em 1.5em 1.3em;
    font-size: 1.1em;
  }
}

/* Mobile styles */
@media (max-width: 767px) {
  .hero-section {
    padding: 1.5em 1em 1.2em 1em;
    margin: 1em auto;
    width: 95%;
    max-width: 500px;
  }
  .hero-section h1 {
    font-size: 2em;
  }
  .hero-desc {
    font-size: 1em;
  }
  .features-grid {
    gap: 1em;
    padding: 0 0.5em;
    grid-template-columns: 1fr;
  }
  .feature-box {
    padding: 1.2em 0.5em 1em 0.5em;
    font-size: 1em;
  }
}

/* Dark mode for feature boxes */
.dark .feature-box {
  background: black;
  color: #fff;
  box-shadow: 0 4px 18px rgba(0,0,0,0.13);
}

.dark .btn-alt {
  background: white;
  color: #0b7d77;
  border: 2px solid black;
}

.dark .btn {
  background: #0b7d77;
  color: white;
  border: 2px solid rgb(155, 147, 147);
}

.dark .hero-section {
  background-color: black;
}