/***************************************************************
* 1. Imports & Global Resets
***************************************************************/
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@100;300;400;500;600;700&display=swap');

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

/***************************************************************
* 2. Global Layout & Typography
***************************************************************/
html,
body {
  font-family: "Poppins", sans-serif;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  background-color: #FCFCFC;
  background-position: center right;
  background-size: cover;
  visibility: hidden;
  transition: visibility 0.3s ease, background-color 0.3s ease;
  scroll-behavior: smooth;
}

body.loaded {
  visibility: visible;
}

.main-box {
  height: 100vh;
  width: 100%;
}

/***************************************************************
* 3. Sidebar Menu Base Styles
***************************************************************/
.main-box .sidebar-menu {
  position: fixed;
  height: 100vh;
  width: 240px;
  left: -240px;
  background: #FCFCFC;
  box-shadow:
  0 4px 12px rgba(0, 0, 0, 0.08),
  inset -1px 0 0 rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transition: all 0.4s linear;
  z-index: 99;
}

.sidebar-menu .logo {
  position: absolute;
  width: 100%;
  height: 60px;
  box-shadow: 0px 2px 4px rgba(255, 255, 255, 0.5);
}

.sidebar-menu .logo a {
  color: #25C9D0;
  font-size: 22px;
  font-weight: 500;
  position: absolute;
  left: 20px;
  line-height: 60px;
  text-decoration: none;
}

/***************************************************************
* 4. Sidebar Menu - Main Menu Items
***************************************************************/
.sidebar-menu .menu {
  position: absolute;
  top: 80px;
  width: 100%;
}

.sidebar-menu .menu li {
  margin-top: 6px;
  padding: 0;
  position: relative;
  list-style: none;
}

.menu-header {
  display: block;
  padding: 14px 20px;
}

.menu-item .dropdown-label {
  display: block;
  width: 100%;
  height: 100%;
}

.dropdown-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  color: #555;
  font-size: 16px;
  text-decoration: none;
  transition: transform 0.4s ease;
}

.dropdown-label .dropdown-icon {
  font-size: 24px;
  color: #555;
  margin-top: 4px;
  float: right;
  cursor: pointer;
  transition: transform 0.4s ease;
  flex-grow: 1;
  text-align: right;
}

.sidebar-menu .menu i {
  color: #555;
  font-size: 16px;
  padding-right: 8px;
}

.sidebar-menu .menu a {
  color: #555;
  font-size: 16px;
  text-decoration: none;
}

/***************************************************************
* 5. Sidebar Menu - Sub-menu & Sub-heading
***************************************************************/
.sidebar-menu .sub-menu {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.3s ease;
}

#dropdown-check:checked ~ .sub-menu {
  max-height: 200px;
  transition: 0.8s ease;
  opacity: 1;
}

.sidebar-menu .menu .sub-menu li.sub-heading {
  margin-top: 6px;
  padding: 0;
  display: block;
}

.sidebar-menu .menu .sub-menu li.sub-heading a .sub-heading-text {
  display: block;
  padding: 14px 20px;
}

/***************************************************************
* 6. Hover Effects for Menu Items
***************************************************************/
.sidebar-menu .menu li:hover {
  border-left: 2px solid #25C9D0;
  box-shadow:
    inset 2px 0 0 #25C9D0, 
    0 0 4px rgb(37,201,208,0.9);
  background-color: rgba(227, 246, 248, 0.6);
}

.sidebar-menu .menu .sub-menu li.sub-heading:hover {
  border-left: 2px solid #25C9D0;
  background-color: #FCFCFC;
}

.sidebar-menu .menu .sub-menu li.sub-heading:hover a .sub-heading-text {
  color: #25C9D0;
  transition: color 0.4s ease;
}

.dropdown-icon:hover,
.dropdown-label:hover {
  color: #25C9D0;
  transition: color 0.4s ease;
}

.dropdown-label:hover .dropdown-icon {
  color: #EDEDED;
  transition: color 0.4s ease;
}

.sidebar-menu .menu li:hover .menu-header span,
.sidebar-menu .menu li:hover .menu-header i {
  color: #25C9D0;
  transition: color 0.4s ease;
}


/***************************************************************
* 7. Sidebar Social Media Links
***************************************************************/
.sidebar-menu .social-media {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  list-style: none;
  cursor: pointer;
}

