/* General Styles */
html {
  scrollbar-gutter: stable;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inclusive-sans', sans-serif;
  background-color: #f5f5f5;
  color: #333;
  min-height: 80vh;
  background-image:
      radial-gradient(circle at top left,
            rgba(5, 88, 242, 0.17) 0%,
            rgba(5, 88, 242, 0.12) 18%,
            transparent 45%),

      radial-gradient(circle at bottom right,
            rgba(5, 88, 242, 0.17) 0%,
            rgba(5, 88, 242, 0.12) 18%,
            transparent 45%);
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  background-attachment: fixed;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #0558F2 0%, #0047B2 100%);
  border-radius: 10px;
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #0047B2 0%, #003399 100%);
}

/* Navigation */

/* Header */
h1 {
  text-align: center;
  margin: 30px 0;
  margin-top: 18vh;
  color: #333;
}

h1 + p {
  text-align: center;
}

/* Filter Area */
.filterarea {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 20px;
  flex-wrap: wrap;
}

.filterarea select,
.filterarea input {
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 24px;
  border-color: #007bff;
  font-size: 16px;
  width: 240px;
  transition: all 0.3s ease;
}

.filterarea input:focus,
.filterarea select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.filterarea select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23007bff' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 38px;
}

.filterarea select option {
  padding: 10px 15px;
  margin: 5px 0;
  background-color: white;
  color: #333;
  font-size: 16px;
  border: none;
}

.filterarea select option:checked {
  background: linear-gradient(#007bff, #007bff);
  background-color: #007bff;
  color: white;
  font-weight: 600;
}

.filterarea input.search {
  width: 250px;
}

/* Dictionary Container */
#dictionary-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  padding: 30px;
  max-width: 1200px;
  margin: 0 auto;
  overflow: hidden;
}

/* Card Styles */
.card {
  background-color: rgba(37, 100, 235, 0.2);
  padding: 30px;
  border-radius: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
  animation: fadeInRight 0.8s ease-out;
}

.card:hover {
  transform: translateY(-5px);
  border-color: #007bff;
  box-shadow: 0 4px 12px rgba(5, 88, 242, 0.763);
}

.card h2 {
  color: #0a53f1;
  font-size: 18px;
  margin-bottom: 10px;
}

.card p {
  color: #000000;
  font-size: 14px;
  font-style: italic;
}

/* Pagination */
#pagination-container {
  display: flex;
  justify-content: center;
  padding: 0 20px;
}

.pagination {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 40px 0;
}

.pagination button {
  padding: 10px 14px;
  border: 2px solid #0558F2;
  background-color: white;
  color: #0558F2;
  border-radius: 100px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  min-width: 42px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(5, 88, 242, 0.1);
}

.pagination button:hover:not(:disabled) {
  background: linear-gradient(135deg, #0558F2 0%, #0047B2 100%);
  color: white;
  border-color: #0047B2;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(5, 88, 242, 0.3);
}

.pagination button:disabled {
  color: #ccc;
  cursor: not-allowed;
  background-color: #f0f0f0;
  border-color: #ddd;
  box-shadow: none;
}

.pagination button.active {
  background: linear-gradient(135deg, #0558F2 0%, #0047B2 100%);
  color: white;
  border-color: #0047B2;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(5, 88, 242, 0.4);
}

/* Details Container */

#detail-container {
  max-width: 800px;
  margin: 30px auto;
  padding: 35px;
  background-color: white;
  border-radius: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(5, 88, 242, 0.1);
  transition: all 0.3s ease;
  margin-top: 20vh;
  animation: fadeInTop 0.6s ease-out;
  overflow: hidden;
}

#detail-container:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-color: rgb(5, 88, 242);
}

#detail-container a {
    color: #070707;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    margin-bottom: 12px;
    display: inline-block;
}

#detail-container a:hover {
  color: #003d99;
  text-decoration: underline;
}

#detail-container h1 {
  color: #0558F2;
  margin-bottom: 10px;
  margin-top: 15px;
  font-size: 28px;
  font-weight: 700;
}

#detail-container #filipino {
  color: #666;
  font-size: 18px;
  margin-bottom: 20px;
  text-align: center;
  font-style: italic;
  padding: 12px;
  background-color: rgba(5, 88, 242, 0.05);
  border-radius: 12px;
}

#detail-container .category {
  display: inline-block;
  background: linear-gradient(135deg, rgba(5, 88, 242, 0.2) 0%, rgba(5, 88, 242, 0.1) 100%);
  color: #0558F2;
  padding: 12px 24px;
  border-radius: 20px;
  font-size: 14px;
  margin-bottom: 0px;
  margin-top: 24px;
  font-weight: 600;
  border: 1px solid rgba(5, 88, 242, 0.2);
  transition: all 0.3s ease;
}

