/* ===== Widgets Portal - Styles ===== */
/* Prefix: wg- to avoid conflicts */

.wg-root {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f8fafc;
  color: #0f172a;
  min-height: 100vh;
}

/* Header / Nav */
.wg-nav {
  background: #0f172a;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 9999;
}
.wg-nav a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}
.wg-nav a:hover { color: #fff; }
.wg-nav-brand {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.wg-nav-brand i { color: #818cf8; }

/* Hero Section */
.wg-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  padding: 60px 24px 50px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.wg-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(99,102,241,0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(168,85,247,0.1) 0%, transparent 50%);
  animation: wgHeroGlow 12s ease-in-out infinite alternate;
}
@keyframes wgHeroGlow {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-2%, 2%); }
}
.wg-hero-content { position: relative; z-index: 1; }
.wg-hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
  letter-spacing: -0.03em;
}
.wg-hero h1 span { background: linear-gradient(135deg, #818cf8, #c084fc); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.wg-hero p {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.6);
  max-width: 600px;
  margin: 0 auto 28px;
}
.wg-hero-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}
.wg-hero-stat { text-align: center; }
.wg-hero-stat .num {
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, #818cf8, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.wg-hero-stat .label {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  font-weight: 500;
}

/* Breadcrumb */
.wg-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 16px 24px;
  max-width: 1200px;
  margin: 0 auto;
  font-size: 0.8rem;
  color: #94a3b8;
}
.wg-breadcrumb a {
  color: #6366f1;
  text-decoration: none;
  transition: color 0.2s;
}
.wg-breadcrumb a:hover { color: #4338ca; }
.wg-breadcrumb span { color: #64748b; }
.wg-breadcrumb i { font-size: 0.6rem; color: #cbd5e1; }

/* Search Section */
.wg-search-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  top: -24px;
  z-index: 2;
}
.wg-search-box {
  position: relative;
}
.wg-search-box input {
  width: 100%;
  padding: 18px 52px 18px 20px;
  border-radius: 16px;
  border: 2px solid #e2e8f0;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  background: #fff;
  color: #0f172a;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  transition: all 0.3s ease;
}
.wg-search-box input:focus {
  border-color: #6366f1;
  box-shadow: 0 8px 30px rgba(99,102,241,0.12);
}
.wg-search-box .wg-search-icon {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 1.1rem;
  pointer-events: none;
}
.wg-search-results-count {
  text-align: center;
  font-size: 0.85rem;
  color: #64748b;
  margin-top: 8px;
  padding: 0 24px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* Categories Filter */
.wg-categories {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 32px;
}
.wg-categories-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.wg-categories-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
}
.wg-categories-header .wg-clear-filter {
  background: none;
  border: none;
  color: #6366f1;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.2s;
}
.wg-categories-header .wg-clear-filter:hover { background: #eef2ff; }
.wg-cats-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.wg-cat-btn {
  padding: 8px 18px;
  border-radius: 100px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  color: #475569;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s ease;
  font-family: inherit;
  flex-shrink: 0;
}
.wg-cat-btn:hover {
  border-color: #c7d2fe;
  background: #eef2ff;
  color: #4338ca;
}
.wg-cat-btn.active {
  background: #6366f1;
  border-color: #6366f1;
  color: #fff;
  box-shadow: 0 2px 10px rgba(99,102,241,0.25);
}

/* Widgets Grid */
.wg-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 40px;
}
.wg-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.wg-card {
  background: #fff;
  border-radius: 16px;
  padding: 24px 20px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid #e2e8f0;
  text-decoration: none;
  display: block;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  animation: wgCardIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.wg-card:nth-child(1) { animation-delay: 0.02s; }
.wg-card:nth-child(2) { animation-delay: 0.04s; }
.wg-card:nth-child(3) { animation-delay: 0.06s; }
.wg-card:nth-child(4) { animation-delay: 0.08s; }
.wg-card:nth-child(5) { animation-delay: 0.1s; }
.wg-card:nth-child(6) { animation-delay: 0.12s; }
.wg-card:nth-child(7) { animation-delay: 0.14s; }
.wg-card:nth-child(8) { animation-delay: 0.16s; }
.wg-card:nth-child(9) { animation-delay: 0.18s; }
.wg-card:nth-child(10) { animation-delay: 0.2s; }
.wg-card:nth-child(11) { animation-delay: 0.22s; }
.wg-card:nth-child(12) { animation-delay: 0.24s; }
.wg-card:nth-child(13) { animation-delay: 0.26s; }
.wg-card:nth-child(14) { animation-delay: 0.28s; }
.wg-card:nth-child(15) { animation-delay: 0.3s; }
.wg-card:nth-child(16) { animation-delay: 0.32s; }

@keyframes wgCardIn {
  to { opacity: 1; transform: translateY(0); }
}
.wg-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.wg-card:hover::before { opacity: 1; }
.wg-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 20px 40px -12px rgba(99,102,241,0.2), 0 0 0 2px rgba(99,102,241,0.12);
  border-color: #c7d2fe;
}
.wg-card:active { transform: translateY(-2px) scale(0.98); }
.wg-card-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 1.3rem;
  background: linear-gradient(135deg, #eef2ff, #f5f3ff);
  color: #4f46e5;
  transition: transform 0.3s ease;
}
.wg-card:hover .wg-card-icon { transform: scale(1.1); }
.wg-card-cat {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 10px;
  border-radius: 100px;
  margin-bottom: 8px;
  color: #fff;
  background: #6366f1;
}
.wg-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
  line-height: 1.3;
}
.wg-card-desc {
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.wg-card-arrow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6366f1;
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.3s ease;
}
.wg-card:hover .wg-card-arrow { opacity: 1; transform: translateX(0); }

/* Empty State */
.wg-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #94a3b8;
}
.wg-empty i { font-size: 3rem; margin-bottom: 16px; display: block; }
.wg-empty h3 { font-size: 1.2rem; color: #64748b; margin-bottom: 8px; }
.wg-empty p { font-size: 0.9rem; }

/* Load More */
.wg-load-more {
  display: flex;
  justify-content: center;
  padding: 32px 0;
}
.wg-load-more-btn {
  padding: 12px 36px;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  background: #fff;
  color: #475569;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.25s ease;
}
.wg-load-more-btn:hover {
  border-color: #6366f1;
  color: #4338ca;
  background: #eef2ff;
}

/* Recent & Favorites Sections */
.wg-section {
  padding: 40px 0;
}
.wg-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 8px;
}
.wg-section-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}
.wg-section-header h2 i { color: #6366f1; }
.wg-section-header a {
  font-size: 0.8rem;
  color: #6366f1;
  font-weight: 600;
  text-decoration: none;
}
.wg-section-header a:hover { text-decoration: underline; }

/* FAQ Section */
.wg-faq {
  max-width: 800px;
  margin: 0 auto;
  padding: 60px 24px;
}
.wg-faq h2 {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 32px;
}
.wg-faq-item {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.3s;
}
.wg-faq-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.wg-faq-q {
  padding: 18px 20px;
  font-weight: 600;
  font-size: 0.95rem;
  color: #0f172a;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: none;
  border: none;
  width: 100%;
  font-family: inherit;
  text-align: left;
  transition: background 0.2s;
}
.wg-faq-q:hover { background: #f8fafc; }
.wg-faq-q i { transition: transform 0.3s; color: #94a3b8; font-size: 0.8rem; }
.wg-faq-q.open i { transform: rotate(180deg); }
.wg-faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 20px;
  font-size: 0.9rem;
  color: #64748b;
  line-height: 1.6;
}
.wg-faq-a.open {
  max-height: 300px;
  padding: 0 20px 18px;
}

/* Footer */
.wg-footer {
  text-align: center;
  padding: 40px 24px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}
.wg-footer p { color: #94a3b8; font-size: 0.85rem; }
.wg-footer a { color: #6366f1; text-decoration: none; font-weight: 600; }
.wg-footer a:hover { text-decoration: underline; }

/* Keyboard Shortcuts Modal */
.wg-shortcuts-btn {
  position: fixed;
  bottom: 100px;
  right: 20px;
  z-index: 9999;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: #fff;
  color: #0f172a;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}
.wg-shortcuts-btn:hover { transform: scale(1.05); box-shadow: 0 6px 20px rgba(0,0,0,0.2); }



/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .wg-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .wg-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .wg-hero h1 { font-size: 1.8rem; }
  .wg-hero p { font-size: 0.95rem; }
  .wg-hero-stat .num { font-size: 1.4rem; }
  .wg-card { padding: 18px 14px 16px; }
  .wg-card-icon { width: 44px; height: 44px; font-size: 1.1rem; }
}
@media (max-width: 480px) {
  .wg-grid { grid-template-columns: 1fr; }
  .wg-hero { padding: 40px 16px 36px; }
  .wg-hero h1 { font-size: 1.5rem; }
  .wg-hero-stats { gap: 16px; }
  .wg-search-box input { padding: 14px 44px 14px 16px; font-size: 0.9rem; }
}

.sp-link {
  color: #c2410c;
  text-decoration: none;
  transition: color 0.2s;
}
.sp-link:hover { color: #dc2626; }
