/* Define CSS variables globally */
:root {
  --primary-color: #0000FF; /* Main purple color (for links) */
  --secondary-color: #ffe0e8; /* Light background color for sections (no clue) ffe0e8*/
  --background-color: #e6ddd3; /* Background color for the body (background) f4f4f9*/
  --text-color: #333; /* General text color */
  --button-text-color: white; /* Text color for buttons */
  --hover-color: #ff0000; /* Button hover color */
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Times New Roman', Times, serif;
  background-color: var(--background-color);
  color: var(--text-color);
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 1.5rem;
  color: white;
  background-image: url("./images/Knowledge_Is_Human_Homepage_Animated_Banner.gif"); /* Path to your background image */
  background-size: cover; /* Make the background image cover the entire header */
  background-position: center; /* Center the background image */
  background-repeat: no-repeat; /* Prevent the background from repeating */
  height: 160px;
}

.header-content {
  text-align: center; /* Center-align the text within its area */
  flex-grow: 1; /* Take up remaining space so that it stays centered */
}

.text-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.header-content h1,
.header-content p {
  text-shadow: 0px 0px 8px rgba(0, 0, 0, 1); /* Adds a subtle shadow to the text */
}

.header h1 {
  margin: 0;
  font-size: 2rem;
}

.header p {
  font-size: 1.5rem;
}

.banner-pill {
  display: inline-block;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  background-color: rgba(0, 0, 0, 0.55); /* To make it slightly opaque*/
  color: #fff;
  margin: 0;
}

.home-button {
  padding: 0.8rem;
  cursor: pointer; /* Make the curser a finger... I think it looks cool */
  font-size: 1rem;
  font-weight: normal;
  color: var(--primary-color);
  text-decoration: underline;
}

.home-button:visited {
  color: #551a8b;
}

.home-button:hover {
  text-decoration: underline; /* Add underline on hover for better feedback */
}

.page-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  flex-wrap: wrap;
}

.top-dropdown-nav {
  display: none;
  width: 100%;
  background-color: #cfc7e2;
  border: 1px solid #e2d6c9;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  padding: 0.5rem;
  margin: -2rem 0 0 0;
  box-sizing: border-box;
}

.top-dropdown-inner {
  display: grid;
  width: 100%;
  background-color: #fff;
  border: 1px solid #e2d6c9;
  border-radius: 10px;
  box-sizing: border-box;
  gap: 0;
  align-items: flex-start;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: visible;
}

.top-nav-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 2rem;
  max-width: 100%;
  padding: 0.45rem 0.5rem;
  border: none;
  border-radius: 0;
  background-color: transparent;
  color: var(--text-color);
  font-weight: bold;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
}

.top-nav-control:hover {
  text-decoration: underline;
}

.top-dropdown-inner > .top-nav-control{
  min-width: 0;
}

.top-dropdown-inner > .top-nav-dropdown {
  min-width: 0;
}

.top-nav-dropdown {
  display: block;
  min-width: 0;
  transition: background-color 0.3s ease-in-out, border 0.3s ease-in-out;
}

.top-nav-dropdown summary {
  list-style: none;
  transition: background-color 0.3s ease-in-out;
}

.top-nav-dropdown summary::-webkit-details-marker {
  display: none;
}

.top-nav-menu {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
  max-height: 0;
  overflow: hidden;
  background-color: #fff;
  border-radius: 0;
  box-shadow: none;
  padding: 0 0.75rem;
  margin-top: 0;
  box-sizing: border-box;
  transition: max-height 0.3s ease-in-out, padding 0.3s ease-in-out, background-color 0.3s ease-in-out;
  transition: background-color 0.3s ease-in-out, border 0.3s ease-in-out;
}

.top-dropdown-inner.has-open-dropdown .top-nav-menu {
  transition: background-color 0.3s ease-in-out;
  transition: background-color 0.3s ease-in-out, border 0.3s ease-in-out;

}

.top-dropdown-inner.has-open-dropdown .top-nav-dropdown[open] .top-nav-menu {
  max-height: 18rem;
  padding: 0.75rem 0.75rem 0.75rem 1.5rem;
  transition: background-color 0.3s ease-in-out, border 0.3s ease-in-out;

}

