/* SynexMedia Shared Styles */
:root {
  --bg: #0a0f1a;
  --bg-elevated: #0d1321;
  --panel: rgba(255, 255, 255, 0.04);
  --panel-hover: rgba(255, 255, 255, 0.07);
  --panel-strong: rgba(255, 255, 255, 0.08);
  --stroke: rgba(255, 255, 255, 0.08);
  --stroke-hover: rgba(255, 255, 255, 0.15);
  --text: #f0f4f8;
  --text-secondary: #94a3b8;
  --muted: #64748b;
  --accent: #3b82f6;
  --accent-light: #60a5fa;
  --accent-glow: rgba(59, 130, 246, 0.25);
  --success: #22c55e;
  --category-games: #8b5cf6;
  --category-tools: #06b6d4;
  --category-books: #f59e0b;
  --category-braintesters: #84cc16;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.5);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(139, 92, 246, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 80% 10%, rgba(59, 130, 246, 0.1), transparent),
    radial-gradient(ellipse 50% 30% at 50% 100%, rgba(6, 182, 212, 0.08), transparent);
  pointer-events: none;
  z-index: -1;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* Header */
.header {
  position: relative;
  padding: 48px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, var(--panel-strong), var(--panel));
  border: 1px solid var(--stroke);
  margin-bottom: 48px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.header::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 60%;
  height: 100%;
  background: radial-gradient(ellipse at 80% 20%, rgba(59, 130, 246, 0.15), transparent 60%);
  pointer-events: none;
}

.header-content {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
  z-index: 1;
}

.header-text {
  max-width: 640px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--accent-glow);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 20px;
}

.badge svg {
  width: 14px;
  height: 14px;
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 520px;
}

.header-visual {
  position: relative;
}

.header-logo {
  width: 280px;
  height: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition);
}

.header-logo:hover {
  transform: scale(1.02);
}

/* Navigation */
.nav {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.nav-btn:hover,
.nav-btn.active {
  background: var(--panel-hover);
  border-color: var(--stroke-hover);
  color: var(--text);
}

.nav-btn svg {
  width: 18px;
  height: 18px;
}

/* Page Navigation (breadcrumb style) */
.page-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.page-nav-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
}

.page-nav-home:hover {
  background: var(--panel-hover);
  border-color: var(--stroke-hover);
  color: var(--text);
}

.page-nav-home svg {
  width: 18px;
  height: 18px;
}

.page-nav-separator {
  color: var(--muted);
}

.page-nav-current {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

/* Category Navigation Tabs */
.category-nav {
  display: flex;
  gap: 8px;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
}

.category-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
}

.category-nav-link:hover {
  background: var(--panel-hover);
  color: var(--text);
}

.category-nav-link.active {
  background: var(--bg-elevated);
  color: var(--text);
}

.category-nav-link svg {
  width: 16px;
  height: 16px;
}

/* Category Section */
.category-section {
  margin-bottom: 48px;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.category-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--panel-strong);
  border: 1px solid var(--stroke);
}

.category-icon svg {
  width: 24px;
  height: 24px;
}

.category-icon.games {
  color: var(--category-games);
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.2);
}

.category-icon.tools {
  color: var(--category-tools);
  background: rgba(6, 182, 212, 0.1);
  border-color: rgba(6, 182, 212, 0.2);
}

.category-icon.books {
  color: var(--category-books);
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.2);
}

.category-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.category-count {
  font-size: 0.875rem;
  color: var(--muted);
  font-weight: 500;
}

/* Homepage Category Cards */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 48px;
}

.category-card {
  position: relative;
  background: linear-gradient(145deg, var(--panel-strong), var(--panel));
  border: 1px solid var(--stroke);
  border-radius: var(--radius-xl);
  padding: 48px 32px;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 320px;
}

.category-card:hover {
  transform: translateY(-4px);
  border-color: var(--stroke-hover);
  box-shadow: var(--shadow-lg);
}

.category-card.games:hover {
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 24px 64px rgba(139, 92, 246, 0.15);
}

