/* General Layout */
body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #f7f8fc;
  color: #333;
}

header {
  background: #c62828;
  text-align: center;
  padding: 0.8rem 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Logo image link */
.logo-link {
  display: inline-block;
  text-decoration: none;
}

.site-logo {
  height: 60px;           /* Adjust size for perfect fit */
  width: auto;
  vertical-align: middle;
  transition: transform 0.2s ease;
}

.site-logo:hover {
  transform: scale(1.05); /* subtle hover effect */
}


/* Main Layout */
main {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  gap: 2rem;
}

/* Sidebar styling */
aside {
  width: 250px;
  background: #fff;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

aside h3 {
  text-align: center;
  margin-bottom: 1rem;
}


aside ul {
  list-style: none;
  padding: 0;
}

aside ul li {
  margin: 0.5rem 0;
}

aside ul li a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
}

aside ul li a:hover {
  color: #c62828;
}

.sidebar-category-select {
  padding: 0.6rem;
  font-size: 1rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  outline: none;
}

.sidebar-category-select:focus {
  border-color: #d8143c;
  box-shadow: 0 0 4px rgba(216, 20, 60, 0.3);
}

/* Quiz Content */
section.content {
  flex: 1;
  background: #fff;
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

#quiz {
  margin-top: 1.5rem;
}

#quiz h3 {
  color: #c62828;
}

#quiz button {
  display: block;
  width: 100%;
  background: #c62828;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 1rem;
  margin: 0.5rem 0;
  cursor: pointer;
  transition: background 0.3s ease;
}

#quiz button:hover {
  background: #b71c1c;
}
/* Adjust search bar width now that category moved */
.filter-bar {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.filter-bar input {
  width: 100%;
  max-width: 500px;
  padding: 0.6rem 1rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
}

.filter-bar input:focus {
  border-color: #d8143c;
  box-shadow: 0 0 4px rgba(216, 20, 60, 0.3);
}

/* ===== Quiz Cards ===== */
.quiz-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.2rem;
}

.quiz-card {
  position: relative;
  background: #fff;
  border-radius: 12px;
  padding: 1.2rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden;
}

.quiz-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}

/* 🏷️ Category Badge (hidden until hover) */
.quiz-category-badge {
  position: absolute;
  top: 10px;
  right: 12px;
  background: #ffffffcc;
  border: 1px solid #eee;
  border-radius: 20px;
  padding: 0.2rem 0.6rem;
  font-size: 0.9rem;
  opacity: 100;
  transform: translateY(-5px);
  transition: all 0.3s ease;
  font-weight: 500;
}

.quiz-card:hover .quiz-category-badge {
  opacity: 1;
  transform: translateY(0);
}
.share-section {
  text-align: center;
  margin-top: 1.5rem;
  background: #fff9f9;
  border: 1px solid #ffe3e7;
  border-radius: 10px;
  padding: 1rem;
}

.share-section h3 {
  color: #d8143c;
  margin-bottom: 0.8rem;
}

.share-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.share-btn {
  background: #d8143c;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s ease, transform 0.2s ease;
}

.share-btn:hover {
  background: #b10e32;
  transform: scale(1.05);
}


.quiz-btn {
  display: inline-block;
  background: #d8143c;
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  margin-top: 0.5rem;
}

.quiz-btn:hover {
  opacity: 0.9;
}

.latest-result {
  background: #f9f9f9;
  border-radius: 10px;
  padding: 0.8rem;
  margin-top: 1rem;
  box-shadow: inset 0 0 6px rgba(0,0,0,0.05);
}

.latest-result h4 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  text-align: center;
  color: #d8143c;
}

#latestResultDisplay p {
  font-size: 0.9rem;
  color: #444;
  text-align: center;
}

.latest-result-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff8f0;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  transition: transform 0.2s ease;
}

.latest-result-card:hover {
  transform: translateY(-2px);
}

.latest-result-thumb {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid #ddd;
}

.no-thumb {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.latest-result-info {
  flex: 1;
  font-size: 14px;
}

.latest-result-info strong {
  font-size: 15px;
  color: #d8143c;
}

.latest-result-time {
  font-size: 12px;
  color: #888;
}


.filter-bar {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-bar input,
.filter-bar select {
  padding: 0.6rem 1rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
}

.filter-bar input:focus,
.filter-bar select:focus {
  border-color: #d8143c;
  box-shadow: 0 0 4px rgba(216, 20, 60, 0.3);
}

.quiz-category {
  display: block;
  color: #666;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}


.adsbygoogle {
  border-radius: 8px;
  overflow: hidden;
  margin: 10px auto;
}

/* Quiz Meta (Question Count) */
.quiz-meta {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #444;
  font-weight: 500;
}

.quiz-meta .question-count {
  display: inline-block;
  background: #fff8f8;
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 0.2rem 0.6rem;
  transition: background 0.3s ease, border-color 0.3s ease;
}

/* Hover Effect for Quiz Cards */
.quiz-card {
  position: relative;
  background: #fff;
  border-radius: 12px;
  padding: 1.2rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  border: 1px solid transparent;
}

.quiz-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  border-color: #d8143c;
  background: #fff9f9;
}

.quiz-card:hover .question-count {
  background: #ffe6eb;
  border-color: #d8143c;
  color: #d8143c;
}

/* Keep the category badge visible */
.quiz-category-badge {
  position: absolute;
  top: 10px;
  right: 12px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 20px;
  padding: 0.25rem 0.6rem;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.quiz-card:hover .quiz-category-badge {
  background: #d8143c;
  color: #fff;
  border-color: #d8143c;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #d8143c;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 0.9s linear infinite;
  margin: 40px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.ai-result {
  background: #fff8f8;
  border: 2px solid #d8143c;
  border-radius: 10px;
  padding: 16px;
  margin: 20px 0;
  font-size: 1.1rem;
  line-height: 1.5;
}



footer {
  background: #c62828;
  color: white;
  text-align: center;
  padding: 1rem;
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
  main {
    flex-direction: column;
  }

  aside {
    display: none;
  }
}
