/* ==========================================================================
   Flux Web Addon Store — Liquid Glass Design System
   ========================================================================== */

:root {
  --bg-dark: #07090e;
  --bg-card: rgba(255, 255, 255, 0.035);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.22);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.65);
  --text-tertiary: rgba(255, 255, 255, 0.4);
  --accent-cyan: #38bdf8;
  --accent-blue: #3b82f6;
  --accent-indigo: #6366f1;
  --accent-green: #22c55e;
  --accent-red: #ef4444;
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --ease-spring: cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-main);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* Ambient glow spots */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
}

.glow-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
  top: -100px;
  left: 20%;
}

.glow-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, rgba(0, 0, 0, 0) 70%);
  top: 30%;
  right: 10%;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 9, 14, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 0;
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  user-select: none;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(56, 189, 248, 0.15));
  border: 1px solid rgba(56, 189, 248, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
}

.brand-logo-img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  object-fit: cover;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.brand-text {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.brand-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.brand-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Search Box */
.search-box {
  flex: 1;
  max-width: 480px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-tertiary);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  height: 40px;
  padding: 0 38px 0 40px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 100px;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 13.5px;
  outline: none;
  transition: all 0.2s var(--ease-spring);
}

.search-box input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

.clear-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* User Profile Pill */
.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 14px 5px 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 100px;
  backdrop-filter: blur(10px);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  color: white;
  font-size: 11.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.user-details {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sync-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-tertiary);
}

.sync-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: #64748b;
  transition: background-color 0.2s ease;
}

.sync-badge.connected .sync-dot {
  background-color: var(--accent-green);
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
}

.sync-badge.connected .sync-text {
  color: var(--accent-green);
}

.auth-btn {
  background: none;
  border: none;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent-cyan);
  cursor: pointer;
  margin-left: 4px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: 100px;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s var(--ease-spring);
  border: 1px solid transparent;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-hover);
}

.btn-primary {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.btn-primary:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

/* Main Container */
.main-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 28px 80px 28px;
  position: relative;
  z-index: 1;
}

/* Hero Section */
.hero-section {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 44px;
}

.hero-content {
  max-width: 680px;
}

.hero-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent-cyan);
  margin-bottom: 12px;
}

.hero-title {
  font-size: 38px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 12px;
}

.hero-subtitle {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.hero-stats {
  display: flex;
  gap: 16px;
}

.stat-card {
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  min-width: 130px;
}

.stat-num {
  display: block;
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.stat-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-tertiary);
}

/* Category Filter Section */
.filter-section {
  margin-bottom: 32px;
}

.category-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s var(--ease-spring);
}

.pill:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text-primary);
}

.pill.active {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}

.pill-badge {
  font-size: 10px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.14);
  padding: 1px 6px;
  border-radius: 100px;
}

/* Addons Grid */
.addons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

/* Addon Card */
.addon-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 20px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s var(--ease-spring);
  position: relative;
}

.addon-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.card-top {
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
}

.addon-logo-wrap {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.addon-logo-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 8px;
}

.addon-logo-fallback {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
}

.card-info {
  flex: 1;
  min-width: 0;
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.addon-name {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stock-tag {
  font-size: 9px;
  font-weight: 800;
  background: rgba(99, 102, 241, 0.85);
  color: #ffffff;
  padding: 2px 6px;
  border-radius: 4px;
}

.installed-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-green);
  background: rgba(34, 197, 94, 0.12);
  padding: 3px 8px;
  border-radius: 100px;
}

.card-meta {
  font-size: 11.5px;
  color: var(--text-tertiary);
  display: flex;
  gap: 6px;
}

.addon-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tag-pill {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  color: var(--text-secondary);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
}

.card-btn {
  height: 32px;
  padding: 0 14px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s var(--ease-spring);
}

.btn-install {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.btn-install:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.btn-uninstall {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.25);
  color: var(--accent-red);
}

.btn-uninstall:hover {
  background: rgba(239, 68, 68, 0.2);
}

.btn-configure {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-subtle);
  color: var(--text-secondary);
  padding: 0 10px;
}

.btn-configure:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  background: rgba(18, 22, 32, 0.95);
  border: 1px solid var(--border-hover);
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8);
}

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

.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.modal-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.close-modal-btn {
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.input-group {
  margin-bottom: 14px;
}

.input-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.input-group input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 13px;
  outline: none;
}

.input-group input:focus {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
}

.modal-error {
  font-size: 12px;
  color: var(--accent-red);
  margin-top: 6px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 12px 18px;
  background: rgba(22, 27, 40, 0.95);
  border: 1px solid var(--border-hover);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.25s var(--ease-spring);
}

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

/* Responsive */
@media (max-width: 768px) {
  .hero-section {
    flex-direction: column;
    align-items: flex-start;
  }
  .hero-stats {
    width: 100%;
    overflow-x: auto;
  }
  .addons-grid {
    grid-template-columns: 1fr;
  }
}