.category-card.tools:hover {
  border-color: rgba(6, 182, 212, 0.4);
  box-shadow: 0 24px 64px rgba(6, 182, 212, 0.15);
}

.category-card.books:hover {
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 24px 64px rgba(245, 158, 11, 0.15);
}

.category-card.braintesters:hover {
  border-color: rgba(132, 204, 22, 0.4);
  box-shadow: 0 24px 64px rgba(132, 204, 22, 0.15);
}

.category-card-icon {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.category-card-icon svg {
  width: 40px;
  height: 40px;
}

.category-card.games .category-card-icon {
  background: rgba(139, 92, 246, 0.15);
  color: var(--category-games);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.category-card.tools .category-card-icon {
  background: rgba(6, 182, 212, 0.15);
  color: var(--category-tools);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.category-card.books .category-card-icon {
  background: rgba(245, 158, 11, 0.15);
  color: var(--category-books);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.category-card.braintesters .category-card-icon {
  background: rgba(132, 204, 22, 0.15);
  color: var(--category-braintesters);
  border: 1px solid rgba(132, 204, 22, 0.3);
}

.category-card-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.category-card-count {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.category-card-description {
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.6;
  max-width: 280px;
}

/* Subcategory */
.subcategory {
  margin-bottom: 32px;
}

.subcategory-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
  padding-left: 4px;
}

/* App Grid */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

/* App Card */
.app-card {
  position: relative;
  background: linear-gradient(145deg, var(--panel-strong), var(--panel));
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.app-card:hover {
  transform: translateY(-2px);
  border-color: var(--stroke-hover);
  box-shadow: var(--shadow-md);
  background: var(--panel-hover);
}

.app-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-md);
}

.app-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.app-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.app-tag {
  display: inline-flex;
  padding: 4px 10px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.app-description {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Detail Panel */
.detail-panel {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.detail-panel.open {
  opacity: 1;
  visibility: visible;
}

.detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.detail-content {
  position: relative;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.98);
  transition: transform 0.3s ease;
}

.detail-panel.open .detail-content {
  transform: translateY(0) scale(1);
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.detail-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.detail-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.detail-close:hover {
  background: var(--panel-hover);
  color: var(--text);
}

.detail-close svg {
  width: 20px;
  height: 20px;
}

.detail-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.detail-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.detail-badge svg {
  width: 14px;
  height: 14px;
}

.detail-badge.game {
  color: var(--category-games);
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.2);
}

.detail-badge.tool {
  color: var(--category-tools);
  background: rgba(6, 182, 212, 0.1);
  border-color: rgba(6, 182, 212, 0.2);
}

.detail-badge.book {
  color: var(--category-books);
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.2);
}

.detail-description {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 32px;
}

.detail-actions {
  display: flex;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: white;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px var(--accent-glow);
}

.btn-secondary {
  background: var(--panel);
  border: 1px solid var(--stroke);
  color: var(--text);
}

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

.btn svg {
  width: 18px;
  height: 18px;
}

/* Footer */
.footer {
  text-align: center;
  padding-top: 48px;
  border-top: 1px solid var(--stroke);
  margin-top: 48px;
}

.footer-text {
  font-size: 0.875rem;
  color: var(--muted);
}

.footer-brand {
  font-weight: 700;
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 900px) {
  .container {
    padding: 32px 16px 64px;
  }

  .header {
    padding: 32px 24px;
  }

  .header-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .header-visual {
    order: -1;
  }

  .header-logo {
    width: 200px;
  }

  .tagline {
    margin: 0 auto;
  }

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

  .detail-content {
    padding: 24px;
  }

  .page-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .category-nav {
    margin-left: 0 !important;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 24px 20px;
  }

  .nav {
    justify-content: center;
  }

  .category-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .detail-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

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

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

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--panel-strong);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--stroke-hover);
}

/* Book Reader Overlay */
.book-reader-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.book-reader-overlay.open {
  opacity: 1;
  visibility: visible;
}

.book-reader-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--stroke);
}

.book-reader-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.book-reader-close {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.book-reader-close:hover {
  background: var(--panel-hover);
  border-color: var(--stroke-hover);
}

.book-reader-close svg {
  width: 18px;
  height: 18px;
}

.book-reader-container {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1f3a 0%, var(--bg) 100%);
}