#detail-container .category:hover {
  cursor: default;
  transform: translateY(-3px);
  background: linear-gradient(135deg, rgba(5, 88, 242, 0.3) 0%, rgba(5, 88, 242, 0.2) 100%);
  box-shadow: 0 4px 12px rgba(5, 88, 242, 0.15);
}

#detail-container section {
  margin: 25px 0;
  padding: 20px 0;
  border-bottom: 1px solid rgba(5, 88, 242, 0.1);
}

#detail-container section:last-child {
  border-bottom: none;
}

#detail-container section h3 {
  color: #0f0f0f;
  margin-bottom: 15px;
  font-size: 24px;
  font-weight: 700;
}

#detail-container section h3 .english {
  font-style: italic;
  color: #0b0b0b;
  font-size: 0.9em;
}

#detail-container section p,
#detail-container section li {
  line-height: 1.8;
  color: #000000;
}

#detail-container section img {
  max-width: 100%;
  height: auto;
  margin-top: 15px;
  margin-bottom: 15px;
  border-radius: 12px;
}

#detail-container section ol {
  padding-left: 20px;
  margin-bottom: 15px;
}

#detail-container section ol li {
  margin-bottom: 8px;
}

#detail-container section ul {
  padding-left: 20px;
  margin-bottom: 15px;
}

#detail-container section ul li {
  margin-bottom: 8px;
}

#detail-container code {
  background-color: #f4f4f4;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
}

/* Details Header */
header {
  max-width: 800px;
  margin: 20px auto;
  padding: 0 20px;
}

header a {
  color: #007bff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

header a:hover {
  color: #0056b3;
}

/* Home Page */
.home-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 40px 60px;
  gap: 40px;
  margin-top: 10vh;
  overflow: hidden;
}

.textarea {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  text-align: left;
  animation: fadeInLeft 0.6s ease-out;
}

.imagearea {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeInRight 0.6s ease-out;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  padding: 10px 30px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 50px;
  margin: 20px auto;
  max-width: fit-content;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
}

.navbar img {
  height: 40px;
  width: auto;
  order: -1;
  margin-right: 20px;
}

.navbar a {
  text-decoration: none;
  color: #333;
  font-weight: 700;
  transition: color 0.3s;
  padding: 8px 15px;
  border-radius: 20px;
}

.navbar a:hover {
  color: #007bff;
  background-color: rgba(0, 123, 255, 0.1);
}

.navbar a.active {
  color: white;
  background-color: #007bff;
  font-weight: 700;
}

