/* Frontend Styles for Corrections Logger */

/* Ensure styles are scoped within the Corrections Logger wrapper */
.cl-corrections-logger-wrapper .cl-intro-box {
  display: flex;
  align-items: center;
  background-color: #ffedf3;
  border-left: 10px solid #b8004c;
  border-radius: 12px;
  box-shadow: 0px 5px 6px rgba(0, 0, 0, 0.1);
  padding-top: 20px;
}

.cl-corrections-logger-wrapper .cl-intro-image {
  flex: 0 0 100px;
  margin-right: 20px;
}

.cl-corrections-logger-wrapper .cl-intro-image img {
  max-width: 100%;
  border-radius: 8px;
}

.cl-corrections-logger-wrapper .cl-intro-text {
  flex: 1;
  font-size: 1.06em;
  color: #000000;
  padding: 30px;
}

/* Existing Styles */
*,
*::before,
*::after {
  box-sizing: border-box;
}

.cl-container {
  font-family: Tahoma, sans-serif;
  max-width: 1800px;
  margin: 0 auto;
  padding: 20px;
  position: relative; /* Ensures proper positioning */
}

/* Intro Box Styles */
.cl-intro-box {
  display: flex;
  align-items: center;
  background-color: #ffbad6;
  border-left: 10px solid #b8004c;
  border-radius: 12px;
  box-shadow: 0px 5px 6px rgba(0, 0, 0, 0.1);
}

.cl-intro-image {
  flex: 0 0 100px;
  margin-right: 20px;
}

.cl-intro-image img {
  max-width: 100%;
  border-radius: 8px;
}

.cl-intro-text {
  flex: 1;
  font-size: 1.06em;
  color: #000000;
}

/* Main Content */
.cl-main-content {
  display: flex;
  gap: 20px;
}

/* Years Sidebar */
.cl-year-sidebar {
  width: 20%;
  border-right: 1px solid #ddd; /* Subtle separator */
  padding-right: 20px;
}

.cl-year-sidebar h2 {
  font-size: 1.5em;
  color: #333;
  margin-bottom: 10px;
}

.cl-year-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cl-year-button {
  background-color: transparent;
  color: #333;
  font-family: Tahoma, sans-serif;
  font-weight: 700;
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease;
  font-size: 17px;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 8px;
  flex: 1 1 calc(25% - 10px); /* Four buttons per row */
}

.cl-year-button:hover {
  background-color: #ff0069;
  border-left: 10px solid #b8004c;
  color: white;
  transform: scale(1.02);
}

.cl-year-button.active {
  background-color: #ff0069;
  border-left: 10px solid #b8004c;
  color: white;
  transform: scale(1.02);
}

/* Message for No Entries */
.cl-no-entries {
  font-size: 1.2em;
  color: #555;
  padding: 10px;
}

/* Months Sidebar */
.cl-month-sidebar {
  width: 20%;
  padding-left: 10px;
}

.cl-month-sidebar h2 {
  font-size: 1.5em;
  color: #333;
  margin-bottom: 10px;
  display: none; /* Hidden by default */
}

.cl-month-menu-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  width: 100%;
}

.cl-month-menu-container.show {
  opacity: 1;
  visibility: visible;
}

.cl-month-button {
  background-color: transparent;
  color: #333;
  font-family: Tahoma, sans-serif;
  font-weight: 700;
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
  font-size: 14px;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 8px;
  margin: 10px;
  flex: 1 1 calc(33.333% - 10px); /* Three buttons per row */
}

.cl-month-button:hover {
  background-color: #ff0069;
  border-left: 10px solid #b8004c;
  color: white;
  transform: scale(1.02);
}

.cl-month-button.active {
  background-color: #ff0069;
  border-left: 10px solid #b8004c;
  color: #fff;
  transform: scale(1.05);
}

/* Corrections Section */
.cl-corrections-section {
  width: 60%;
}

.cl-corrections-title {
  font-size: 1.8em;
  color: #333;
  margin-bottom: 20px;
}

.cl-corrections-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* Correction Cards */
.cl-card {
  background-color: #ffbad6;
  border-radius: 12px;
  border-left: 10px solid #b8004c;
  padding: 20px;
  box-shadow: 0px 5px 6px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  animation: unfold 0.5s forwards;
}

.cl-card:nth-child(odd) {
  animation-delay: 0.2s;
}