.book-reader-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--text-secondary);
}

.book-reader-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--stroke);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Flipbook Styles */
.flipbook {
  position: relative;
  width: 100%;
  max-width: 1600px;
  height: 80vh;
  margin: 0 auto;
  perspective: 2500px;
  perspective-origin: 50% 50%;
  transform-style: preserve-3d;
  transform-origin: center center;
  transition: transform 0.3s ease;
}

.flipbook-page {
  position: absolute;
  width: 50%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 1s cubic-bezier(0.645, 0.045, 0.355, 1),
              box-shadow 1s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.flipbook-page.left {
  left: 0;
  transform-origin: right center;
}

.flipbook-page.right {
  right: 0;
  transform-origin: left center;
}

.flipbook-page.flipping {
  z-index: 100;
}

.page-front {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: white;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  transform: rotateY(0deg);
}

.flipbook-page.flipping .page-front {
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2), 0 0 30px rgba(0, 0, 0, 0.3), 10px 0 25px rgba(0, 0, 0, 0.25);
}

.page-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: white;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
  transform: rotateY(180deg);
  overflow: hidden;
}

.page-front::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.1) 0%, transparent 10%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 1s ease;
  z-index: 10;
}

.flipbook-page.flipping .page-front::before {
  opacity: 1;
}

.page-content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  position: relative;
}

.page-content img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.book-spine {
  position: absolute;
  left: 50%;
  top: 0;
  width: 8px;
  height: 100%;
  background: linear-gradient(to bottom, #d4d4d4, #a3a3a3, #d4d4d4);
  transform: translateX(-50%);
  box-shadow: inset 2px 0 3px rgba(0, 0, 0, 0.3), inset -2px 0 3px rgba(0, 0, 0, 0.3);
  z-index: 50;
}

.page-indicator {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.9);
  padding: 0.5rem 1.5rem;
  border-radius: 2rem;
  font-size: 0.9rem;
  color: #0f172a;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
  .flipbook {
    height: 50vh;
  }
}

/* Reader Controls */
.book-reader-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 12px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--stroke);
  flex-wrap: wrap;
}

.reader-control-group {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--stroke);
}

.reader-control-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.reader-control-btn:hover {
  background: var(--panel-hover);
  color: var(--text);
}

.reader-control-btn:active {
  transform: scale(0.95);
}

.reader-control-btn svg {
  width: 20px;
  height: 20px;
}

.reader-control-btn.active {
  color: var(--category-books);
  background: rgba(245, 158, 11, 0.1);
}

.reader-control-btn.active svg {
  fill: var(--category-books);
}

.reader-page-display {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  min-width: 80px;
  text-align: center;
}

.reader-zoom-level {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  min-width: 50px;
  text-align: center;
}

/* Go to Page */
.goto-page-group {
  gap: 6px;
}

.goto-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.goto-input {
  width: 60px;
  padding: 6px 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  text-align: center;
  -moz-appearance: textfield;
}

.goto-input::-webkit-outer-spin-button,
.goto-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.goto-input:focus {
  outline: none;
  border-color: var(--category-books);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.goto-input::placeholder {
  color: var(--muted);
  font-weight: 400;
}

.goto-input.error {
  border-color: #ef4444;
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.goto-btn {
  padding: 6px 10px;
}

/* Bookmark Dropdown */
.bookmark-dropdown-container {
  position: relative;
}

.bookmark-toggle-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  width: auto;
  padding: 0 12px;
}

.bookmark-toggle-btn svg:first-child {
  width: 20px;
  height: 20px;
}

.dropdown-arrow {
  width: 14px !important;
  height: 14px !important;
  transition: transform 0.2s ease;
}

.bookmark-toggle-btn.open .dropdown-arrow {
  transform: rotate(180deg);
}

.bookmark-count {
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--category-books);
  color: #000;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.bookmark-count:empty,
.bookmark-count[data-count="0"] {
  display: none;
}

.bookmark-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 280px;
  background: var(--bg-elevated);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
}