.home-navbar {
  width: 100%;
  max-width: 100% !important;
  justify-content: center;
  gap: 50px;
  padding: 18px 60px;
  margin: 0 !important;
  background: linear-gradient(180deg, #0558F2 0%, #0047B2 100%);
  border-radius: 0 0 500px 500px;
  box-shadow: 0 8px 20px rgba(5, 88, 242, 0.2);
  position: fixed;
  top: 0;
  z-index: 1000;
}

.home-navbar a {
  color: white;
  font-weight: 700;
  font-size: 18px;
  padding: 12px 20px;
}

.home-navbar img {
  position: absolute;
  left: 60px;
  height: 40px;
  width: auto;
}

.home-navbar a:hover {
  color: white;
  background-color: rgba(255, 255, 255, 0.2);
}

.home-navbar a.active {
  color: white;
  background-color: rgba(255, 255, 255, 0.3);
}

.home-navbar .demo-title {
  margin-left: auto;
  position: absolute;
  right: 60px;
  color: white;
  background-color: rgba(255, 255, 255, 0.2);
}

.demo-title {
  margin-left: auto;
  font-weight: 600;
  color: #0558F2;
  font-size: 16px;
  padding: 8px 20px;
  background-color: rgba(5, 88, 242, 0.1);
  border-radius: 20px;
}
 
.learnmore {
  padding: 14px 40px;
  background: linear-gradient(135deg, #0558F2 0%, #03338C 100%);
  color: white;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 18px;
  box-shadow: 0 4px 15px rgba(5, 88, 242, 0.3);
}

.learnmore:hover {
  background: linear-gradient(135deg, #03338C 0%, #0558F2 100%);
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(5, 88, 242, 0.4);
}

.learnmore:active {
  transform: translateY(0);
}

.imagearea img {
  max-width: 700px;
  width: 100%;
  height: auto;
}

.textarea {
  max-width: 800px;
  margin-left: 130px;
}

.textarea h1 {
  font-size: 52px;
  color: #000000;
  margin-bottom: 15px;
  text-align: left;
  margin-top: 15px;
}

.textarea h5 {
  color: #000000;
  font-size: 24px;
  margin-top: 150px;
  margin-bottom: 20px;
}

.textarea p {
  color: #000000;
  font-size: 18px;
  max-width: 100%;
  text-align: left;
  margin-bottom: 20px;
  line-height: 1.6;
  letter-spacing: 6%;
}

/* Quiz Page Styles */
.quiz-mode-container {
  display: flex;
  justify-content: center;
  gap: 30px;
  padding: 40px 20px;
  flex-wrap: wrap;
  overflow: hidden;
}

.quiz-mode-container a {
  text-decoration: none;
}

.quiz-card {
  padding: 40px;
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  width: 100%;
  max-width: 300px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  color: rgb(0, 0, 0);
  border: 2px solid rgba(5, 88, 242, 0.8);
  animation: fadeInBottom 0.6s ease-out;
}

.quiz-card:hover {
  border: 2px solid #0558F2;
  box-shadow: 0 4px 12px rgba(5, 88, 242, 0.8);
  transform: translateY(-2px);
  transition: all 0.3s ease;
}

.quiz-card h2 {
  font-size: 28px;
  margin: 0 0 10px 0;
}

.quiz-card p {
  margin: 0;
  font-size: 14px;
  opacity: 0.9;
}

/* Flashcard Page */
.flashcard-study-container {
  max-width: 800px;
  margin: 40px auto;
  padding: 0 20px;
  margin-top: 17vh;
  overflow: hidden;
}

.flashcard-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  gap: 20px;
  padding: 20px;
}

.nav-arrow {
  background: #f5f5f5;
  color: #000000;
  border: 2px solid #0558F2;
  padding: 10px 20px;
  border-radius: 18px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  width: 130px;
  text-align: center;
  flex: 0 0 130px;
  margin: 0px auto;
}

.nav-arrow:hover:not(:disabled) {
  background: #e8f0ff;
  border-color: #0558F2;
  box-shadow: 0 4px 12px rgba(5, 88, 242, 0.3);
  transform: translateY(-2px);
}

.nav-arrow:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.flashcard-progress {
  text-align: center;
  color: #0558F2;
  font-weight: bold;
  white-space: nowrap;
}

.flashcard-container {
  perspective: 1000px;
  margin: 0px auto;
  padding: 0 20px;
  height: 400px;
  max-width: 600px;
  transition: box-shadow 0.3s ease;
  pointer-events: auto;
}

.flashcard-container.slide-out-left {
  animation: slideOutLeft 0.4s ease-out forwards;
}

.flashcard-container.slide-in-right {
  animation: slideInRight 0.4s ease-out forwards;
}

.flashcard-container.slide-out-right {
  animation: slideOutRight 0.4s ease-out forwards;
}

.flashcard-container.slide-in-left {
  animation: slideInLeft 0.4s ease-out forwards;
}

.flashcard-container:hover .flashcard-front,
.flashcard-container:hover .flashcard-back {
  box-shadow: 0 8px 25px rgba(5, 88, 242, 0.3);
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.flashcard-container.flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
  position: absolute;
  width: 100%;
  height: 100%;
  background:  #f5f5f5;
  color: #0558F2;
  border: 2px solid #0558F2;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  box-sizing: border-box;
  cursor: pointer;
  transform-style: preserve-3d;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  outline: none;
  user-select: none;
  backface-visibility: hidden;
  top: 0;
  left: 0;
}

.flashcard-back {
  transform: rotateY(180deg);
}

.flashcard-inner:not(.flipped) .flashcard-back {
  pointer-events: none;
}

.flashcard-inner.flipped .flashcard-front {
  pointer-events: none;
}

.flashcard-content {
  text-align: center;
}

.flashcard-content h2 {
  margin: 0 0 1 0px 0;
  font-size: 28px;
}

.flashcard-content h3 {
  margin: 0  0 10px 0;
}

.flashcard-content h4 {
  margin: 10px 0 5px 0;
  font-size: 14px;  
}

.flashcard-content p {
  margin: 5px  0;
  font-size: 16 px;
  color: #000000;
}

.flashcard-hint {
  font-size: 12px;
  opacity: 0.7; 
  margin-top: 10px;
  font-style: italic;
  color: #000000;
}

.flip-hint {
  position: absolute;
  bottom: 20px; 
  font-size: 12px ;
  opacity: 0.9; 
  color: #000000;
}

.flashcard-rating {
  display: flex;  
  justify-content: center;
  gap: 20px;
  margin-top: 30px; 
}

.rating-btn {
  padding: 12px 40px; 
  border: none; 
  border-radius: 8px; 
  cursor: pointer;  
  font-size: 16px;  
  transition: all 0.3s ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.rating-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Results Buttons Spacing */
.flashcard-study-container > div > div:last-child > a,
.quiz-content-wrapper > div > div:last-child > a {
  margin: 10px 8px;
  display: inline-block;
}

.good-btn {
  background: #f5f5f5;
  color: rgb(0, 0, 0); 
  border: 2px solid #29F641;
  border-radius: 18px;
  margin-bottom: 10px;
}

.good-btn:hover {
    border-color: #07d11f;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.763);
    transform: translateY(-5px);
}

.good-btn.marked {
  background: #29F641;
  border: 2px solid #29F641;
}

.bad-btn {
  background: #f5f5f5;
  color: rgb(0, 0, 0);
  border: 2px solid #6f42c1;
  border-radius: 18px;
  margin-bottom: 10px;
}

.bad-btn:hover {
  border-color: #7f53c1;
  box-shadow: 0 4px 12px rgba(111, 66, 193, 0.763);
  transform: translateY(-5px);
}

.bad-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.bad-btn.marked {
  background: #6f42c1;  
  border: 2px solid #fff  ; 
}

/* Multiple Choice Page */
.quiz-content-wrapper {
  max-width: 700px;
  margin: 40px auto;
  padding: 0 20px;
  margin-top: 17vh;
  overflow: hidden;
}

.back-to-quiz-btn {
  display: inline-block;
  margin-bottom: 10px;
  padding: 10px 20px;
  background: #244bf7ca;
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.back-to-quiz-btn:hover {
  background: #1c3bec;
  transform: translateX(-3px);
  box-shadow: 0 4px 12px rgba(38, 72, 227, 0.4);
}

.quiz-container {
  max-width: 700px;
  padding: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border: 2px solid #0558f2ca;
  animation: fadeInRight 0.6s ease-out;
  overflow: hidden;
}

.question-number {
  color: #3c5df0;
  font-weight: bold;
  margin-bottom: 10px;
}

.question {
  font-size: 20px;
  font-weight: 500;
  margin: 20px 0;
  color: #000000;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 30px 0;
  }

.option {
  padding: 15px 20px;
  border: 2px solid #0558f2ca;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  font-size: 16px;
}

.option:nth-child(1) {
  border-color: #1bd847;
}

.option:nth-child(2) {
  border-color: #0558f2ca;
}

.option:nth-child(3) {
  border-color: #ff7300;
}

.option:nth-child(4) {
  border-color: #6219ea;
}

.option:nth-child(1):hover:not(:disabled) {
  border-color: #07d11f;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.5);
  transform: translateY(-5px);
}

.option:nth-child(2):hover:not(:disabled) {
  border-color: #055fe8;
  box-shadow: 0 4px 12px rgba(5, 88, 242, 0.5);
  transform: translateY(-5px);
}

.option:nth-child(3):hover:not(:disabled) {
  border-color: #ff7300;
  box-shadow: 0 4px 12px rgba(255, 115, 0, 0.5);
  transform: translateY(-5px);
}

.option:nth-child(4):hover:not(:disabled) {
  border-color: #7f53c1;
  box-shadow: 0 4px 12px rgba(127, 83, 193, 0.5);
  transform: translateY(-5px);
}

.option.correct {
  border-color: #28a745;
  background: #d4edda;
  color: #155724;
}

.option.incorrect {
  border-color: #dc3545;
  background: #f8d7da;
  color: #721c24;
}

.option:disabled {
  cursor: not-allowed;
}

.prev-btn {
  padding: 12px 30px;
  background: #fcfcfc;
  color: rgb(0, 0, 0);
  border: 2px solid #0558f2ca;
  border-radius: 18px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s ease;
  width: 100%;
}

.prev-btn:hover:not(:disabled) {
  border: 2px solid #0558F2;
  box-shadow: 0 4px 12px rgba(5, 88, 242, 0.3);
  transform: translateY(-2px);
  transition: all 0.3s ease;
}

.prev-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.next-btn {
  padding: 12px 30px;
  background: #fcfcfc;
  color: rgb(0, 0, 0);
  border: 2px solid #0558f2ca;
  border-radius: 18px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s ease;
  width: 100%;
}

.next-btn:hover:not(:disabled) {
  border: 2px solid #0558F2;
  box-shadow: 0 4px 12px rgba(5, 88, 242, 0.3);
  transform: translateY(-2px);
  transition: all 0.3s ease;
}

.next-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* About Page */
#books-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: auto;
  z-index: -1;
  opacity: 0.3;
}

.about-demo {
  max-width: 800px;
  margin: 0px auto;
  padding: 80px 40px;
  margin-top: 55vh;
  overflow: hidden;
}

.about-demo h2 {
    color: #000000;
    margin-bottom: 50px;
    text-align: center;
    font-size: 36px;
}

.about-demo p {
    color: #000000;
    font-size: 18px;
    max-width: 100%;
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.6;
    letter-spacing: 4%;
}

.objectives {
    max-width: 1200px;
    margin: 0px auto;
    margin-top: 20vh;
    padding: 80px 30px;
}

.objectives h2 {
    color: #000000;
    margin-bottom: 50px;
    text-align: center;
    font-size: 36px;
}

.objectives .containers {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 40px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    overflow: hidden;
}

#blue-card {
  grid-column: 1 / 3;
}

#green-card {
  grid-column: 3 / 5;
}

#yellow-card {
  grid-column: 5 / 7;
}