.cl-card:nth-child(even) {
  animation-delay: 0.4s;
}

.cl-card:hover {
  transform: translateY(-5px);
  box-shadow: 5px 5px 12px rgba(0, 0, 0, 0.15);
}

.cl-card h3 {
  margin-top: 0;
  font-size: 1.7em;
  color: #b8004c; /* Keep header color */
}

.cl-card a {
  color: #b8004c;
  font-family: Tahoma, sans-serif;
  font-weight: 700;
  text-decoration: none;
}

.cl-card a:hover {
  text-decoration: underline;
}

.cl-card .original-claim {
  margin-bottom: 5px;
  font-size: 1.0625em;
}

.cl-card .updated-claim {
  margin-bottom: 5px;
  font-size: 1.0625em;
}

.cl-card .description {
  border-top: 1px solid #ffa0c7;
  border-bottom: 1px solid #ffa0c7;
  font-size: 1em;
  padding-top: 10px;
  padding-bottom: 10px;
  margin-top: 15px;
  color: #000000;
}

.cl-card .card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
}

.cl-card .article-title {
  font-family: Tahoma, sans-serif;
  font-weight: 700;
  color: #b8004c;
  text-decoration: none;
  word-break: break-word;
}

.cl-card .article-title:hover {
  text-decoration: underline;
}

.cl-card .correction-date {
  font-family: Tahoma, sans-serif;
  font-weight: 700;
  color: #000000;
  font-size: 12px;
}

