/* Custom styles to override or enhance Tailwind, focusing on the green palette and rounded aesthetics */
:root {
  --primary-green: #01574a;
  --light-green: #98de60;
  --dark-green: #007d08;
  --text-color: #333;
  --bg-light: #f9fafb;
  --border-color: #e5e7eb;
}

body {
  font-family: "Inter", sans-serif;
  background-color: var(--bg-light);
  color: var(--text-color);
  overflow-x: hidden; /* Prevent horizontal scroll */
}

body.menu-open {
  overflow: hidden; /* Prevent body scroll when menu is open on mobile */
}

/* General rounded corners */
.rounded-lg {
  border-radius: 0.5rem;
}

.rounded-xl {
  border-radius: 0.75rem;
}

.rounded-full {
  border-radius: 9999px;
}

/* Header */
.myHeader {
  background-color: var(--primary-green);
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border-bottom-left-radius: 1rem;
  border-bottom-right-radius: 1rem;
  position: sticky; /* Make header sticky */
  top: 0;
  z-index: 100;
}

.myHeader img {
  height: 40px; /* Adjust as needed */
}

/* Floating button */
.floating-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background-color: var(--dark-green);
  border-radius: 9999px;
  padding: 0.75rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease-in-out;
  z-index: 1000;
}

.floating-btn:hover {
  transform: scale(1.1);
}

.floating-btn img {
  width: 30px;
  height: 30px;
  filter: invert(100%); /* Make SVG white */
}

/* Main Page Layout */
.myPage {
  display: flex;
  flex-wrap: wrap; /* Allows wrapping for mobile */
  padding: 1.5rem;
  gap: 1.5rem;
  /* max-width: 1200px; */
  margin: 1.5rem auto;
  background-color: #fff;
  border-radius: 1rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* Menu Button for Mobile */
.menu-btn {
  display: none; /* Hidden by default on desktop */
  background-color: var(--light-green);
  padding: 0.75rem;
  border-radius: 0.5rem;
  cursor: pointer;
  position: fixed; /* Fixed position on mobile */
  top: 1rem; /* Adjust based on header height */
  left: 1rem;
  z-index: 1002; /* Higher than sidebar when closed, lower than sidebar when open */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.menu-btn img {
  width: 24px;
  height: 24px;
  filter: invert(100%);
}

/* Sidebar Menu */
.mySidmenu {
  flex: 0 0 280px; /* Fixed width for sidebar on desktop */
  background-color: var(--primary-green);
  padding: 1.5rem 0;
  border-radius: 0.75rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: sticky; /* Stays fixed when scrolling on desktop */
  top: calc(40px + 1.5rem); /* Header height + myPage top margin */
  height: calc(
    100vh - (40px + 1.5rem + 1.5rem)
  ); /* Full viewport height minus header and page margins */
  overflow-y: auto; /* Independent scrolling on desktop */
  z-index: 50; /* Lower than mobile menu button when active */
}

.mySidmenu .links {
  padding: 0.75rem 1.5rem;
  margin-bottom: 0.25rem;
  transition: background-color 0.2s ease-in-out;
  border-left: 4px solid transparent;
}

.mySidmenu .links a {
  color: #e0f2f7; /* Light text for contrast */
  text-decoration: none;
  font-weight: 500;
  display: block;
}

.mySidmenu .links:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.mySidmenu .links.active {
  background-color: var(--dark-green);
  border-left-color: var(--light-green);
}

/* Content Area */
.ides {
  flex: 1;
  min-width: 0; /* Allows content to shrink */
  padding: 1rem;
  background-color: #fff;
  border-radius: 0.75rem;
}

.big-title {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--dark-green);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--light-green);
  display: inline-block;
}

.par {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  color: #4b5563;
}

.line-throw {
  border-top: 1px dashed var(--border-color);
  margin: 2rem 0;
}

.added {
  background-color: #ecfdf5; /* Very light green background */
  border-left: 4px solid var(--light-green);
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  border-radius: 0.5rem;
}

.added a {
  color: var(--dark-green);
  font-weight: 600;
  text-decoration: none;
}

.added .text {
  color: #374151;
  margin-top: 0.5rem;
}