.bookmark-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.bookmark-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--stroke);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text);
}

.bookmark-delete-all {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  color: #ef4444;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.bookmark-delete-all:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
}

.bookmark-delete-all svg {
  width: 14px;
  height: 14px;
}

.bookmark-list {
  max-height: 300px;
  overflow-y: auto;
}

.bookmark-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
}

.bookmark-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--stroke);
  cursor: pointer;
  transition: background var(--transition);
}

.bookmark-item:last-child {
  border-bottom: none;
}

.bookmark-item:hover {
  background: var(--panel-hover);
}

.bookmark-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bookmark-item-page {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text);
}

.bookmark-item-date {
  font-size: 0.7rem;
  color: var(--muted);
}

.bookmark-item-delete {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--muted);
  cursor: pointer;
  transition: all var(--transition);
}

.bookmark-item-delete:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.bookmark-item-delete svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 768px) {
  .book-reader-controls {
    gap: 12px;
    padding: 8px 12px;
  }
  .reader-control-group {
    padding: 4px 8px;
  }
  .reader-control-btn {
    width: 32px;
    height: 32px;
  }
  .reader-control-btn svg {
    width: 18px;
    height: 18px;
  }
  .reader-page-display {
    min-width: 60px;
    font-size: 0.75rem;
  }
}

/* Game Cards with Screenshots */
.game-card {
  position: relative;
  background: linear-gradient(145deg, var(--panel-strong), var(--panel));
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 16px 48px rgba(139, 92, 246, 0.15);
}

.game-card-image {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg);
}

.game-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.game-card:hover .game-card-image img {
  transform: scale(1.05);
}

.game-card-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 15, 26, 0.8) 0%, transparent 50%);
  pointer-events: none;
}

.game-card-tag {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 12px;
  background: rgba(139, 92, 246, 0.9);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 1;
  backdrop-filter: blur(4px);
}

.game-card-content {
  padding: 20px;
}

.game-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.game-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.game-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.game-play-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--category-games), #a78bfa);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.game-play-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.game-play-btn svg {
  width: 16px;
  height: 16px;
}

.game-card-summary {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

/* Expandable Description */
.game-description-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--transition);
}

.game-description-toggle:hover {
  color: var(--text-secondary);
}

.game-description-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
}

.game-description-toggle.open svg {
  transform: rotate(180deg);
}

.game-description-full {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
}

.game-description-full.open {
  max-height: 300px;
  padding-top: 12px;
}

.game-description-full p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
  padding: 16px;
  background: var(--panel);
  border-radius: var(--radius-md);
  border: 1px solid var(--stroke);
}

/* Game Grid - Updated for larger cards */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 24px;
}

@media (max-width: 480px) {
  .game-grid {
    grid-template-columns: 1fr;
  }

  .game-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .game-play-btn {
    width: 100%;
    justify-content: center;
  }
}

/* =====================================================
   TOOL CARDS - With Screenshots and Open Buttons
   ===================================================== */

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 24px;
}

.tool-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(6, 182, 212, 0.15);
  border-color: rgba(6, 182, 212, 0.3);
}

.tool-card-image {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
}

.tool-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.tool-card:hover .tool-card-image img {
  transform: scale(1.05);
}

.tool-card-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(11, 20, 36, 0.8) 0%, transparent 50%);
  pointer-events: none;
}

.tool-card-overlay {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}

.tool-tag {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(6, 182, 212, 0.9);
  color: white;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 4px;
}

.tool-card-content {
  padding: 20px;
}

.tool-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  margin-bottom: 8px;
}

.tool-description-short {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 12px;
}

.tool-description-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: #06b6d4;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  margin-bottom: 12px;
  transition: color 0.2s ease;
}

.tool-description-toggle:hover {
  color: #22d3ee;
}

.tool-description-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
}

.tool-description-toggle.open svg {
  transform: rotate(180deg);
}

.tool-description-full {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, margin 0.3s ease;
  margin-bottom: 0;
}

.tool-description-full.open {
  max-height: 200px;
  margin-bottom: 16px;
}

