/* Menu button corners */
a.svelte-tjqdch {
  border-radius: 12px;
}

/* Hide back button everywhere by default */
a.back-to-courses {
  display: none;
}

/* Show and restyle it only on messages page */
.message-content ~ * a.back-to-courses,
.tw-drawer:has(.message-content) a.back-to-courses {
  display: flex !important;
  font-size: 0;
  align-items: center;
}

/* Change the text on messages page */
.tw-drawer:has(.message-content) a.back-to-courses::after {
  content: "← Back to Community";
  font-size: 1rem;
  color: #4c3026;
}

/* Style the button nicely on messages page */
.tw-drawer:has(.message-content) a.back-to-courses {
  background: transparent;
  padding: 0;
  text-decoration: none;
  transition: opacity 0.3s;
}

.tw-drawer:has(.message-content) a.back-to-courses:hover {
  opacity: 0.7;
}

/* Hide the arrow icon */
.tw-drawer:has(.message-content) a.back-to-courses div {
  display: none;
}

/* Hide My Communities heading */
h1.communities-title {
  display: none;
}

/* Reduce spacing on mobile */
@media (max-width: 1023px) {
  /* Reduce menu bar bottom spacing */
  .max-sm\:tw-flex.tw-items-center {
    margin-bottom: 0.5rem;
  }
  
  label.tw-drawer-button.tw-mb-4 {
    margin-bottom: 0.5rem !important;
  }
  
  .tw-float-end.tw-mb-4 {
    margin-bottom: 0.5rem !important;
  }
  
  /* Reduce HTML section top padding */
  .right-sidebar.svelte-tjqdch {
    padding-top: 0.5rem !important;
  }
  
  /* Reduce spacing in the HTML content */
  .right-sidebar .ql-editor.svelte-tjqdch {
    margin-bottom: 1rem !important;
  }
}
/* Sidebar background */
.sidebar.svelte-tjqdch,
.sidebar-inner.svelte-tjqdch {
  background-color: #f0ede4 !important;
}

/* Hamburger button */
label.tw-btn-primary.tw-drawer-button {
  background-color: #f0ede4 !important;
  border-color: #f0ede4 !important;
}

label.tw-btn-primary.tw-drawer-button svg {
  color: #1a1a1a;
}

/* Write a post block */
label[for="my-modal-3"].tw-card {
  background-color: #4c3026 !important;
  color: white;
}

label[for="my-modal-3"] svg {
  color: white;
  stroke: white;
}

/* Modal heading text */
h3.tw-text-lg.tw-font-bold.tw-mb-4 {
  font-size: 0;
}

h3.tw-text-lg.tw-font-bold.tw-mb-4::after {
  content: "Share your thoughts and questions with the community";
  font-size: 1rem;
}

/* Adjust close button position and size */
label.tw-btn-circle[for="my-modal-3"] {
  background-color: #4c3026 !important;
  color: white;
  right: 1rem !important;
  top: 1rem !important;
  font-size: 0.9rem;
}

/* Topic dropdown */
select.tw-select-ghost {
  color: #4c3026;
  max-width: 200px !important;
  border-radius: 12px;
}

select.tw-select-ghost option:hover,
select.tw-select-ghost option:checked,
select.tw-select-ghost:focus option:checked {
  background-color: #4c3026 !important;
  color: white !important;
}

/* Notifications dropdown */
.tw-dropdown-content.svelte-12qdmhk,
.tw-dropdown-content.tw-tw-card.svelte-12qdmhk,
.tw-dropdown-content-inner.svelte-12qdmhk {
  background-color: #4c3026 !important;
  color: white;
  border-radius: 8px !important;
  overflow: hidden;
}

.tw-dropdown-content h5 {
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
}

.tw-dropdown-content svg {
  color: white;
  stroke: white;
}

/* Round Edit Profile button corners */
ul.profile li a {
  border-radius: 8px;
}

.return-atelier {
  color: #a1a1a1;
  text-decoration: none;
  font-size: 1rem;
  position: relative;
  display: inline-block;
  transition: color 0.3s ease;
}

.return-atelier:hover {
  color: #4c3026;
}

/* Underline animation */
.return-atelier::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: #4c3026;
  transition: width 0.4s ease;
}

.return-atelier:hover::after {
  width: 100%;
}

/* Move sidebar to top on mobile */
@media (max-width: 1023px) {
  .tw-drawer-content.svelte-tjqdch {
    display: flex;
    flex-direction: column;
  }
  
  .right-sidebar.svelte-tjqdch {
    order: -1;
    width: 100%;
    padding-top: 0;
    margin-top: 0;
    margin-bottom: 1rem;
  }
  
  .community-content {
    order: 1;
  }
}

/* Hide the main heading */
h1.tw-text-3xl.tw-font-bold.tw-mb-1 {
  display: none;
}

/* Completely collapse the hidden heading */
h1.tw-text-3xl.tw-font-bold.tw-mb-1 {
  display: none;
  font-size: 0.01rem !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 0 !important;
  height: 0 !important;
}

/* Remove spacing on mobile */
@media (max-width: 1023px) {
  /* Remove all spacing from menu bar container */
  .max-sm\:tw-flex.tw-items-center {
    margin: 0 !important;
    padding: 0 !important;
  }
  
  /* Remove spacing from hamburger button */
  label.tw-drawer-button.tw-mb-4 {
    margin: 0 !important;
  }
  
  /* Remove spacing from notification/message area */
  .tw-float-end.tw-mb-4 {
    margin: 0 !important;
  }
  
  /* Remove top padding from HTML section */
  .right-sidebar.svelte-tjqdch {
    padding-top: 0 !important;
    margin-top: 0 !important;
  }
  
  /* Reduce HTML content spacing */
  .right-sidebar .ql-editor.svelte-tjqdch {
    margin-bottom: 0.5rem !important;
  }
  
  /* Remove padding from drawer content */
  .tw-drawer-content.svelte-tjqdch {
    padding-top: 0.5rem !important;
  }
}

/* Hide checkbox */
.about-modal-toggle {
  display: none;
}

/* Image button styling */
.about-community-image-btn {
  display: block;
  cursor: pointer;
  margin-bottom: 1rem;
  transition: opacity 0.3s;
}

.about-community-image-btn:hover {
  opacity: 0.9;
}

.about-community-image-btn img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

/* Modal overlay - hidden by default */
.about-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

/* Show modal when checkbox is checked */
.about-modal-toggle:checked ~ .about-modal-overlay {
  display: flex;
}

/* Modal content box */
.about-modal-content {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* Close button */
.about-modal-close {
  position: absolute;
  right: 1rem;
  top: 1rem;
  background-color: #4c3026;
  color: white;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: opacity 0.2s;
}

.about-modal-close:hover {
  opacity: 0.8;
}

/* Modal text styling */
.about-modal-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #4c3026;
  font-family: 'Poppins', sans-serif;
}

.about-modal-content p {
  line-height: 1.5;
  color: #333;
  margin: 0;
}