@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --primary-color: #6366f1;
  --primary-hover: #4f46e5;
  --primary: #4f46e5; /* Added for header consistency */
  --secondary-color: #f8fafc;
  --text-main: #1e293b;
  --text-primary: #1e293b; /* Added for header consistency */
  --text-muted: #64748b;
  --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  --white: #ffffff;
  --border-color: #e2e8f0;
  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--text-main);
  background-color: #f1f5f9;
}

.main-content {
  margin-top: 10%;
  padding: 40px 20px;
}

.quiz-setup-container {
  max-width: 60%;
  margin:auto ;
  
  background: var(--white);
  padding: 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.quiz-setup-container h1 {
  margin: 0 0 12px;
  color: var(--text-main);
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  background: linear-gradient(to right, #6366f1, #a855f7);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.desc {
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 1.1rem;
  line-height: 1.6;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}

.grid.full {
  grid-template-columns: 1fr;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.95rem;
}

select,
input[type="number"],
input[type="text"] {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--text-main);
  font-size: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

select:focus,
input[type="number"]:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

select:disabled {
  background: #f1f5f9;
  cursor: not-allowed;
  opacity: 0.7;
}

/* New Input with Action layout */
.input-with-action {
  display: flex;
  gap: 12px;
}

.input-with-action select {
  flex: 1;
}

.topic-btn {
  background: #8b5cf6;
  color: white;
  white-space: nowrap;
  padding: 0 24px;
  height: 52px; /* Matches select height */
  border-radius: var(--radius-md);
  font-weight: 700;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(139, 92, 246, 0.2);
}

.topic-btn:hover {
  background: #7c3aed;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(139, 92, 246, 0.3);
}

/* Chapter selector */
.chapter-selector {
  background: #f8fafc;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  min-height: 140px;
  max-height: 250px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.chapter-item {
  background: var(--white);
  border: 1px solid var(--border-color);
  padding: 12px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chapter-item:hover {
  border-color: var(--primary-color);
  background: #f5f3ff;
  transform: translateY(-1px);
}

.chapter-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color);
  cursor: pointer;
}

.chapter-item label {
  margin: 0;
  cursor: pointer;
  flex: 1;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-main);
}

/* Misc */
.selector-hint {
  grid-column: 1 / -1;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: 40px 20px;
}

.actions {
  margin-top: 40px;
  display: flex;
  gap: 16px;
  justify-content: flex-end;
}

.btn {
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn.primary {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn.primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.25);
}

.btn.secondary {
  background: #f1f5f9;
  color: var(--text-main);
  border: 2px solid var(--border-color);
}

.btn.secondary:hover {
  background: var(--border-color);
}

.hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.hint::before {
  content: 'ⓘ';
  font-weight: bold;
}

/* Custom Select Arrow */
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 18px;
  padding-right: 48px;
}

/* Scrollbar */
/* Custom Dropdown Styles */
.custom-dropdown {
  position: relative;
  width: 100%;
  user-select: none;
}

.dropdown-trigger {
  width: 100%;
  padding: 14px 18px;
  background: white;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 600;
  color: var(--text-main);
  box-shadow: 0 4px 6px -1px var(--shadow-sm);
}

.dropdown-trigger:hover {
  border-color: var(--primary-color);
  box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.1);
}

.custom-dropdown.active .dropdown-trigger {
  border-color: var(--primary-color);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.dropdown-trigger i {
  transition: transform 0.3s ease;
  color: var(--text-muted);
}

.custom-dropdown.active .dropdown-trigger i {
  transform: rotate(180deg);
  color: var(--primary-color);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 2px solid var(--primary-color);
  border-top: none;
  border-bottom-left-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
  z-index: 1000;
  display: none;
  flex-direction: column;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  animation: dropdownFadeIn 0.2s ease-out;
  overflow: hidden;
}

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

.custom-dropdown.active .dropdown-menu {
  display: flex;
}

.dropdown-search {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
  background: #f8fafc;
}

.dropdown-search input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.dropdown-search input:focus {
  border-color: var(--primary-color);
}

.dropdown-options {
  max-height: 250px;
  overflow-y: auto;
}

.dropdown-option {
  padding: 12px 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
  font-weight: 500;
}

.dropdown-option:hover {
  background: #f5f3ff;
  color: var(--primary-color);
  padding-left: 22px;
}

.dropdown-option.selected {
  background: #eef2ff;
  color: var(--primary-color);
  font-weight: 700;
}

.dropdown-option.no-results {
  color: var(--text-muted);
  font-style: italic;
  justify-content: center;
  pointer-events: none;
}

.dropdown-skeleton {
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-item {
  height: 20px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  border-radius: 4px;
  animation: skeletonLoading 1.5s infinite;
}

@keyframes skeletonLoading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.custom-dropdown.disabled {
  opacity: 0.6;
  pointer-events: none;
}

.custom-dropdown.disabled .dropdown-trigger {
  background: #f1f5f9;
}

@media (max-width: 768px) {
  .dropdown-menu {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 20px 20px 0 0;
    border: none;
    max-height: 80vh;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.2);
    animation: slideUpMobile 0.3s ease-out;
  }
  
  @keyframes slideUpMobile {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }
  
  .dropdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    display: none;
  }
  
  .custom-dropdown.active .dropdown-overlay {
    display: block;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .quiz-setup-container {
    min-width: 100%;
    padding: 24px;
    margin: auto;
  }
  
  .input-with-action {
    flex-direction: column;
  }
  
  .topic-btn {
    width: 100%;
  }
  
  .actions {
    flex-direction: column-reverse;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
}

/* SEO Article Section Styles */
.seo-article-section {
    max-width: 60%;
    margin: 80px auto 100px;
    padding: 0;
}

.seo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.seo-card {
    background: #ffffff;
    padding: 35px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    transform: translateY(20px);
    animation: smoothFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    will-change: transform, box-shadow;
}

.seo-card:nth-child(1) { animation-delay: 0.1s; }
.seo-card:nth-child(2) { animation-delay: 0.2s; }
.seo-card:nth-child(3) { animation-delay: 0.3s; }
.seo-card:nth-child(4) { animation-delay: 0.4s; }

.seo-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.seo-icon {
    font-size: 2.2rem;
    margin-bottom: 24px;
    background: rgba(99, 102, 241, 0.05);
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.seo-card-title {
    color: var(--text-main);
    margin-top: 0;
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.seo-card-text {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 0;
}

.seo-footer {
    margin-top: 80px;
    text-align: center;
    color: var(--text-muted);
    font-size: 1.15rem;
    background: #f8fafc;
    padding: 40px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    line-height: 1.8;
    opacity: 0;
    animation: smoothFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.5s;
}

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

@media (max-width: 1024px) {
    .seo-article-section {
        max-width: 95%;
    }
}

@media (max-width: 768px) {
    .seo-article-section {
        margin: 40px auto 60px;
    }
    
    .seo-card {
        padding: 24px;
    }
}

