html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #fafafa;
  color: #333;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  transition: background 0.3s ease, color 0.3s ease;
}

h1 {
  text-align: center;
}

textarea {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.topbar {
  background: rgb(233, 233, 233);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  height: 10%;
  box-sizing: border-box;
  transition: background 0.3s ease;
}

.lefttopbar {
  width: 50%;
  display: flex;
  flex-direction: row;
  align-items: center;
}

.righttopbar {
  width: 50%;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.burger-btn {
  background: none;
  height: fit-content;
  border: none;
  font-size: 25px;
  cursor: pointer;
  color: #333;
  transition: background 0.2s ease;
  border-radius: 10px;
}

.logoname{
  font-size: 25px;
  font-weight: 600;
  cursor: default;
  user-select: none;
  margin-left: 10px;
  display: flex;
  flex-direction: row;
  align-items: center;
}

.beta{
   font-size: 15px;
   margin-left: 5%;
   margin-top: 10%;
   font-weight: 600;
   background: rgb(190, 190, 190);
   padding: 2px 5px 3px 5px;
   border-radius: 10px;
}

.burger-btn:hover {
  background: rgba(128, 128, 128, 0.268);
}

.content-wrapper {
  display: flex;
  height: calc(100vh - 10%);
}

/* Sidebar */
.sidebar {
  width: 250px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.242);
  background: #fafafa;
  border-right: 2px solid #b5b5b5;
  padding: 20px;
  height: 100%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  transition: width 0.3s ease, background 0.3s ease;
  font-size: 20px;
}

.sidebar a {
  display: flex;
  align-items: center;
  color: rgb(80, 80, 80);
  text-decoration: none;
  padding: 10px 0;
  transition: color 0.2s ease;
  padding-left: 5px;
  border-radius: 10px;
}

.sidebar a:hover {
  color: #000000;
}

.sidebar i {
  margin-right: 10px;
  width: 20px;
  text-align: center;
}

.sidebar.collapsed {
  width: 60px;
}

.sidebar.collapsed .sidebar-title,
.sidebar.collapsed .sidebar-text {
  display: none;
}

/* Main content */
.main-content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  box-sizing: border-box;
  transition: background 0.3s ease, color 0.3s ease;
}

#noteInput {
  width: 70%;
  margin: 20px auto 10px auto;
  border: solid 1.5px #b5b5b5;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.242);
  resize: none;
  overflow: hidden;
  padding: 15px;
  font-size: 18px;
  border-radius: 8px;
  display: block;
  background-color: white;
  transition: border 0.5s ease, box-shadow 0.5s ease;
}

#noteInput:focus{
  box-shadow: 0 0 10px rgba(0, 123, 255, 0.5);
  border: solid 1.5px rgba(0, 123, 255, 0.636);
  outline: none;
}

.savenotebtn {
  margin-top: 10px;
  width: 70%;
  border: none;
  color: white;
  font-size: 18px;
  padding: 15px;
  border-radius: 8px;
  cursor: pointer;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  justify-content: center;
    position: relative;
  background: rgb(0, 128, 255);
  overflow: hidden;
  z-index: 1;
}

.savenotebtn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #dd00ff 0%, #00eaff 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0; /* Overlay is below text */
}

.savenotebtn{
  z-index: 1;
}

.savenotebtn:hover::before {
  opacity: 1;
}

.savenotebtn > * {
  position: relative;
  z-index: 1; /* Text is above overlay */
}

.notes-container {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  gap: 15px;
  padding: 20px;
  justify-content: flex-start;
}

.note-content[contenteditable="true"] {
  border: none;
  outline: none;
}

.note {
  background-color: white;
  width: fit-content;
  border: 1px solid #5a5a5ac9;
  box-shadow:  0 2px 10px rgba(0, 0, 0, 0.242);
  border-radius: 6px;
  font-size: 16px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  min-width: 200px;
  transition: background 0.3s ease, color 0.3s ease, border 0.3s ease;
}

.note-date {
  color: #3a3a3ac0;
}

.note-group-heading {
  width: 100%;
  font-size: 17px;
  color: #555;
  margin-top: 20px;
}

.editBtn {
  color: #555555b1;
  border: none;
  background: none;
  font-size: 20px;
  cursor: pointer;
  transition: color 0.3s ease;
}

.editBtn:hover {
  color: #007bff;
}

.deleteBtn{
  background: none;
  border: none;
  font-size: 16px;
  color: #555555b1;
  transition: color 0.3s ease;
}

.deleteBtn:hover {
  color: #ff4d4d;
  cursor: pointer;
}

#signOutBtn,
#signupLink {
  border: 2px solid #00000028;
  padding: 5px 15px;
  border-radius: 50px;
  font-weight: 550;
  background-color: #dfdddd;
  color: rgb(0, 0, 0);
  font-size: 15px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  text-decoration: none;
}

#signOutBtn:hover,
#signupLink:hover {
  background-color: #b6b6b6;
}

.contentEditable {
  border: none;
}

.lefttopbar{
  display: flex;
  flex-direction: row;
  gap: 10px;
}

