/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto+Serif', serif;
    background-color: #121212;
    color: #cacaca;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden; /* Disable horizontal scrolling */
    scroll-behavior: smooth;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Custom Scrollbar */
body::-webkit-scrollbar {
    width: 10px;
}

body::-webkit-scrollbar-track {
    background: #333;
    border-radius: 5px;
}

body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
    border: 2px solid #333;
}

body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Editor Styles */
.editor {
    width: 100%;
    max-width: 800px;
    min-width: 800px;
    min-height: 80vh;
    outline: none;
    padding: 40px;
    padding-top: 30vh;
    font-size: 20px;
    line-height: 1.6;
    color: inherit;
    text-align: left;
    overflow-y: auto;
    overflow-x: hidden;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0 auto;
    display: block;
    word-break: break-word;
    box-sizing: border-box;
}

.editor p {
    margin-bottom: 2em;
    overflow-wrap: break-word;
}

/* Styles for the floating popup */
.text-popup {
    display: none;
    position: absolute;
    background-color: #333;
    color: #fff;
    padding: 10px;
    border-radius: 5px;
    z-index: 2000;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    gap: 5px;
}

.text-popup button {
    background: none;
    border: none;
    color: #fff;
    font-size: 16px;
    margin-right: 10px;
    cursor: pointer;
}

.text-popup button:hover {
    color: #aaa;
}

/* Placeholder text when editor is empty */
.editor:empty:before {
    content: "Take a breath and start typing...";
    color: #888;
    font-style: italic;
    display: block;
}


/* Side Menu */
.menu-icon {
    position: fixed;
    top: 20px;
    left: 20px;
    font-size: 20px;
    cursor: pointer;
    color: #545454;
    z-index: 2000;
    background-color: #1f1f1f;
    padding: 10px;
    border-radius: 5px;
    transition: left 0.3s ease;
}

.side-menu {
    position: fixed;
    top: 0;
    left: -250px;
    width: 250px;
    height: 100vh;
    max-height: 100vh;
    background-color: #333;
    transition: 0.3s ease;
    padding: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    font-family: Arial, sans-serif;
}


/* Custom Scrollbar for Side Menu */
.side-menu::-webkit-scrollbar {
    width: 8px;
}

.side-menu::-webkit-scrollbar-track {
    background: #444;
    border-radius: 5px;
}

.side-menu::-webkit-scrollbar-thumb {
    background: #777;
    border-radius: 5px;
    border: 2px solid #444;
}

.side-menu::-webkit-scrollbar-thumb:hover {
    background: #555;
}


.side-menu.open {
    left: 0;
}

.side-menu.open + .menu-icon {
    left: 250px;
}

h3 {
    margin-bottom: 15px;
    font-size: 30px;
}

/* Theme Tabs Styling */
.theme-toggle {
    display: flex;
    justify-content: left;
    width: 100%;
}

.theme-tab {
    padding: 10px 20px;
    cursor: pointer;
    background-color: #444;
    color: #fff;
    font-size: 16px;
    transition: background-color 0.3s ease;
    text-align: center;
}

.theme-tab.active {
    background-color: #9c9c9c;
    color: #fff;
    font-weight: bold;
}

.theme-tab:hover {
    background-color: #555;
}

/* Text History */
.history-list {
    list-style: none;
    width: 100%;
    padding: 0;
    flex: 1;
}


.history-header{
    cursor: pointer;
    background-color: #444;
    color: #fff;
    padding: 10px;
    width: 200px;
    border-radius: 5px;
    margin-bottom: 10px;
    transition: background-color 0.3s ease;
    display: flex;
    justify-content: space-between; /* Align items to both ends */
    align-items: center; /* Center items vertically */
}
.history-header:hover{
 background-color: #555;
}
.history-header .arrow {
  font-size: 1.2em;
}

.history-list li {
    background-color: #444;
    color: #fff;
    padding: 15px;
    width: 100%;
    border-radius: 5px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.history-list li:hover {
    background-color: #555;
}

.setting {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
}

input[type="checkbox"] {
    transform: scale(1.2);
    cursor: pointer;
}

body.light-mode {
    background-color: #f0f0f0;
    color: #333;
}

body.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
}

.side-menu button {
    margin-top: auto;
}

/* Save Options Styles */
.save-options-container {
  display: flex;
  flex-direction: column;
  gap: 5px;
    width: 100%; /* Set the container to take up full width */
}
.save-header {
  text-align: center;
    margin-bottom: 5px;
    font-weight: bold;
}

.save-button {
  background-color: #444;
  color: white;
  padding: 15px 23px;
  border: none;
    width: 73%; /* Set the button to take up full width */
    text-align: left; /* align the text to the left side */
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.save-button:hover {
  background-color: #555555;
}
/* Media queries for smaller devices */
@media (max-width: 768px) {
    .editor {
        min-width: auto; /* Allow editor width to adjust */
        padding: 20px; /* Reduce padding */
        font-size: 16px; /* Reduce font size */
        padding-top: 15vh;
        min-height: 60vh;
    }

    .menu-icon {
        top: 10px;
        left: 10px;
    }

  .side-menu {
        width: 80%; /* Take the entire screen width on mobile */
        left: -100%; /* Start off screen */
        max-width: 100%; /* set max width to 100% */
    }

    .side-menu.open {
        left: 0;
        padding-top: 30%;
    }

       .menu-icon {
          left: 0; /* Reset left position */
         transition: left 0.3s ease, margin-left 0.3s ease;
      }


    .side-menu.open + .menu-icon {
        left: 0;
        margin-left: 22%;
    }

    h3{
        font-size: 24px;
    }

    .theme-tab {
         font-size: 14px;
          padding: 8px 15px;

    }

   .history-header{
        font-size: 18px;
           width: 100%; /* Set the width to auto to adjust */

    }
    .save-button{
      font-size: 18px;
      padding: 10px 15px;
    }

    .menu-icon {
       font-size: 20px;
        padding: 8px;
    }
}