/* Animations */
@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes unfold {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Visual Separator Between Years and Months */
.cl-main-content::before {
  content: "";
  width: 1px;
  background-color: #ddd;
  margin: 0 20px;
  align-self: stretch;
}

/* Responsive Styles for Screens 1360px and Below */
@media only screen and (max-width: 1360px) {
  .cl-main-content {
    flex-direction: column;
    gap: 15px;
  }

  /* Years Sidebar */
  .cl-year-sidebar {
    width: 100%;
    border-right: none;
    padding-right: 0;
    margin-bottom: 20px;
  }

  .cl-year-menu {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
  }

  .cl-year-button {
    flex: 1 1 calc(25% - 10px); /* Four buttons per row */
    justify-content: center;
    padding: 10px;
    font-size: 16px;
  }

  /* Hide Months Header */
  .cl-month-sidebar h2 {
    display: none;
  }

  /* Months Sidebar */
  .cl-month-sidebar {
    width: 100%;
    padding-left: 0;
    margin-bottom: 20px;
  }

  .cl-month-menu-container {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
  }

  .cl-month-button {
    flex: 1 1 calc(33.333% - 10px); /* Three buttons per row */
    justify-content: center;
    padding: 10px;
    font-size: 13px;
  }

  /* Corrections Section */
  .cl-corrections-section {
    width: 100%;
  }

  /* Correction Cards */
  .cl-card {
    padding: 15px;
  }

  .cl-card h3 {
    font-size: 1.5em;
  }

  .cl-card .description {
    font-size: 0.95em;
    padding-top: 8px;
    padding-bottom: 8px;
    margin-top: 10px;
  }

  .cl-card .card-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .cl-card .article-title {
    font-size: 1em;
  }

  .cl-card .correction-date {
    font-size: 0.9em;
  }

  /* Hide count-text */
  .cl-year-button .count-text,
  .cl-month-button .count-text {
    display: none;
  }

  /* Visual Separator */
  .cl-main-content::before {
    display: none;
  }

  /* No Entries Message Styling */
  .cl-year-sidebar .cl-no-entries {
    display: block;
  }

  /* Prevent Overlapping */
  .cl-article-corrections-section {
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
  }
}

/* Responsive Styles for Screens Between 480px and 1360px */
@media only screen and (max-width: 1360px) and (min-width: 381px) {
  .cl-year-button {
    flex: 1 1 calc(25% - 10px); /* Four buttons per row */
  }

  .cl-month-button {
    flex: 1 1 calc(33.333% - 10px); /* Three buttons per row */
    margin: 10px;
  }
}

/* Responsive Styles for Screens Between 480px and 381px */
@media only screen and (max-width: 480px) and (min-width: 381px) {
  .cl-year-menu {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
  }

  .cl-year-button {
    flex: 1 1 calc(50% - 10px); /* Two buttons per row */
    justify-content: center;
    padding: 10px;
    font-size: 16px;
  }

  .cl-month-menu-container {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
  }

  .cl-month-button {
    flex: 1 1 calc(50% - 10px); /* Two buttons per row */
    justify-content: center;
    padding: 10px;
    font-size: 13px;
  }

  /* Prevent Overlapping */
  .cl-article-corrections-section {
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
  }
}

/* Responsive Styles for Even Narrower Screens (380px and Below) */
@media only screen and (max-width: 380px) {
  .cl-year-button,
  .cl-month-button {
    flex: 1 1 100%; /* One button per row */
  }

  .cl-year-button {
    font-size: 15px;
    padding: 8px;
  }

  .cl-month-button {
    font-size: 12px;
    padding: 8px;
  }

  .cl-corrections-title {
    font-size: 1.6em;
  }

  .cl-card h3 {
    font-size: 1.3em;
  }

  .cl-card .description {
    font-size: 0.9em;
  }

  .cl-card .article-title {
    font-size: 0.95em;
  }

  .cl-card .correction-date {
    font-size: 0.85em;
  }

  /* No Entries Message Styling */
  .cl-year-sidebar .cl-no-entries {
    font-size: 1.2em;
    color: #555;
    padding: 10px;
    text-align: center;
  }

  /* Prevent Overlapping */
  .cl-article-corrections-section {
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
  }
}

/* Styles for Updates/Correction Section in Articles */

.cl-container {
  margin-top: 40px;
  padding: 20px;
  background-color: #ffedf3;
  border-left: 10px solid #b8004c;
  border-radius: 20px;
}

.cl-container h2 {
  font-size: 1.5em;
  font-family: Tahoma;
  font-weight: 700;
  color: #b8004c;
}

.cl-corrections-list .cl-correction {
  margin-bottom: 15px;
  padding: 15px;
  background-color: #ffffff;
  border: 1px solid #ddd;
  border-left: 4px solid #b8004c;
  border-radius: 4px;
}

.cl-corrections-list .cl-correction p {
  margin: 5px 0;
}

.cl-corrections-list .cl-correction strong {
  color: #333;
}

/* Collapsible Article Corrections Section */
.cl-article-corrections-section {
  font-family: Tahoma;
}

.cl-article-corrections-section .cl-article-header {
  display: flex;
  align-items: center;
  gap: 15px;
}

.cl-article-corrections-section .cl-article-collapse-button {
  background-color: #b8004c;
  color: #fff;
  border: 2px solid #b8004c;
  padding: 10px;
  width: 50px;
  height: 50px;
  font-size: 0; /* Hide text */
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease, transform 0.3s ease, border 0.3s ease;
}

.cl-article-corrections-section .cl-article-collapse-button:hover {
  background-color: #a5004c;
  border: 2px solid #a5004c;
}

.cl-article-corrections-section .cl-article-collapse-button .cl-pencil-icon {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

/* Rotate the pencil icon when expanded */
.cl-article-corrections-section:not(.collapsed)
  .cl-article-collapse-button
  .cl-pencil-icon {
  transform: rotate(45deg);
}

.cl-article-corrections-section .cl-article-corrections-content {
  max-height: 0;
  opacity: 0;
  transition: max-height 0.5s ease-out, opacity 0.5s ease-out;
}

.cl-article-corrections-section.collapsed .cl-article-corrections-content {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}

.cl-article-corrections-section:not(.collapsed)
  .cl-article-corrections-content {
  max-height: 1000px;
  opacity: 1;
}

/* Correction Cards */
.cl-card {
  background-color: #ffbad6;
  border-radius: 12px;
  border-left: 10px solid #b8004c;
  padding: 20px;
  box-shadow: 0px 5px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cl-card:hover {
  transform: translateY(-5px);
  box-shadow: 5px 5px 12px rgba(0, 0, 0, 0.15);
}

/* Prevent Overlapping */
.cl-article-corrections-section {
  position: relative;
  z-index: 1;
  /* Removed overflow: visible; to ensure normal flow */
}

/* Fix overflow issue in article corrections section on small screens */
@media only screen and (max-width: 480px) {
  .cl-article-corrections-section:not(.collapsed)
    .cl-article-corrections-content {
    max-height: none;
    overflow: visible; /* Added to ensure content doesn't overflow */
  }
}