.sidebar-menu .social-media ul {
  display: flex;
  padding: 0;
  margin: 0;
  list-style: none;
}

.sidebar-menu .social-media i {
  padding: 0 10px;
  color: #25C9D0;
  opacity: 0.6;
  font-size: 18px;
  text-decoration: none;
}

.sidebar-menu .social-media i:hover {
  opacity: 1;
  transition: all 0.2s linear;
  transform: scale(1.05);
}

/***************************************************************
* 8. Toggle Buttons (Hamburger & 'X')
***************************************************************/
#check {
  display: none;
}

.main-box .btn-one i {
  color: #25C9D0;
  font-size: 35px;
  font-weight: 700;
  position: absolute;
  left: 16px;
  line-height: 60px;
  cursor: pointer;
  opacity: 1;
  transition: 0.3s linear;
  z-index: 100;
}

.sidebar-menu .btn-two i {
  font-size: 30px;
  line-height: 60px;
  position: absolute;
  left: 205px;
  cursor: pointer;
  opacity: 0;
  color: #25C9D0;
  transition: 0.3s linear;
}

.btn-one i:hover {
  font-size: 40px;
}

.btn-two i:hover {
  font-size: 36px;
}

#check:checked ~ .sidebar-menu {
  left: 0;
}

#dropdown-check:checked + .dropdown-label .dropdown-icon {
  transform: rotate(90deg);
  transition: transform 0.6s ease;
}

#dropdown-check:not(:checked) + .dropdown-label .dropdown-icon {
  transform: rotate(-90deg);
  transition: transform 0.6s ease;
}

#check:checked ~ .btn-one i {
  opacity: 0;
}

#check:checked ~ .sidebar-menu .btn-two i {
  opacity: 1;
}

/***************************************************************
* 9. Hero Section
***************************************************************/
.hero {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(227, 246, 248, 0.6); 
  color: #555;
  text-align: center;
  padding: 15px 40px;
  margin-bottom: 35px;
  transition: left 0.4s linear, transform 0.4s linear, font-size 0.4s linear;
}

.hero.nav-open {
  left: calc(50% + 220px);
  transform: translateX(-50%);
}

.hero h1 {
  font-size: 2em;
  margin-bottom: 10px;
  transition: font-size 0.4s linear;
}

.hero-content p {
  color: #25C9D0;
  font-size: clamp(1rem, 2vw, 1.2rem);
  transition: font-size 0.4s linear;
}

#check:checked ~ .hero {
  left: calc((100% + 240px) / 2);
  transform: translateX(-50%);
  transition: left 0.4s linear, transform 0.4s linear;
}

/***************************************************************
* 10. Text Container & Editor Areas
***************************************************************/
.text-container {
  position: fixed;
  width: 90%;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  transition: left 0.4s linear, transform 0.4s linear;
  height: auto;
  margin-top: 20px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.text-container.nav-open {
  left: calc(50% + 220px);
  transform: translateX(-50%);
}

.input-area,
.output-area {
  position: relative;
  width: 40vw;
  margin: 0 5px;
  transition: width 0.4s linear;
}

.input-area .editor-container,
.output-area .editor-container {
  height: calc(100vh - 250px);
  width: 100%;
  padding: 20px 10px 10px 10px;
  outline: none;
  font-size: 1em;
  line-height: 1.8;
  border-radius: 10px;
  border: 1px solid #CCC;
  background: #FCFCFC;
  color: #FCFCFC;
  transition: 0.4s ease;
  resize: none;
  text-align: left;
  vertical-align: top;
}

.input-area.focused .editor-container,
.output-area.focused .editor-container {
  color: #FCFCFC;
  border: 2px solid #25C9D0;
  transition: color 0.4s linear;
}

#check:checked ~ .text-container {
  left: calc((100% + 240px) / 2);
  transform: translateX(-50%);
  width: calc(100% - 50px);
  transition: left 0.4s linear, transform 0.4s linear, width 0.4s linear;
}

#check:checked ~ .text-container .input-area,
#check:checked ~ .text-container .output-area {
  width: 35vw;
}