#orange-card {
  grid-column: 2 / 4;
}

#purple-card {
  grid-column: 4 / 6;
}

.obj-cards {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 40px 30px;
    background-color: #f9f9f9;
    border-radius: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-height: 280px;
    margin: 20px 10px;
}

#orange-card, #purple-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.obj-cards img {
    width: 60px;
    height: auto;
    margin-bottom: 18px;
}

.obj-cards p {
    color: #000000;
    font-size: 18px;
    max-width: 100%;
    text-align: center;
    margin-bottom: 20px;
}

#blue-card {
    color: #0558F2;
    border: 2px solid #0558F2;
    flex: 1;
    min-width: 250px;
    transition: all 0.3s ease;
}

#blue-card:hover {
    border-color: #055fe8;
    box-shadow: 0 4px 12px rgba(5, 88, 242, 0.763);
    transform: translateY(-5px);
}

#blue-card p {
    color: #0558F2;
}

#green-card {
    color: #29F641;
    border: 2px solid #29F641;
    flex: 1;
    min-width: 250px;
    transition: all 0.3s ease;
}

#green-card:hover {
    border-color: #07d11f;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.763);
    transform: translateY(-5px);
}

#green-card p {
    color: #28a745;
}

#yellow-card {
    color: #adb605;
    border: 2px solid #D9E31F;
    flex: 1;
    min-width: 250px;
    transition: all 0.3s ease;
}

