:root {
  --hero-bg: #192231;
  --hero-accent: #8b71ff;
  --body-bg: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-accent: #7c3aed;
  --purple-light: #ede9fe;
  --toggle-inactive: #2c384d;
  --border-color: #e2e8f0;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 20px 30px -10px rgba(124, 58, 237, 0.12), 0 10px 15px -5px rgba(0, 0, 0, 0.05);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--body-bg);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* HERO SECTION */
.hero-section {
  background-color: var(--hero-bg);
  color: #ffffff;
  padding: 32px 24px 120px 24px;
  position: relative;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto 48px auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-link {
  text-decoration: none;
  display: inline-block;
  transition: var(--transition);
}

.logo-link:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.logo-text {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #a78bfa, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
}

.nav-link:hover {
  color: #ffffff;
}

.btn-trial {
  color: #ffffff;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 6px;
  transition: var(--transition);
}

.btn-trial:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* HERO CONTENT & SEARCH */
.hero-content {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.hero-title {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 32px;
  letter-spacing: -0.02em;
}

.search-box {
  position: relative;
  width: 100%;
  max-width: 640px;
  margin: 0 auto 28px auto;
}

.search-box input {
  width: 100%;
  padding: 16px 48px 16px 20px;
  font-size: 0.95rem;
  font-family: inherit;
  border: 1px solid transparent;
  border-radius: 8px;
  background-color: #ffffff;
  color: #0f172a;
  outline: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  transition: var(--transition);
}

.search-box input::placeholder {
  color: #94a3b8;
}

.search-box input:focus {
  border-color: #a78bfa;
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.3), 0 4px 14px rgba(0, 0, 0, 0.15);
}

.search-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

/* TOGGLE BUTTONS */
.view-toggle {
  display: inline-flex;
  background: var(--toggle-inactive);
  padding: 4px;
  border-radius: 8px;
  gap: 4px;
}

.toggle-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.toggle-btn:hover {
  color: #ffffff;
}

.toggle-btn.active {
  background: #ffffff;
  color: #1e293b;
  box-shadow: var(--shadow-sm);
}

/* CONTENT & CARDS CONTAINER */
.content-container {
  max-width: 1100px;
  margin: -70px auto 60px auto;
  padding: 0 24px;
  width: 100%;
  flex: 1;
  position: relative;
  z-index: 10;
}

/* CARDS WRAPPER - GRID MODE */
.cards-wrapper.grid-view {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* CARDS WRAPPER - LIST MODE */
.cards-wrapper.list-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* CARD STYLES */
.card-item {
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: #c4b5fd;
}

/* GRID CARD LAYOUT */
.grid-view .card-item {
  padding: 36px 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 220px;
}

.grid-view .card-icon-wrapper {
  width: 56px;
  height: 56px;
  background: #f5f3ff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: #7c3aed;
  transition: var(--transition);
}

.grid-view .card-item:hover .card-icon-wrapper {
  background: #ede9fe;
  transform: scale(1.08);
}

.grid-view .card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 12px;
}

.grid-view .card-articles-count {
  font-size: 0.85rem;
  font-weight: 600;
  color: #8b5cf6;
  margin-bottom: 6px;
}

.grid-view .card-updated {
  font-size: 0.78rem;
  color: #94a3b8;
}

/* LIST CARD LAYOUT */
.list-view .card-item {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.list-view .card-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.list-view .card-icon-wrapper {
  width: 48px;
  height: 48px;
  background: #f5f3ff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7c3aed;
  flex-shrink: 0;
}

.list-view .card-info {
  display: flex;
  flex-direction: column;
}

.list-view .card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.list-view .card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.list-view .card-right {
  display: flex;
  align-items: center;
  gap: 24px;
  text-align: right;
}

.list-view .card-articles-count {
  font-size: 0.85rem;
  font-weight: 600;
  color: #8b5cf6;
  background: #f5f3ff;
  padding: 4px 10px;
  border-radius: 20px;
}

.list-view .card-updated {
  font-size: 0.8rem;
  color: #94a3b8;
  white-space: nowrap;
}

.list-view .card-arrow {
  color: #cbd5e1;
  transition: var(--transition);
}

.list-view .card-item:hover .card-arrow {
  color: #7c3aed;
  transform: translateX(4px);
}

/* NO RESULTS */
.no-results {
  background: #ffffff;
  border-radius: 12px;
  padding: 48px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.hidden {
  display: none !important;
}

/* MODAL STYLES */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: #ffffff;
  border-radius: 16px;
  max-width: 750px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  font-size: 1.8rem;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
  transition: var(--transition);
}

.modal-close:hover {
  color: #0f172a;
}

.modal-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 16px;
  background: #f8fafc;
}

.modal-icon {
  width: 48px;
  height: 48px;
  background: #ede9fe;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7c3aed;
  flex-shrink: 0;
}

.modal-header h2 {
  font-size: 1.25rem;
  color: #0f172a;
}

.modal-meta {
  font-size: 0.85rem;
  color: #64748b;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* MANUAL CONTENT FORMATTING */
.manual-topic-desc {
  font-size: 0.95rem;
  color: #475569;
  background: #f1f5f9;
  padding: 12px 16px;
  border-radius: 8px;
  border-left: 4px solid #8b5cf6;
}

.manual-articles-accordion {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.manual-article-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 20px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.manual-article-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}

.manual-article-content {
  font-size: 0.92rem;
  color: #334155;
  line-height: 1.6;
}

.manual-article-content p {
  margin-bottom: 10px;
}

.manual-article-content ul, .manual-article-content ol {
  margin-left: 20px;
  margin-bottom: 12px;
}

.manual-article-content li {
  margin-bottom: 6px;
}

.manual-article-content code {
  background: #f1f5f9;
  color: #6d28d9;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.85rem;
}

.manual-article-content h4 {
  font-size: 0.98rem;
  font-weight: 700;
  color: #1e293b;
  margin-top: 10px;
  margin-bottom: 6px;
}

/* CHAT WIDGET */
.chat-widget {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 100;
}

.chat-button {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #ffffff;
  border: none;
  box-shadow: 0 10px 20px rgba(99, 102, 241, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.chat-button:hover {
  transform: scale(1.08);
  box-shadow: 0 14px 28px rgba(99, 102, 241, 0.5);
}

/* RESPONSIVE DESIGN */
@media (max-width: 900px) {
  .cards-wrapper.grid-view {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .hero-section {
    padding: 24px 16px 100px 16px;
  }
  
  .hero-title {
    font-size: 1.75rem;
  }

  .cards-wrapper.grid-view {
    grid-template-columns: 1fr;
  }

  .content-container {
    margin-top: -50px;
    padding: 0 16px;
  }

  .list-view .card-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .list-view .card-right {
    width: 100%;
    justify-content: space-between;
  }
}