/***************************************************************
* 11. Floating Label Styling
***************************************************************/
.input-area .labelline,
.output-area .labelline {
  position: absolute;
  top: 17px;
  left: 10%;
  font-size: 16px;
  color: #555;
  background: transparent;
  padding: 0;
  line-height: normal;
  transform: translate(0, 3px) scale(1);
  transition: transform 0.4s ease, color 0.4s ease, background-color 0.4s ease, padding 0.4s ease, line-height 0.4s ease;
  pointer-events: none;
}

.input-area.focused .labelline,
.input-area.has-content .labelline,
.output-area.has-content .labelline {
  color: #25C9D0;
  background: #FCFCFC;
  padding: 0 12px;
  line-height: 30px;
  transform: translate(-32px, -32px) scale(0.88);
  transition: 0.4s ease;
  z-index: 1;
}

/***************************************************************
* 12. Monaco Editor Background & Scrollbar
***************************************************************/
.monaco-editor .monaco-editor-background {
  background-color: #f8f8f8 !important;
}

.editor-container::-webkit-scrollbar {
  width: 0.8em;
  cursor: pointer;
}

.editor-container::-webkit-scrollbar-thumb {
  background-color: rgba(158, 106, 0, 0.6);
  border-radius: 10px;
  border: 3px solid transparent;
  cursor: grab;
  background-clip: padding-box;
}

/***************************************************************
* 13. Custom Context Menu Styling
***************************************************************/
#custom-context-menu {
  position: absolute;
  background: #FCFCFC;
  color: #555;
  border: 1px solid #25C9D0;
  border-radius: 4px;
  box-shadow: 0px 0px 6px rgb(37,201,208,0.5);
  font-family: "Poppins", sans-serif;
  z-index: 10000;
}

#custom-context-menu .menu-item {
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  transition: color 0.4s ease, border-left 0.4s ease;
  display: block;
}

#custom-context-menu .menu-item:hover {
  color: #25C9D0;
  box-shadow: 0 0 4px rgb(37,201,208,0.5);
}

/***************************************************************
* 14. Generate Button
***************************************************************/
.generate-btn-box {
  position: relative;
  text-align: center;
  margin: 0 20px;
}

#generate-btn {
  width: 8vw;
  max-width: 150px;
  min-height: 8vh;
  padding: 5px 10px;
  background-color: #e3f7f8;
  color: #25c9d0;
  border: 1px solid #CCC;
  border-radius: 10px;
  cursor: pointer;
  transition:
    background-color 0.6s ease,
    color 0.6s ease,
    transform 0.3s ease;
  font-size: clamp(0.2rem, 1.5vw, 1.3rem);
  overflow: visible;
  text-align: center;
  white-space: nowrap;
  position: relative;
  z-index: 1;
}

#generate-btn:hover {
  background-color: #FCFCFC;
  color: #141416;
  border: 1px solid #25c9d0;
  transform: scale(1.05);
}

.star {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  z-index: 2;
  transition:
    opacity 0.3s ease,
    transform 0.6s ease;
}

.star svg {
  opacity: 1;
  fill: #25c9d0;
  transition: opacity 0.3s ease;
  animation: sparkle 1.5s ease-in-out infinite;
  animation-delay: inherit;
}

.generate-btn-box:hover .star {
  opacity: 1;
  visibility: visible;
}

/* Small stars - inside */
.star-1 { top: 15%; left: 35%; animation-delay: 0.6s; }
.star-2 { top: 62%; left: 60%; animation-delay: 0.9s; }

/* Medium stars - border */
.star-3 { top: -15%; left: 80%; animation-delay: 1.2s; }
.star-4 { top: 91%; left: 10%; animation-delay: 1.5s; }

/* Large stars - outside */
.star-5 { top: -20%; left: -10%; animation-delay: 1.8s; }
.star-6 { top: 98%; left: 100%; animation-delay: 2.1s; }

.star-1 svg, .star-2 svg { width: 10px; height: 10px; }
.star-3 svg, .star-4 svg { width: 14px; height: 14px; }
.star-5 svg, .star-6 svg { width: 18px; height: 18px; }

@keyframes sparkle {
  0%, 100% {
    transform: scale(0.8) rotate(0deg);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.2) rotate(15deg);
    opacity: 1;
  }
}

.btn-content {
  transition: font-size 0.6s ease;
  font-size: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

#generate-btn::before {
  content: "";
  position: absolute;
  border-radius: inherit;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #FCFCFC;
  opacity: 0;
  transform: scale(0);
  transform-origin: center;
  z-index: -1;
  transition: transform 0.6s ease, opacity 0.6s ease;
}