#yellow-card:hover {
    border-color: #e3e706;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.763);
    transform: translateY(-5px);
}

#yellow-card p {
    color: #ffc107;
}

#orange-card {
    color: #EB8525;
    border: 2px solid #EB8525;
    flex: 1;
    min-width: 250px;
    transition: all 0.3s ease;
}

#orange-card:hover {
    border-color: #ff784e;
    box-shadow: 0 4px 12px rgba(255, 87, 34, 0.763);
    transform: translateY(-5px);
}

#orange-card p {
    color: #ff5722;
}

#purple-card {
    color: #6f42c1;
    border: 2px solid #0558F2;
    flex: 1;
    min-width: 250px;
    transition: all 0.3s ease;
}

#purple-card:hover {
    border-color: #7f53c1;
    box-shadow: 0 4px 12px rgba(111, 66, 193, 0.763);
    transform: translateY(-5px);
}

#purple-card p {
    color: #6f42c1;
}

.purpose-card {
    color: #000000;
    border: 2px solid #150ee7;
    transition: all 0.3s ease;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 35vh;
    width: 650px;
    max-width: 55%;
    margin: 20vh auto;
    padding: 40px;
    overflow: hidden;
}

.purpose-card:hover {
    border-color: #0047B2;
    box-shadow: 0 8px 24px rgba(21, 14, 231, 0.3);
    transform: translateY(-5px);
}

.purpose-card h2 {
    color: #150ee7;
    font-size: 24px;
    margin: 20px auto;
    letter-spacing: 3%;
}

.purpose-card p {
    color: #000000;
    font-size: 18px;
    max-width: 100%;
    text-align: center;
    margin-bottom: 20px;
    letter-spacing: 2%;
}

.purpose-card #paragraph {
  margin-bottom: 50px;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 50px;
  padding: 50px 60px;
  background: linear-gradient(180deg, #0047B2 0%, #0558F2 100%);
  border-radius: 500px 500px 0 0;
  box-shadow: 0 -8px 20px rgba(5, 88, 242, 0.2);
  position: relative;
  width: 100%;
  margin-top: 50vh;
}