.red {
  color: #ef4444; /* Red for required/notes */
  font-weight: 600;
}

.blue {
  color: #3b82f6; /* Blue for optional */
  font-weight: 600;
}

.link-added {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: #f0fdf4;
  border: 1px solid var(--light-green);
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  margin-top: 1rem;
  word-break: break-all;
  text-decoration: none;
  color: var(--primary-green);
  font-weight: 500;
}

.link-added .b {
  width: 8px;
  height: 8px;
  background-color: var(--dark-green);
  border-radius: 9999px;
  flex-shrink: 0;
}

.btn {
  background-color: var(--light-green);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out, transform 0.2s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn:hover {
  background-color: var(--dark-green);
  transform: translateY(-2px);
}

.btn img {
  width: 18px;
  height: 18px;
  filter: invert(100%);
}

.btn.red {
  background-color: #ef4444; /* Red for copy button */
  margin-left: 1em;
  filter: none; /* Remove previous filter */
}

.btn.red:hover {
  background-color: #dc2626;
}

.btn.red.center {
  padding-bottom: 0.5em; /* Adjust padding for alignment */
  margin-left: auto; /* Push to the right */
}

/* Point sections */
.mypoints .point {
  background-color: #fff;
  border: 1px solid var(--border-color);
  padding: 2rem;
  margin-bottom: 2rem;
  border-radius: 1rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.mypoints .point.is-visible {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.mypoints .point .line {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap; /* Allow wrapping for parameters */
}

.mypoints .point .circle {
  width: 40px;
  height: 40px;
  background-color: var(--light-green);
  border-radius: 9999px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.mypoints .point .circle__btn {
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  z-index: 2;
}

.mypoints .point .circle__back-1,
.mypoints .point .circle__back-2 {
  position: absolute;
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.2);
  animation: pulse 2s infinite;
}

.mypoints .point .circle__back-1 {
  width: 100%;
  height: 100%;
  animation-delay: 0.5s;
}

.mypoints .point .circle__back-2 {
  width: 100%;
  height: 100%;
  animation-delay: 1s;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

.point-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-green);
  flex-grow: 1; /* Allows title to take available space */
}

.mypoints .point .line.par {
  margin-top: 0.5rem;
  align-items: flex-start; /* Align text to top */
}

.mypoints .point .line .dot {
  width: 8px;
  height: 8px;
  background-color: var(--dark-green);
  border-radius: 9999px;
  flex-shrink: 0;
  margin-top: 0.5rem; /* Align with text baseline */
}

.mypoints .point .line span {
  font-weight: 600;
  color: var(--primary-green);
  flex-shrink: 0;
}

.mypoints .point .line p {
  color: #4b5563;
  flex-grow: 1;
}

.mypoints .point .line a {
  color: #3b82f6; /* Link color */
  text-decoration: underline;
  word-break: break-all;
}

.mypoints .point .marker {
  background-color: #f0fdf4;
  border: 1px solid var(--light-green);
  padding: 0.2rem 0.6rem;
  border-radius: 0.3rem;
  font-family: monospace;
  font-size: 0.9em;
  color: var(--dark-green);
}

.listpoints {
  list-style: none;
  padding-left: 1.5rem;
  margin-top: 1rem;
}

.listpoints li {
  margin-bottom: 0.75rem;
  position: relative;
}

.listpoints li::before {
  content: "•";
  color: var(--light-green);
  position: absolute;
  left: -1.5rem;
  font-size: 1.2em;
  line-height: 1;
}

.listpoints .one {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.listpoints .one .green {
  color: var(--dark-green);
  font-weight: 600;
}

.listpoints .one .defult {
  color: #6b7280;
  font-size: 0.9em;
}

.img-line {
  margin: 2rem 0;
  text-align: center;
}

.img-line img {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Code blocks (Prism.js integration) */
pre[class*="language-"] {
  border-radius: 0.75rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
  background-color: #2d2d2d !important; /* Dark background for code */
  padding: 1.25rem;
  overflow-x: auto;
}

code[class*="language-"] {
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Footer */
.footer-contnt {
  background-color: var(--primary-green);
  color: #e0f2f7;
  padding: 2rem 1.5rem;
  border-top-left-radius: 1rem;
  border-top-right-radius: 1rem;
  margin-top: 2rem;
  box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.1);
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-part {
  flex: 1;
  min-width: 200px;
  text-align: center;
}

.footer-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--light-green);
  margin-bottom: 1rem;
}

.footer-list {
  list-style: none;
  padding: 0;
}

.footer-list .li {
  margin-bottom: 0.5rem;
}

.footer-list .li a {
  color: #e0f2f7;
  text-decoration: none;
  transition: color 0.2s ease-in-out;
}

.footer-list .li a:hover {
  color: var(--light-green);
}

.contact-icons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.contact-icons a img {
  width: 30px;
  height: 30px;
  filter: invert(100%); /* Make social icons white */
  transition: transform 0.2s ease-in-out;
}

.contact-icons a img:hover {
  transform: scale(1.1);
}

.footer .link {
  text-align: center;
  margin-top: 2rem;
  font-size: 0.9rem;
  color: #a7f3d0;
}

.footer .link a {
  color: #a7f3d0;
  text-decoration: none;
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
  .mySidmenu {
    position: fixed; /* Changed to fixed for mobile overlay */
    top: 0;
    left: 0;
    height: 100vh; /* Full height */
    width: 80%; /* Occupy 80% width */
    max-width: 300px; /* Max width for larger mobile devices */
    flex: none;
    margin-bottom: 0; /* No bottom margin when fixed */
    border-radius: 0; /* No border-radius when full screen */
    transform: translateX(-100%);
    padding-top: 4.5em;
    transition: transform 0.3s ease-in-out;
    z-index: 1001; /* Higher z-index to overlay content */
    overflow-y: auto; /* Make it scrollable on mobile */
  }

  .mySidmenu.active {
    transform: translateX(0);
  }

  .menu-btn {
    display: block; /* Show menu button on mobile */
    width: fit-content;
    margin-bottom: 1rem;
    position: fixed; /* Keep menu button fixed */
    top: 1rem;
    left: 1rem;
    z-index: 1002; /* Ensure button is on top */
  }

  /* Overlay for mobile menu */
  .mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none; /* Hidden by default */
  }

  .mobile-menu-overlay.active {
    display: block;
  }

  .myPage {
    /* flex-direction: column; */
    padding: 1rem;
  }

  .ides {
    padding: 0.5rem;
  }

  .big-title {
    font-size: 1.75rem;
  }

  .mypoints .point {
    padding: 1.5rem;
  }

  .mypoints .point .line {
    /* flex-direction: column; */
    align-items: flex-start;
    gap: 0.5rem;
  }

  .mypoints .point .line .dot {
    margin-top: 0;
  }
  .img-line {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .footer-part {
    min-width: 100%;
    text-align: center;
  }

  .contact-icons {
    margin: 3em 0;
  }

  .footer-contnt .link {
    text-align: center;
  }

  .mypoints .point .line.par {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
  }

}

@media (max-width: 600px) {
  .myPage {
    padding: 0.75rem;
    margin: 0.75rem auto;
  }

  .myHeader {
    padding: 0.75rem;
  }

  .myHeader img {
    height: 30px;
  }

  .menu-btn {
    padding: .2rem;
  }

  .floating-btn {
    bottom: 1rem;
    right: 1rem;
    padding: 0.5rem;
  }

  .floating-btn img {
    width: 24px;
    height: 24px;
  }

  .big-title {
    font-size: 1.5rem;
  }

  .par {
    font-size: 0.9rem;
  }

  .mypoints .point {
    padding: 1rem;
  }

  .mypoints .point .circle {
    width: 35px;
    height: 35px;
  }

  .mypoints .point .circle__btn {
    font-size: 1rem;
  }

  .point-title {
    font-size: 1.2rem;
  }

  .listpoints {
    padding-left: 1rem;
  }

  .listpoints li::before {
    left: -1rem;
  }

  .btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
  }

  pre[class*="language-"] {
    padding: 1rem;
  }

  code[class*="language-"] {
    font-size: 0.8rem;
  }

  .footer-contnt {
    padding: 1.5rem 1rem;
  }
}