.tool-description-full p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
  line-height: 1.6;
  padding: 12px;
  background: rgba(6, 182, 212, 0.05);
  border-radius: 8px;
  border-left: 3px solid #06b6d4;
}

.tool-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  color: white;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tool-open-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(6, 182, 212, 0.4);
}

.tool-open-btn svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 480px) {
  .tool-grid {
    grid-template-columns: 1fr;
  }

  .tool-open-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ========================================
   BRAINTESTER CARDS
======================================== */

.braintester-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 24px;
}

.braintester-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.braintester-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(132, 204, 22, 0.15);
  border-color: rgba(132, 204, 22, 0.3);
}

.braintester-card-image {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
}

.braintester-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.braintester-card:hover .braintester-card-image img {
  transform: scale(1.05);
}

.braintester-card-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(11, 20, 36, 0.8) 0%, transparent 50%);
  pointer-events: none;
}

.braintester-card-overlay {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}

.braintester-tag {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(132, 204, 22, 0.9);
  color: #1a1a1a;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 4px;
}

.braintester-card-content {
  padding: 20px;
}

.braintester-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  margin-bottom: 8px;
}

.braintester-description-short {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 12px;
}

.braintester-description-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: #84cc16;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  margin-bottom: 12px;
  transition: color 0.2s ease;
}

.braintester-description-toggle:hover {
  color: #a3e635;
}

.braintester-description-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
}

.braintester-description-toggle.open svg {
  transform: rotate(180deg);
}

.braintester-description-full {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, margin 0.3s ease;
  margin-bottom: 0;
}

.braintester-description-full.open {
  max-height: 300px;
  margin-bottom: 16px;
}

.braintester-description-full p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
  line-height: 1.6;
  padding: 12px;
  background: rgba(132, 204, 22, 0.05);
  border-radius: 8px;
  border-left: 3px solid #84cc16;
}

.braintester-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #84cc16 0%, #65a30d 100%);
  color: #1a1a1a;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.braintester-open-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(132, 204, 22, 0.4);
}

.braintester-open-btn svg {
  width: 18px;
  height: 18px;
}

.category-icon.braintesters {
  background: rgba(132, 204, 22, 0.15);
  color: var(--category-braintesters);
  border: 1px solid rgba(132, 204, 22, 0.3);
}

@media (max-width: 480px) {
  .braintester-grid {
    grid-template-columns: 1fr;
  }

  .braintester-open-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ========================================
   BOOK CARDS
======================================== */

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

.book-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  display: flex;
  flex-direction: column;
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.3);
}

.book-cover-container {
  position: relative;
  width: 100%;
  aspect-ratio: 800 / 1230;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
  overflow: hidden;
}

.book-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.book-card:hover .book-cover {
  transform: scale(1.03);
}

.book-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.05) 100%);
}

.book-cover-placeholder svg {
  width: 64px;
  height: 64px;
  color: rgba(245, 158, 11, 0.4);
}

.book-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.book-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.book-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  line-height: 1.3;
}

.book-tag {
  flex-shrink: 0;
  padding: 4px 10px;
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.book-description-short {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0 0 12px 0;
}

.book-description-full {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, margin 0.4s ease, opacity 0.3s ease;
  opacity: 0;
}

.book-description-full.open {
  max-height: 300px;
  margin-bottom: 16px;
  opacity: 1;
}

.book-description-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: #f59e0b;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  margin-bottom: 16px;
  transition: color 0.2s ease;
}

.book-description-toggle:hover {
  color: #fbbf24;
}

.book-description-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
}

.book-description-toggle.open svg {
  transform: rotate(180deg);
}

.book-actions {
  margin-top: auto;
}

.book-read-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #000;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.book-read-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4);
}

.book-read-btn svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 768px) {
  .book-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .book-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .book-content {
    padding: 12px;
  }

  .book-title {
    font-size: 0.95rem;
  }

  .book-description-short {
    font-size: 0.8rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .book-read-btn {
    width: 100%;
    justify-content: center;
    padding: 10px 16px;
    font-size: 0.85rem;
  }
}

/* ========================================
   TRENDING APPS SECTION
======================================== */

.trending-section {
  margin-top: 32px;
  opacity: 1;
  animation: fadeInUp 0.5s ease;
}

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

.trending-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.trending-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(245, 158, 11, 0.1));
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fbbf24;
}