.footer p {
  font-size: 18px;
  color: #fff;
  font-weight: 500;
  margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  body {
    overflow-x: hidden;
  }

  #dictionary-container {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    padding: 15px;
  }

  #home-nav {
    flex-direction: column;
    gap: 10px;
    margin: 10px auto;
  }

  #home-nav a:nth-last-child(1) {
    margin-left: 0;
  }

  .filterarea {
    flex-direction: column;
    padding: 0 15px;
  }

  .filterarea select,
  .filterarea input.search {
    min-width: 100%;
  }

  #details-container {
    margin: 15px;
    padding: 15px;
  }

  .textarea {
    max-width: 100% !important;
    grid-column: 1 / -1;
    text-align: left;
  }

  .imagearea {
    max-width: 100% !important;
    grid-column: 1 / -1;
  }

  .textarea h1 {
    font-size: 24px;
  }

  .pagination button {
    padding: 8px 12px;
    font-size: 12px;
  }

  /* Home Page Mobile */
  .home-container {
    flex-direction: column;
    padding: 20px;
    gap: 20px;
    margin-top: 20vh;
  }

  .textarea {
    margin-left: 0 !important;
    max-width: 100%;
  }

  .textarea h5 {
    margin-top: 20px;
    font-size: 18px;
  }

  .textarea h1 {
    font-size: 28px;
    margin-top: 10px;
  }

  .textarea p {
    font-size: 14px;
  }

  .imagearea img {
    max-width: 100%;
  }

  /* Navbar Mobile */
  .navbar {
    position: fixed;
    width: 90%;
    gap: 10px;
    padding: 10px 15px;
    border-radius: 30px;
    font-size: 12px;
  }

  .navbar a {
    padding: 6px 10px;
    font-size: 12px;
  }

  .navbar img {
    height: 30px;
    margin-right: 10px;
  }

  .home-navbar {
    gap: 20px;
    padding: 15px 30px;
    border-radius: 0 0 300px 300px;
  }

  .home-navbar a {
    font-size: 14px;
    padding: 8px 15px;
  }

  .home-navbar img {
    height: 30px;
    left: 30px;
  }

  .home-navbar .demo-title {
    right: 30px;
    font-size: 12px;
    padding: 6px 12px;
  }

  /* Details Page Mobile */
  #detail-container {
    max-width: 90%;
    padding: 15px;
    margin: 20vh auto 30px;
  }

  #detail-container h1 {
    font-size: 20px;
  }

  #detail-container section h3 {
    font-size: 18px;
  }

  #detail-container section p,
  #detail-container section li {
    font-size: 14px;
    line-height: 1.8;
  }

  /* Objectives Mobile */
  .objectives {
    padding: 40px 15px;
    margin-top: 10vh;
  }

  .objectives h2 {
    font-size: 24px;
    margin-bottom: 30px;
  }

  .objectives .containers {
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 100%;
    overflow: hidden;
  }

  #blue-card,
  #green-card,
  #yellow-card,
  #orange-card,
  #purple-card {
    grid-column: auto;
  }

  .obj-cards {
    padding: 30px 20px;
    min-height: auto;
  }

  /* Purpose Card Mobile */
  .purpose-card {
    width: 90%;
    max-width: 100%;
    min-height: 30vh;
    margin: 20vh auto;
    padding: 20px;
  }

  .purpose-card h2 {
    font-size: 18px;
  }

  .purpose-card p {
    font-size: 14px;
  }

  /* Footer Mobile */
  .footer {
    padding: 30px 20px;
    gap: 20px;
    margin-top: 30vh;
  }

  .footer p {
    font-size: 14px;
    margin: 0;
  }

  /* About Page Mobile */
  .about-demo {
    padding: 40px 15px;
    margin-top: 15vh;
  }

  .about-demo h2 {
    font-size: 24px;
  }

  .about-demo p {
    font-size: 14px;
  }

  #books-bg {
    opacity: 0.1;
  }

  h1 {
    margin-top: 12vh;
    font-size: 24px;
  }

  .learnmore {
    padding: 12px 30px;
    font-size: 14px;
  }

  .flashcard-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 10px;
    padding: 10px;
  }

  .nav-arrow {
    padding: 6px 10px;
    font-size: 10px;
    width: 70px;
    flex: 0 0 70px;
    border-radius: 12px;
    margin: 0;
  }

  .flashcard-progress {
    font-size: 12px;
    flex: 1;
  }

  .flashcard-container {
    height: 300px;
    max-width: 100%;
    padding: 0 10px;
  }

  .flashcard-rating {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
  }

  .rating-btn {
    padding: 10px 20px;
    font-size: 14px;
    width: 100%;
  }

  /* Results Buttons Mobile Spacing */
  .flashcard-study-container > div > div:last-child > a,
  .quiz-content-wrapper > div > div:last-child > a {
    display: block;
    margin: 12px auto !important;
    width: 80%;
    max-width: 300px;
    padding: 12px 20px !important;
    border-radius: 18px !important;
  }

  /* MCQ Result Container Spacing */
  .quiz-container > div > div:last-child {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
  }

  .quiz-container > div > div:last-child > a {
    display: block;
    margin: 6px auto !important;
    width: 85%;
    max-width: 320px;
    padding: 12px 20px !important;
    border-radius: 18px !important;
  }
}