.top-nav-dropdown[open] {
  background-color: #ffd6d6;
  border: 1px solid #ffb3b3;
  border-radius: 4px;
}

.top-nav-dropdown[open] summary {
  background-color: #ffd6d6;
}

.top-nav-dropdown[open] .top-nav-menu {
  background-color: #ffd6d6;
  padding: 0.75rem 0.75rem 0.75rem 1.5rem;
  text-indent: -6px;
  max-height: 18rem;
}

.top-nav-item {
  color: #666;
  text-decoration: none;
  font-size: 0.95rem;
  overflow-wrap: break-word;
  text-align: left;
}

.top-nav-item:hover {
  text-decoration: underline;
}

.main-content {
  flex: 1;
  min-width: 0;
  max-width: 800px;
  order: 1;
  word-wrap: break-word; /* Allow long words to break and wrap to the next line */
  overflow-wrap: break-word;
  width: fit-content;
}

.side-tab {
  width: 260px;
  background-color: #fffaf3;
  border: 1px solid #e2d6c9;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  position: sticky; /*Lets it move with the page */
  top: 1rem; /* Allows the side bar to not be above the top main-content */
  bottom: 7rem; /* Allows the side bar to not be above the bottom main-content */
  align-self: flex-start;
  order: 2;
  margin: 0rem 0rem 1rem 1rem;
  max-height: calc(100vh - 4.18rem); /* Allows the side-tab to have a 1rem top and bottom buffer */
  overflow-y: auto; /* Allows a vertical scrolling feature */
  overflow-x: hidden; /* Hides ugly horizontal scrollbars */
}

.side-tab-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0rem;
}

.side-tab-title {
  color: var(--text-color);
  font-weight: bold;
  text-decoration: none;
  margin: 1rem 0 0 0;
}

/* Scrollbar styling for side-tab */
.side-tab::-webkit-scrollbar {
  width: 8px;
}

.side-tab::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 8px;
}

.side-tab::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 8px;
}

.side-tab::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* Back-to-top button styling */
.back-to-top {
  display: flex;
  justify-content: center;
  margin-bottom: 0rem;
  padding-bottom: 2px;
  margin-top: -8px;
  border-bottom: 1.5px solid #000000;
}

.back-to-top-link {
  color: var(--text-color);
  font-weight: bold;
  text-decoration: none;
  font-size: 1rem;
  font-style: italic;
}

.back-to-top-link:hover {
  text-decoration: underline;
}

.side-tab-box {
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 0.75rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-indent: -6px;
}

.side-tab-item {
  color: #666;
  text-decoration: none;
  font-size: 0.95rem;
  padding-left: 0.5rem;
}

.side-tab-item-blog {
  font-style: italic;
}

.side-tab-item-reading {
  font-style: italic;
}

.side-tab-title:hover,
.side-tab-item:hover {
  text-decoration: underline;
}

.container {
  margin: 0 0 1rem 0;
  padding: 2rem;
  background-color: #fffaf3;
  border: 1px solid #e2d6c9;
  border-radius: 8px;
  width: 100%;
  box-sizing: border-box;
}

h2 {
  margin-top: 0;
}

.post {
  background-color: white;
  padding: 1.5rem;
  margin-bottom: 1rem;
  border-radius: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.post-meta {
  font-size: 0.9rem;
  color: #777; /* Light gray color for the text */;
  font-style: italic;
  margin: 0 0 -1rem 0;
}

.post h3 {
  margin: 0 0 0.5rem 0;
}

.post p {
  margin: 0.5rem 0 0.5rem 0; 
}

.post a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: bold;
}

.post a:hover {
  text-decoration: underline;
}

.center {
  display: flex; /* Enables flexbox */
  flex-direction: column; /* Stack children vertically */
  align-items: center; /* Centers children horizontally */
  text-align: center; /* Ensures text elements (like <h2> and <p>) are centered */
}

.about p {
  line-height: 1.6; /* Improve readability */
  margin: 0.5rem 0 0.5rem 0; /* Add vertical spacing between paragraphs */
}

.back-button {
  padding: 0.8rem;
  cursor: pointer;
  font-size: 1rem;
  text-decoration: none;
}

