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

:root {
  --glass-bg: rgba(255, 255, 255, 0.18);
  --glass-bg-hover: rgba(255, 255, 255, 0.28);
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-border-strong: rgba(255, 255, 255, 0.5);
  --glass-shadow: rgba(0, 0, 0, 0.08);
  --text-primary: rgba(255, 255, 255, 0.95);
  --text-secondary: rgba(255, 255, 255, 0.65);
  --text-tertiary: rgba(255, 255, 255, 0.45);
  --accent: #60a5fa;
  --accent-glow: rgba(96, 165, 250, 0.35);
  --pink: #f472b6;
  --green: #4ade80;
  --orange: #fb923c;
  --purple: #c084fc;
  --cyan: #22d3ee;
}

/* Animated mesh gradient background */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.bg-layer::before {
  content: "";
  position: absolute;
  width: 200%;
  height: 200%;
  top: -50%;
  left: -50%;
  background:
    radial-gradient(
      ellipse 600px 600px at 20% 30%,
      rgba(99, 102, 241, 0.4) 0%,
      transparent 70%
    ),
    radial-gradient(
      ellipse 500px 500px at 75% 20%,
      rgba(244, 114, 182, 0.3) 0%,
      transparent 70%
    ),
    radial-gradient(
      ellipse 700px 700px at 60% 70%,
      rgba(34, 211, 238, 0.25) 0%,
      transparent 70%
    ),
    radial-gradient(
      ellipse 400px 400px at 30% 80%,
      rgba(74, 222, 128, 0.2) 0%,
      transparent 70%
    ),
    radial-gradient(
      ellipse 500px 500px at 85% 60%,
      rgba(251, 146, 60, 0.2) 0%,
      transparent 70%
    );
  animation: bgShift 20s ease-in-out infinite alternate;
}
@keyframes bgShift {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  33% {
    transform: translate(-3%, 2%) rotate(1deg);
  }
  66% {
    transform: translate(2%, -2%) rotate(-1deg);
  }
  100% {
    transform: translate(-1%, 1%) rotate(0.5deg);
  }
}

/* Floating orbs */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  z-index: 0;
  animation: orbFloat 15s ease-in-out infinite alternate;
}
.orb-1 {
  width: 300px;
  height: 300px;
  background: rgba(99, 102, 241, 0.5);
  top: 10%;
  left: 5%;
  animation-delay: 0s;
}
.orb-2 {
  width: 250px;
  height: 250px;
  background: rgba(244, 114, 182, 0.4);
  top: 60%;
  right: 10%;
  animation-delay: -5s;
}
.orb-3 {
  width: 200px;
  height: 200px;
  background: rgba(34, 211, 238, 0.3);
  bottom: 10%;
  left: 30%;
  animation-delay: -10s;
}
@keyframes orbFloat {
  0% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-40px) scale(1.1);
  }
  100% {
    transform: translateY(20px) scale(0.95);
  }
}

/* Main desktop frame */
.desktop-frame {
  width: min(
    var(--page-content-width-desktop),
    calc(100vw - var(--page-content-gutter-desktop))
  );
  max-width: none;
  margin: var(--page-content-margin-top-desktop) auto 0;
  height: var(--ds-panel-h);
  max-height: var(--ds-panel-h);
  min-height: unset;
  padding: 16px;
  overflow: hidden;
  background: var(--ds-bg);
  border-radius: var(--ds-r-md);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow: var(--ds-shadow);
}