/* Tablet Landscape and Medium Screens (768px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  #dictionary-container {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding: 25px;
  }

  .card {
    padding: 25px;
  }

  .home-container {
    padding: 30px 40px;
    gap: 30px;
    flex-direction: column;
    align-items: center;
  }

  .textarea {
    max-width: 100%;
    margin-left: 0;
  }

  .textarea h1 {
    font-size: 36px;
  }

  .textarea p {
    font-size: 16px;
  }

  .imagearea img {
    max-width: 500px;
  }

  .navbar {
    width: auto;
    gap: 20px;
    padding: 12px 25px;
  }

  .navbar a {
    font-size: 14px;
    padding: 8px 12px;
  }

  .home-navbar {
    gap: 40px;
    padding: 20px 50px;
  }

  .home-navbar a {
    font-size: 16px;
  }

  h1 {
    font-size: 32px;
    margin-top: 12vh;
  }

  #detail-container {
    max-width: 90%;
    padding: 25px;
    margin: 15vh auto 30px;
  }

  .objectives {
    padding: 60px 25px;
    margin-top: 15vh;
  }

  .objectives h2 {
    font-size: 32px;
  }

  .objectives .containers {
    grid-template-columns: repeat(2, 1fr);
  }

  .purpose-card {
    width: 80%;
    min-height: 45vh;
    margin: 20vh auto;
  }

  .filterarea {
    gap: 15px;
  }

  .filterarea select,
  .filterarea input {
    width: 220px;
  }

  .flashcard-rating {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-direction: row;
  }

  .rating-btn {
    padding: 12px 40px;
    width: auto;
  }
}

/* Small Tablets and Large Phones (600px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
  #dictionary-container {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    padding: 20px;
  }

  .card {
    padding: 25px;
  }

  .card h2 {
    font-size: 16px;
  }

  .card p {
    font-size: 13px;
  }

  .home-container {
    padding: 25px 30px;
    gap: 20px;
    flex-direction: column;
    margin-top: 15vh;
  }

  .textarea h1 {
    font-size: 32px;
  }

  .textarea h5 {
    font-size: 20px;
    margin-top: 60px;
  }

  .textarea p {
    font-size: 15px;
  }

  .imagearea img {
    max-width: 100%;
  }

  .navbar {
    width: 85%;
    gap: 15px;
    padding: 10px 15px;
  }

  .navbar a {
    font-size: 13px;
    padding: 7px 11px;
  }

  .home-navbar {
    gap: 30px;
    padding: 18px 40px;
  }

  .home-navbar a {
    font-size: 15px;
    padding: 9px 15px;
  }

  h1 {
    font-size: 28px;
    margin-top: 13vh;
  }

  #detail-container {
    max-width: 90%;
    padding: 20px;
    margin: 18vh auto 25px;
  }

  #detail-container h1 {
    font-size: 22px;
  }

  #detail-container section h3 {
    font-size: 19px;
  }

  .objectives {
    padding: 50px 20px;
    margin-top: 12vh;
  }

  .objectives h2 {
    font-size: 28px;
    margin-bottom: 25px;
  }

  .objectives .containers {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .obj-cards {
    padding: 35px 25px;
  }

  .purpose-card {
    width: 85%;
    min-height: 35vh;
    margin: 18vh auto;
    padding: 20px;
  }

  .purpose-card h2 {
    font-size: 20px;
  }

  .filterarea {
    flex-direction: column;
    gap: 12px;
    padding: 0 15px;
  }

  .filterarea select,
  .filterarea input {
    width: 100%;
  }
}

/* Extra Small Phones (max-width: 480px) */
@media (max-width: 480px) {

  body {
    overflow-x: hidden;
  }

  #dictionary-container {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }

  .card {
    padding: 20px;
  }

  .card h2 {
    font-size: 15px;
  }

  .card p {
    font-size: 12px;
  }

  .home-container {
    padding: 15px 15px;
    gap: 15px;
    flex-direction: column;
    margin-top: 20vh;
  }

  .textarea {
    margin-left: 0;
  }

  .textarea h5 {
    margin-top: 40px;
    font-size: 16px;
  }

  .textarea h1 {
    font-size: 24px;
    margin-top: 10px;
    line-height: 1.4;
  }

  .textarea p {
    font-size: 13px;
    line-height: 1.5;
  }

  .imagearea img {
    max-width: 100%;
  }

  .navbar {
    width: 95%;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 20px;
    top: 10px;
  }

  .navbar img {
    height: 25px;
    margin-right: 5px;
  }

  .navbar a {
    padding: 5px 8px;
    font-size: 11px;
    border-radius: 15px;
  }

  .home-navbar {
    gap: 0px;
    padding: 12px 12px;
    border-radius: 0 0 200px 200px;
  }

  .home-navbar a {
    font-size: 12px;
    padding: 7px 8px;
  }

  .home-navbar img {
    height: 25px;
    left: 20px;
  }

  .home-navbar .demo-title {
    right: 20px;
    font-size: 10px;
    padding: 5px 8px;
  }

  h1 {
    font-size: 20px;
    margin-top: 15vh;
  }

  #detail-container {
    max-width: 95%;
    padding: 12px;
    margin: 22vh auto 20px;
  }

  #detail-container h1 {
    font-size: 18px;
  }

  #detail-container section h3 {
    font-size: 16px;
  }

  #detail-container section p,
  #detail-container section li {
    font-size: 12px;
    line-height: 1.6;
  }

  .objectives {
    padding: 30px 12px;
    margin-top: 8vh;
  }

  .objectives h2 {
    font-size: 22px;
    margin-bottom: 20px;
  }

  .objectives .containers {
    grid-template-columns: 1fr;
    gap: 15px;
    max-width: 100%;
  }

  .obj-cards {
    padding: 25px 15px;
    min-height: auto;
  }

  .obj-cards img {
    width: 50px;
  }

  .obj-cards p {
    font-size: 13px;
  }

  .purpose-card {
    width: 95%;
    max-width: 100%;
    min-height: 40vh;
    margin: 15vh auto 20px;
    padding: 15px;
  }

  .purpose-card h2 {
    font-size: 16px;
    margin: 10px auto;
  }

  .purpose-card p {
    font-size: 12px;
    margin-bottom: 15px;
  }

  .footer {
    padding: 20px 15px;
    gap: 15px;
    margin-top: 20vh;
  }

  .footer p {
    font-size: 12px;
  }

  .about-demo {
    padding: 30px 12px;
    margin-top: 20vh;
  }

  .about-demo h2 {
    font-size: 20px;
  }

  .about-demo p {
    font-size: 12px;
  }

  .learnmore {
    padding: 10px 25px;
    font-size: 12px;
    margin-top: 15px;
  }

  .filterarea {
    flex-direction: column;
    gap: 10px;
    padding: 0 10px;
    margin: 10px 0;
  }

  .filterarea select,
  .filterarea input {
    width: 100%;
    padding: 12px 15px;
    font-size: 14px;
  }

  .flashcard-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 10px;
    padding: 10px;
  }

  .nav-arrow {
    padding: 6px 10px;
    font-size: 10px;
    width: 70px;
    flex: 0 0 70px;
    border-radius: 12px;
    margin: 0;
  }

  .flashcard-progress {
    font-size: 12px;
    flex: 1;
  }

  .flashcard-container {
    height: 300px;
    max-width: 100%;
    padding: 0 10px;
  }

  .flashcard-rating {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
  }

  .rating-btn {
    padding: 10px 20px;
    font-size: 14px;
    width: 100%;
  }

  #books-bg {
    opacity: 0.05;
  }
}