.next-button {
  padding: 0.8rem;
  cursor: pointer;
  font-size: 1rem;
  text-decoration: none;
}


.back-button:hover {
  text-decoration: underline;
}

.next-button:hover {
  text-decoration: underline;
}

#inputText {
  width: 60%;
  max-width: 500px;
  height: 24px;
  padding: 0px;
  font-size: 0.9rem;
  border: 1px solid #e2d6c9;
  border-radius: 4px;
  box-sizing: border-box;
  text-indent: 5px;
}

#inputText + button {
  height: 24px;
  font-size: 0.9rem;
  box-sizing: border-box;
  vertical-align: middle;
}

#submittedText {
  margin-bottom: -6px;
  text-align: center;
  font-style: italic;
  color: #888;
}

#synthesisResults,
#synthesisHistoryList,
#recognitionHistoryList {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.synthesis-result-item {
  border: none;
  border-radius: 6px;
  background-color: #fff;
  padding: 0.65rem;
}

.synthesis-result-text {
  margin: 0 0 0.45rem 0;
}

.synthesis-result-item audio {
  width: 100%;
}

.blog-post-container {
  margin: 0 0 1rem 0;
  padding: 2rem;
  background-color: #fffaf3;
  border: 1px solid #e2d6c9;
  border-radius: 8px;
  width: 100%;
  box-sizing: border-box;
}

.blog-post {
  background-color: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.blog-post p {
  line-height: 1.25;
  margin: 0.5rem 0 0.5rem 0;
  text-indent: 1rem;
}

.blog-post h3 {
  margin: 2rem 0 0 0;
}

.blog-post h4 {
  margin: 2rem 0 0 0;
}

.post-image {
  width: 100%;
  max-width: 200px;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

h2,
h3 {
  margin-top: 1rem;
}

footer.footer {
  text-align: center;
  padding: 1rem;
  background-color: var(--primary-color);
  color: var(--button-text-color);
  margin-top: 2rem;
  border-radius: 4px;
}

.technologies-section h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: var(--hover-color); /* Accent color for the heading */
}

.card-container {
  display: flex;
  flex-wrap: wrap; /* Allow cards to wrap to new lines */
  gap: 1.5rem; /* Space between the cards */
  justify-content: center; /* Center the cards horizontally */
}

.card {
  flex: 1 1 calc(33.333% - 1.5rem); /* 3 columns on large screens */
  background-color: #fff; /* Light background color */
  padding: 1.5rem;
  border-radius: 8px;
  text-align: left;
  text-decoration: none; /* Remove underline from links */
  color: var(--text-color); /* Text color */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-3px); /* Subtle lift effect on hover */
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

.card h3 {
  margin: 0 0 0.5rem 0;
  color: var(--primary-color); /* Accent color for the card title */
}

.card p {
  margin: 0;
  line-height: 1.6;
}

.page-container.nav-dropdown-mode {
  display: block;
  padding: 0;
}

.page-container.nav-dropdown-mode .top-dropdown-nav {
  display: block;
  position: sticky;
  top: 0rem;
  z-index: 30;
}

.page-container.nav-dropdown-mode .side-tab {
  display: none;
}

.page-container.nav-dropdown-mode .main-content {
  max-width: 100%;
  width: 100%;
}

.page-container.nav-dropdown-mode .blog-post-container {
  max-width: 100%;
  width: 100%;
  margin: 0;
}

/* 2 columns on tablets */
@media (max-width: 768px) {
  .card {
    flex: 1 1 calc(50% - 1.5rem); /* 2 columns */
  }
}

/* 1 column on mobile screens */
@media (max-width: 480px) {
  .card {
    flex: 1 1 100%; /* 1 column */
  }
}


/* ============================================
   PRACTICE OPTIONS & THRESHOLD CONTROLS
   ============================================ */

/* Practice Action Buttons Hover Effects */
.practice-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.practice-action-btn:active {
    transform: translateY(0);
}

/* Threshold Slider Styling */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #dc3545 0%, #ffc107 50%, #28a745 100%);
    outline: none;
    opacity: 0.8;
    transition: opacity 0.2s;
}

input[type="range"]:hover {
    opacity: 1;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Practice Recommendation Message */
#practice-recommendation {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