.trending-badge svg {
  width: 14px;
  height: 14px;
}

.trending-subtitle {
  font-size: 0.875rem;
  color: var(--muted);
  font-weight: 500;
}

.trending-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.trending-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.trending-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent-color, var(--accent));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.trending-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateX(4px);
}

.trending-item:hover::before {
  opacity: 1;
}

.trending-rank {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}

.trending-item:nth-child(1) .trending-rank {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #000;
}

.trending-item:nth-child(2) .trending-rank {
  background: linear-gradient(135deg, #94a3b8, #64748b);
  color: #000;
}

.trending-item:nth-child(3) .trending-rank {
  background: linear-gradient(135deg, #cd7f32, #a0522d);
  color: #fff;
}

.trending-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--accent-color, var(--text-secondary));
  flex-shrink: 0;
}

.trending-icon svg {
  width: 18px;
  height: 18px;
}

.trending-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.trending-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trending-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--muted);
}

.trending-category {
  color: var(--accent-color, var(--text-secondary));
  font-weight: 600;
  text-transform: capitalize;
}

.trending-opens {
  display: flex;
  align-items: center;
  gap: 4px;
}

.trending-arrow {
  width: 18px;
  height: 18px;
  color: var(--muted);
  opacity: 0;
  transform: translateX(-8px);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.trending-item:hover .trending-arrow {
  opacity: 1;
  transform: translateX(0);
  color: var(--accent-color, var(--text-secondary));
}

.trending-empty {
  padding: 24px;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
}

.trending-empty p {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0;
}

/* Responsive Trending Section */
@media (max-width: 900px) {
  .trending-section {
    margin-top: 24px;
  }

  .trending-header {
    justify-content: center;
    text-align: center;
  }

  .trending-item {
    padding: 12px 14px;
    gap: 12px;
  }

  .trending-icon {
    width: 32px;
    height: 32px;
  }

  .trending-icon svg {
    width: 16px;
    height: 16px;
  }
}

@media (max-width: 480px) {
  .trending-header {
    flex-direction: column;
    gap: 8px;
  }

  .trending-meta {
    gap: 8px;
  }

  .trending-opens {
    display: none;
  }
}

/* ========================================
   PUBLICATION SECTION (VERAXIS)
======================================== */

.publication-section {
  margin-top: 48px;
}

.publication-card {
  position: relative;
  background: linear-gradient(145deg, var(--panel-strong), var(--panel));
  border: 1px solid var(--stroke);
  border-radius: var(--radius-xl);
  padding: 48px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.publication-card-link {
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition);
}

.publication-card-link:hover {
  transform: translateY(-4px);
  border-color: rgba(148, 163, 184, 0.4);
  box-shadow: 0 24px 64px rgba(148, 163, 184, 0.15);
}

.publication-card-link:hover .publication-badge {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.25), rgba(148, 163, 184, 0.15));
  border-color: rgba(148, 163, 184, 0.5);
  color: #f0f4f8;
}

.publication-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #64748b, #94a3b8, #64748b);
}

.publication-image {
  max-width: 400px;
  width: 100%;
  margin-bottom: 32px;
}

.publication-image img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  transition: transform var(--transition);
}

.publication-image img:hover {
  transform: scale(1.02);
}

.publication-content {
  max-width: 640px;
}

.publication-description {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 24px;
}

.publication-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: linear-gradient(135deg, rgba(100, 116, 139, 0.15), rgba(148, 163, 184, 0.1));
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #94a3b8;
}

@media (max-width: 900px) {
  .publication-card {
    padding: 32px 24px;
  }

  .publication-image {
    max-width: 300px;
    margin-bottom: 24px;
  }
}

@media (max-width: 480px) {
  .publication-card {
    padding: 24px 20px;
  }

  .publication-image {
    max-width: 240px;
  }

  .publication-description {
    font-size: 0.9375rem;
  }
}