#generate-btn:hover::before {
  transform: scale(1);
  opacity: 1;
}

#generate-btn div {
  width: 100%;
}

#generate-btn div::before {
  content: attr(data-text);
}

#generate-btn:hover div::before {
  content: attr(data-hover);
}

/***************************************************************
* 15. Info Button
***************************************************************/
#info-button {
  position: fixed;
  top: 12px;
  right: 12px;
  background-color: transparent;
  border: none;
  padding: 0;
  z-index: 999;
  cursor: pointer;
  transition: 0.3s linear;
}

#info-button i {
  font-size: 35px;
  color: #25C9D0;
  transition: 0.3s linear;
}

#info-button:hover i {
  font-size: 38px;
}

/***************************************************************
* 16. Info Modal
***************************************************************/
.info-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
}

.info-modal-content {
  background-color: rgba(80, 80, 80, 1);
  color: #EDEDED;
  margin: 11% auto;
  padding: 30px 30px 40px;
  border: 1px solid #888;
  width: 80%;
  max-width: 570px;
  border-radius: 10px;
  position: relative;
}

.info-modal-content h2 {
  margin-bottom: 20px;
}

.info-modal-content .close {
  position: absolute;
  top: 10px;
  right: 10px;
  cursor: pointer;
  z-index: 1001;
}

.info-modal-content .close i {
  font-size: 22px;
  color: #EDEDED;
  opacity: 0;
  transition: 0.3s linear;
  font-weight: 700;
}

.info-modal-content .close i:hover {
  opacity: 1;
  color: #25c9d0;
}

.info-modal-content:hover .close i {
  opacity: 1;
}

.modal-steps {
  list-style-type: decimal;
  padding-left: 20px;
  font-size: 1rem;
  color: #EDEDED;
}

.modal-steps li {
  margin-bottom: 14px;
  line-height: 1.6;
}

.modal-steps li::marker {
  color: #25c9d0;
  font-weight: 500;
}

.soft-highlight {
  color: #25c9d0;
  font-weight: 500;
}

.inline-button-img {
  height: 36px;
  vertical-align: middle;
  margin: 0 6px -3px 6px;
  overflow: hidden;
  display: inline-block;
}

/***************************************************************
* 17. Responsive Adjustments
***************************************************************/
@media only screen and (max-width: 1440px) {
  #check:checked ~ .hero {
    left: calc((100% + 240px) / 2);
    transform: translateX(-50%);
    transition: left 0.4s linear, transform 0.4s linear;
  }

  #check:checked ~ .text-container {
    left: calc((100% + 240px) / 2);
    width: calc(100% - 120px);
    transition: left 0.4s linear, transform 0.4s linear, width 0.4s linear;
  }

  #check:checked ~ .text-container .input-area,
  #check:checked ~ .text-container .output-area {
    width: 32vw;
  }

  #check:checked ~ .hero .hero-content h1 {
    font-size: 1.8em;
    transition: font-size 0.4s linear;
  }

  #check:checked ~ .hero .hero-content p {
    font-size: clamp(0.9rem, 1.8vw, 1rem);
    transition: font-size 0.4s linear;
  }

  #custom-context-menu {
    font-size: 0.9rem;
  }

  #custom-context-menu .menu-item {
    font-size: 0.9rem;
  }

  #info-button {
    transform: scale(0.9);
  }

  /* small stars - inside */
  .star-1 { top: 5%; left: 35%; animation-delay: 0.6s; }
  .star-2 { top: 50%; left: 60%; animation-delay: 0.9s; }

  /* medium stars - border */
  .star-3 { top: -22%; left: 75%; animation-delay: 1.2s; }
  .star-4 { top: 81%; left: 15%; animation-delay: 1.5s; }

  /* large stars - outside */
  .star-5 { top: -30%; left: -12%; animation-delay: 1.8s; }
  .star-6 { top: 92%; left: 102%; animation-delay: 2.1s; }

  .star-1 svg, .star-2 svg { width: 6px; height: 6px; }
  .star-3 svg, .star-4 svg { width: 10px; height: 10px; }
  .star-5 svg, .star-6 svg { width: 14px; height: 14px; }
}