.dark-mode-btn {
  background: none;
  border: none;
  color: rgb(80, 80, 80);
  font-size: 20px;
  text-align: left;
  transition: color 0.2s ease;
}

.dark-mode-btn:hover {
  color: black;
  cursor: pointer;
}

/* Dark Mode Styles */
body.dark-mode {
  background-color: #121212;
  color: #e0e0e0;
}

.dark-mode .topbar {
  background-color: #2e2e2e;
}

.dark-mode .main-content {
  background-color: #1e1e1e;
}

.dark-mode .sidebar {
  background-color: #1b1b1b;
  border-right: 2px solid #444;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.505);
}

.dark-mode .sidebar a {
  color: #c0c0c0;
}

.dark-mode .sidebar a:hover {
  color: #ffffff;
}

.dark-mode .note {
  background-color: #2c2c2c;
  border-color: #444;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.505);
  color: #e0e0e0;
}

.dark-mode .note-date {
  color: #a0a0a0;
}

.dark-mode #noteInput {
  background-color: #2c2c2c;
  color: #f0f0f0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.505);
  border-color: #444;
}

.dark-mode #noteInput:focus {
  box-shadow: 0 0 10px rgba(0, 123, 255, 0.885);
  border: solid 2px rgba(0, 123, 255, 0.659);
  outline: none;
}

.dark-mode .savenotebtn {
  background-color: #056fe1;
}

.dark-mode .savenotebtn:hover {
  background-color: #0080ff95;
}

.dark-mode .editBtn {
  color: #999;
}

.dark-mode .editBtn:hover {
  color: #3856ff;
}

.dark-mode .deleteBtn {
  color: #999;
}

.dark-mode .deleteBtn:hover {
  color: #ff4d4d;
}

.dark-mode #signOutBtn,
.dark-mode #signupLink {
  background-color: #2f2f2f;
  color: #fff;
  border-color: #555;
}

.dark-mode #signOutBtn:hover,
.dark-mode #signupLink:hover {
  background-color: #444;
}

.dark-mode .note-group-heading {
  color: #c0c0c0;
}

.dark-mode .burger-btn {
  color: #c0c0c0;
}

.dark-mode .dark-mode-btn {
  color: #c0c0c0;
}

.dark-mode .dark-mode-btn:hover {
  color: #ffffff;
}

.dark-mode .logoname {
  color: #ffffff;
}

.dark-mode ::-webkit-scrollbar {
  width: 10px;              /* Width of the scrollbar */
  background: black;      /* Track background */
}

.dark-mode ::-webkit-scrollbar-thumb {
  background: #b6b6b6;      /* Thumb color */
  border-radius: 8px;        /* Rounded corners */
}

.dark-mode ::-webkit-scrollbar-thumb:hover {
  background: #888;          /* Thumb color on hover */
}

.dark-mode ::-webkit-scrollbar-track {
  background: black;       /* Track color */
  border-radius: 8px;
  padding: 10px;
}

.dark-mode .beta{
  background: rgb(82, 82, 82);
}

/* -------------------
   Mobile Only Media Query
------------------- */
@media (max-width: 700px) {

  .logoname {
    display: none; /* Hide logo name on mobile */
  }

  .topbar {
    flex-direction: row;
    height: auto;
    padding: 5px;
    gap: 10px;
  }

  .lefttopbar,
  .righttopbar {
    width: 50%;
  }

  #signOutBtn{
    font-size: 13px;
  }

  .burger-btn {
    font-size: 22px;
  }

  .sidebar {
    position: fixed;
    top: auto; /* below topbar */
    left: -100%;
    width: 80%;
    height: calc(100vh - 10%); 
    background: #fafafa;
    z-index: 1000;
    border-right: 3px solid #ccc;
    transition: left 0.3s ease;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
  }

  .sidebar.show {
    left: 0;
  }

  /* DO NOT hide text/icons on mobile — remove collapsed logic entirely in mobile */
  .sidebar a {
    display: flex;
    align-items: center;
    padding: 10px;
    font-size: 20px;
    gap: 10px;
    text-decoration: none;
    border-radius: 10px;
  }

  .sidebar i {
    width: 20px;
    text-align: center;
  }

  .sidebar .sidebar-text {
    display: inline;
  }

  .dark-mode-btn {
    width: 100%;
    text-align: centre;
    margin-top: 10px;
    font-size: 20px;
  }

  .content-wrapper {
    flex-direction: column;
  }

  .notes-container{
    padding-left: 0px;
  }

  #noteInput,
  .savenotebtn {
    width: 90%;
    font-size: 16px;
    padding: 12px;
  }

  .note {
    min-width: 100%;
    font-size: 14px;
  }
}

@media (min-width: 701px) and (max-width: 1023px){
  .topbar{
    padding-bottom: 3%;
    padding-top: 3%;
  }

  #signOutBtn{
    font-size: 15px;
  }
  .logoname {
    font-size: 20px;
  }
  .beta{
    font-size: 12px;
  }
 #signOutBtn{
  font-size: 12px;
 }
}