.animate-on-scroll {
    opacity: 0;          
    transition: all 1.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-on-scroll.slide-left.visible {
    opacity: 1;
    transform: translateX(0);
    transition: all 1.6s cubic-bezier(0.19, 1, 0.22, 1);
    transition-delay: 0.1s;
}

.animate-on-scroll.slide-left {
    transform: translateX(-120px);
}

.animate-on-scroll.slide-right.visible {
    opacity: 1;
    transform: translateX(0);
    transition: all 1.6s cubic-bezier(0.19, 1, 0.22, 1);
    transition-delay: 0.1s;
}

.animate-on-scroll.slide-right {
    transform: translateX(120px); 
}

.animate-on-scroll.slide-top.visible {
    opacity: 1;
    transform: translateY(0);
    transition: all 1.6s cubic-bezier(0.19, 1, 0.22, 1);
    transition-delay: 0.1s;
}

.animate-on-scroll.slide-top {
    transform: translateY(-120px);
}

.animate-on-scroll.slide-bottom.visible {
    opacity: 1;
    transform: translateY(0);
    transition: all 1.6s cubic-bezier(0.19, 1, 0.22, 1);
    transition-delay: 0.1s;
}

.animate-on-scroll.slide-bottom {
    transform: translateY(120px);
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes fadeInBottom {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideOutLeft {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-100px);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100px);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}