/* macOS-like top bar */
.topbar {
  height: 36px;
  border-radius: var(--ds-r-md);
  background: rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  padding: 0 16px;
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
}
.traffic-lights {
  display: flex;
  gap: 8px;
}
.traffic-light {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.tl-red {
  background: #ff5f57;
}
.tl-yellow {
  background: #febc2e;
}
.tl-green {
  background: #28c840;
}
.topbar-title {
  flex: 1;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
}
.topbar-spacer {
  width: 52px;
}

/* Content area */
.content {
  height: calc(100% - 36px);
  overflow-y: auto;
  padding: 40px 50px 50px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}
.content::-webkit-scrollbar {
  width: 6px;
}
.content::-webkit-scrollbar-track {
  background: transparent;
}
.content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 36px;
  animation: fadeUp 0.8s ease-out both;
}
.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 100px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 20px;
  letter-spacing: 0.5px;
}
.header-badge svg {
  width: 14px;
  height: 14px;
}
.header h1 {
  font-size: 42px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.7) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.header p {
  font-size: 16px;
  color: var(--text-secondary);
  font-weight: 300;
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Search bar */
.search-wrap {
  max-width: 560px;
  margin: 0 auto 40px;
  animation: fadeUp 0.8s ease-out 0.1s both;
}
.search-bar {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 0 20px;
  height: 52px;
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.search-bar:hover,
.search-bar:focus-within {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-strong);
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 0 30px var(--accent-glow);
}
.search-bar svg {
  width: 18px;
  height: 18px;
  color: var(--text-tertiary);
  flex-shrink: 0;
  margin-right: 12px;
}
.search-bar input {
  flex: 1;
  border: none;
  background: none;
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  font-weight: 400;
  outline: none;
}
.search-bar input::placeholder {
  color: var(--text-tertiary);
}
.search-kbd {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-tertiary);
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

/* Category cards grid */
.categories {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 36px;
}

.card {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 28px 24px;
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  transition: all 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
  overflow: hidden;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: radial-gradient(
    circle at var(--mx, 50%) var(--my, 50%),
    rgba(255, 255, 255, 0.08) 0%,
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.card:hover::before {
  opacity: 1;
}
.card:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-strong);
  transform: translateY(-4px);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 20px;
  position: relative;
}
.card-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: inherit;
  filter: blur(16px);
  opacity: 0.4;
  z-index: -1;
}
.ci-blue {
  background: rgba(96, 165, 250, 0.2);
  border: 1px solid rgba(96, 165, 250, 0.3);
}
.ci-pink {
  background: rgba(244, 114, 182, 0.2);
  border: 1px solid rgba(244, 114, 182, 0.3);
}
.ci-green {
  background: rgba(74, 222, 128, 0.2);
  border: 1px solid rgba(74, 222, 128, 0.3);
}
.ci-orange {
  background: rgba(251, 146, 60, 0.2);
  border: 1px solid rgba(251, 146, 60, 0.3);
}
.ci-purple {
  background: rgba(192, 132, 252, 0.2);
  border: 1px solid rgba(192, 132, 252, 0.3);
}
.ci-cyan {
  background: rgba(34, 211, 238, 0.2);
  border: 1px solid rgba(34, 211, 238, 0.3);
}

.card h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}
.card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  font-weight: 300;
}
.card-count {
  display: inline-block;
  margin-top: 14px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  background: rgba(255, 255, 255, 0.06);
  padding: 4px 10px;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Animation delays for cards */
.card:nth-child(1) {
  animation: fadeUp 0.6s ease-out 0.15s both;
}
.card:nth-child(2) {
  animation: fadeUp 0.6s ease-out 0.22s both;
}
.card:nth-child(3) {
  animation: fadeUp 0.6s ease-out 0.29s both;
}
.card:nth-child(4) {
  animation: fadeUp 0.6s ease-out 0.36s both;
}
.card:nth-child(5) {
  animation: fadeUp 0.6s ease-out 0.43s both;
}
.card:nth-child(6) {
  animation: fadeUp 0.6s ease-out 0.5s both;
}

/* Popular articles section */
.popular {
  animation: fadeUp 0.6s ease-out 0.55s both;
}
.section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 16px;
}
.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.1), transparent);
}

.article-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.article-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
}
.article-item:hover {
  background: var(--glass-bg);
  border-color: var(--glass-border);
  transform: translateX(4px);
}
.article-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ad-blue {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}
.ad-pink {
  background: var(--pink);
  box-shadow: 0 0 10px rgba(244, 114, 182, 0.3);
}
.ad-green {
  background: var(--green);
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.3);
}
.ad-purple {
  background: var(--purple);
  box-shadow: 0 0 10px rgba(192, 132, 252, 0.3);
}

.article-info {
  flex: 1;
}
.article-info h4 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.article-info span {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 300;
}
.article-arrow {
  color: var(--text-tertiary);
  font-size: 16px;
  transition: all 0.3s;
  opacity: 0;
}
.article-item:hover .article-arrow {
  opacity: 1;
  transform: translateX(2px);
  color: var(--text-secondary);
}

/* Bottom bar */
.bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  animation: fadeUp 0.6s ease-out 0.65s both;
}
.bottom-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.4);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}
.bottom-left span {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 400;
}
.bottom-right {
  display: flex;
  gap: 8px;
}
.bottom-btn {
  padding: 8px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  border: none;
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}
.btn-accent {
  background: linear-gradient(
    135deg,
    rgba(96, 165, 250, 0.3),
    rgba(192, 132, 252, 0.3)
  );
  color: var(--text-primary);
  border: 1px solid rgba(96, 165, 250, 0.3);
  box-shadow: 0 4px 16px rgba(96, 165, 250, 0.15);
}
.btn-accent:hover {
  background: linear-gradient(
    135deg,
    rgba(96, 165, 250, 0.45),
    rgba(192, 132, 252, 0.45)
  );
  box-shadow: 0 8px 30px rgba(96, 165, 250, 0.25);
  transform: translateY(-1px);
}

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