/* CSS Boilerplate */

/* Root variables for colors and other reusable values */
:root {
  --bgColor: #1e1e1e; /* Background color */
  --textareabg: #252526; /* Text area background color */
  --text: #d4d4d4; /* Text color */
  --accentColor: #007acc; /* Accent color for buttons */
  --navbar: #0e0e0e; /* Navbar background color */
  --icons: #cac3c3e5; /* Icon color */
  --tooltipbg: #0f0f0f; /* Tooltip background color */
  --defWidth: ; /* Default width */
  --transitions: 0.3s ease-in-out; /* Transition timing */
  --borderRadius: calc(infinity * 1px); /* Border radius */
}

/* Resetting default margin, padding, and box-sizing */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Body styles */
body {
  overflow-x: hidden;
  background: var(--bgColor);
  color: var(--text);
  display: flex;
  flex-direction: column;
  font-family: Arial, sans-serif;
  line-height: 1.6;
  height: 100vh;
}

/* Removing outline on focus for textarea and button */
textarea:focus,
button:focus {
  outline: none;
}

/* Button styles */
button {
  cursor: pointer;
  width: 40px;
  height: 50px;
  border: none;
  background: none;
  transition: var(--transitions);
}

header button {
  position: absolute;
  right: 0;
  top: 0;
}
/* Icon styles */
i {
  font-size: 18px;
  color: var(--text) !important;
}

/* Navigation container styles */
#navContainer {
  border-bottom: 2px solid black;
  position: sticky;
  top: 0;
  right: 0;
  background: var(--bgColor);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Main container styles */
main.container {
  display: flex;
  width: 100%;
  overflow: auto;
  flex-grow: 1;
}

/* Textarea styles */
textarea {
  width: 100%;
  height: 100%;
  background: var(--textareabg);
  padding: 0 20px;
  border: none;
  font-size: 20px;
  color: var(--text);
  overflow: auto;
}

/* Button hover effect */
button:hover {
  filter: opacity(0.7);
  transform: scale(1.05);
}

/* Button active effect */
button:active {
  transform: scale(0.9);
}

/* Header styles */
header {
  border-bottom: 2px solid black;
  padding-block: 0.5rem;
}

/* Text styles */
.text {
  text-align: center;
  font-size: 2rem;
}

/* Editor and preview container styles */
#editor,
#preview {
  width: calc(100% / 2);
  height: 100%;
}

/* Iframe styles */
iframe {
  width: 100%;
  height: 100%;
  background: #f3f3f3;
}

/* Preview paragraph styles */
#preview p {
  text-align: center;
  height: 50px;
  border-bottom: 2px solid black;
}

/* Preview container border */
#preview {
  border: 2px solid black;
  border-top: none;
}

/* Utility class to hide elements */
.invisible {
  display: none;
}

/* Utility class to show elements */
.show {
  display: block;
}

/* utility class for theme */
.dark-theme {
  --bgColor: #ffffff;
  --textareabg: #f3f3f3;
  --text: #1e1e1e;
  --accentColor: #007acc;
  --navbar: #e0e0e0;
  --icons: #4d4d4d;
  --tooltipbg: #f9f9f9;
}

/* Notification styles */
.notification {
  position: fixed;
  bottom: 10px;
  right: 0;
  transform: translateX(-10%);
  background: var(--tooltipbg);
  color: var(--text);
  padding: 10px;
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  width: 300px;
  height: auto;
  transition: opacity 0.5s ease-in-out;
  z-index: 1000;
}

/* Media query for responsive design on smaller screens */
@media (max-width: 767px) {
  #responsive {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bgColor);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    z-index: 2000;
  }
  header,
  main.container,
  #navContainer {
    display: none;
  }
}

/* Character count styles */
#countChar {
  margin: 0 5%;
}
