/* ============================================
   JobAssam — Refined Mobile Design System
   ============================================ */

/* --- Design Tokens --- */
:root {
  --background: 220 20% 97%;
  --foreground: 224 20% 12%;
  --card: 0 0% 100%;
  --card-foreground: 224 20% 12%;
  --primary: 0 84% 51%;
  --primary-foreground: 0 0% 99%;
  --secondary: 220 14% 96%;
  --secondary-foreground: 224 20% 12%;
  --muted: 220 14% 96%;
  --muted-foreground: 220 9% 46%;
  --accent: 220 14% 95%;
  --accent-foreground: 224 20% 12%;
  --destructive: 0 84% 60%;
  --success: 152 69% 36%;
  --success-foreground: 0 0% 99%;
  --border: 220 13% 91%;
  --input: 220 13% 91%;
  --ring: 0 84% 51%;
  --radius: 14px;
  --bottom-nav-height: 68px;

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px -2px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 24px -4px rgba(0,0,0,0.1), 0 4px 8px -4px rgba(0,0,0,0.04);
  --shadow-primary: 0 6px 20px -4px hsl(var(--primary) / 0.4);
}

html.dark-mode {
  --background: 224 16% 7%;
  --foreground: 210 20% 96%;
  --card: 224 16% 10%;
  --card-foreground: 210 20% 96%;
  --primary: 0 80% 58%;
  --primary-foreground: 0 0% 99%;
  --secondary: 224 12% 14%;
  --secondary-foreground: 210 20% 96%;
  --muted: 224 12% 14%;
  --muted-foreground: 220 10% 56%;
  --accent: 224 12% 14%;
  --accent-foreground: 210 20% 96%;
  --destructive: 0 62% 30%;
  --success: 152 69% 36%;
  --border: 224 12% 17%;
  --input: 224 12% 17%;
  --ring: 0 80% 58%;

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.15);
  --shadow-md: 0 4px 12px -2px rgba(0,0,0,0.4), 0 2px 4px -2px rgba(0,0,0,0.2);
  --shadow-lg: 0 12px 24px -4px rgba(0,0,0,0.5), 0 4px 8px -4px rgba(0,0,0,0.2);
  --shadow-primary: 0 6px 20px -4px hsl(var(--primary) / 0.3);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background-color: hsl(var(--background));
}

body {
  font-family: 'Outfit', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: hsl(var(--foreground));
  background-color: hsl(var(--background));
  margin: 0 auto;
  max-width: 580px;
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* --- Animations --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes slideProgress {
  to { transform: scaleX(1); }
}

@keyframes sponsorFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* --- Header --- */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  background-color: hsl(var(--card) / 0.75);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  border-bottom: 1px solid hsl(var(--border) / 0.6);
}

header h1 {
  font-size: 18px;
  font-weight: 700;
  color: hsl(var(--foreground));
  letter-spacing: -0.03em;
}

.header-icon-btn {
  background: none;
  border: none;
  color: hsl(var(--foreground));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 12px;
  transition: background-color 150ms ease, transform 100ms ease;
}

.header-icon-btn:active {
  background-color: hsl(var(--accent));
  transform: scale(0.92);
}

/* --- Main Content --- */
main {
  width: 100%;
  padding: 16px;
  padding-bottom: calc(var(--bottom-nav-height) + 16px);
  animation: fadeIn 0.3s ease;
}

.view > section:not(:last-child),
.view > .premium-cta,
.view > .settings-group {
  margin-bottom: 24px;
}

/* --- Section Headers --- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-header h2 {
  font-size: 17px;
  font-weight: 700;
  color: hsl(var(--foreground));
  letter-spacing: -0.03em;
}

.section-header a,
.section-header .view-all {
  font-size: 13px;
  font-weight: 600;
  color: hsl(var(--primary));
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 2px;
  transition: opacity 150ms ease;
}

.view-all:active {
  opacity: 0.6;
}

/* --- Services Grid --- */
.services {
  margin-bottom: 24px;
  animation: fadeInUp 0.45s ease both;
}

.service-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.service-item {
  position: relative;
  text-decoration: none;
  color: hsl(var(--foreground));
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 6px;
  border-radius: var(--radius);
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border) / 0.5);
  box-shadow: var(--shadow-sm);
  transition: transform 200ms ease, box-shadow 200ms ease;
  cursor: pointer;
  min-height: 84px;
  animation: fadeInUp 0.4s ease both;
}

.service-item:nth-child(1) { animation-delay: 0.02s; }
.service-item:nth-child(2) { animation-delay: 0.04s; }
.service-item:nth-child(3) { animation-delay: 0.06s; }
.service-item:nth-child(4) { animation-delay: 0.08s; }
.service-item:nth-child(5) { animation-delay: 0.10s; }
.service-item:nth-child(6) { animation-delay: 0.12s; }
.service-item:nth-child(7) { animation-delay: 0.14s; }
.service-item:nth-child(8) { animation-delay: 0.16s; }
.service-item:nth-child(9) { animation-delay: 0.18s; }
.service-item:nth-child(10) { animation-delay: 0.20s; }
.service-item:nth-child(11) { animation-delay: 0.22s; }
.service-item:nth-child(12) { animation-delay: 0.24s; }

.service-item:active {
  transform: scale(0.95);
  box-shadow: var(--shadow-xs);
}

.service-item .lucide {
  width: 38px;
  height: 38px;
  padding: 9px;
  border-radius: 12px;
  flex-shrink: 0;
  transition: transform 200ms ease;
}

.service-item-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 12px;
  flex-shrink: 0;
}

/* Colored service icons */
.service-item:nth-child(1) .lucide { background: hsl(217 92% 60% / 0.12); color: hsl(217 92% 55%); }
.service-item:nth-child(2) .lucide { background: hsl(160 84% 39% / 0.12); color: hsl(160 84% 36%); }
.service-item:nth-child(3) .lucide { background: hsl(265 70% 55% / 0.12); color: hsl(265 70% 50%); }
.service-item:nth-child(4) .lucide { background: hsl(38 92% 50% / 0.12); color: hsl(38 92% 45%); }
.service-item:nth-child(5) .lucide { background: hsl(187 85% 40% / 0.12); color: hsl(187 85% 37%); }
.service-item:nth-child(6) .lucide { background: hsl(350 89% 60% / 0.12); color: hsl(350 89% 55%); }
.service-item:nth-child(7) .lucide { background: hsl(239 84% 67% / 0.12); color: hsl(239 84% 60%); }
.service-item:nth-child(8) .lucide { background: hsl(280 68% 55% / 0.12); color: hsl(280 68% 50%); }
.service-item:nth-child(9) .lucide { background: hsl(142 71% 45% / 0.12); color: hsl(142 71% 40%); }
.service-item:nth-child(10) .lucide { background: hsl(24 95% 53% / 0.12); color: hsl(24 95% 48%); }
.service-item:nth-child(11) .lucide { background: hsl(330 80% 55% / 0.12); color: hsl(330 80% 50%); }
.service-item:nth-child(12) .lucide { background: hsl(200 90% 48% / 0.12); color: hsl(200 90% 43%); }
.service-item:nth-child(13) .lucide { background: hsl(45 93% 47% / 0.12); color: hsl(45 93% 42%); }
.service-item:nth-child(14) .lucide { background: hsl(175 80% 38% / 0.12); color: hsl(175 80% 33%); }
.service-item:nth-child(15) .lucide { background: hsl(300 65% 50% / 0.12); color: hsl(300 65% 45%); }
.service-item:nth-child(16) .lucide { background: hsl(10 85% 55% / 0.12); color: hsl(10 85% 50%); }

html.dark-mode .service-item:nth-child(1) .lucide { background: hsl(217 92% 60% / 0.15); color: hsl(217 92% 65%); }
html.dark-mode .service-item:nth-child(2) .lucide { background: hsl(160 84% 45% / 0.15); color: hsl(160 84% 50%); }
html.dark-mode .service-item:nth-child(3) .lucide { background: hsl(265 70% 60% / 0.15); color: hsl(265 70% 65%); }
html.dark-mode .service-item:nth-child(4) .lucide { background: hsl(38 92% 55% / 0.15); color: hsl(38 92% 60%); }
html.dark-mode .service-item:nth-child(5) .lucide { background: hsl(187 85% 45% / 0.15); color: hsl(187 85% 55%); }
html.dark-mode .service-item:nth-child(6) .lucide { background: hsl(350 89% 60% / 0.15); color: hsl(350 89% 65%); }
html.dark-mode .service-item:nth-child(7) .lucide { background: hsl(239 84% 67% / 0.15); color: hsl(239 84% 72%); }
html.dark-mode .service-item:nth-child(8) .lucide { background: hsl(280 68% 60% / 0.15); color: hsl(280 68% 65%); }
html.dark-mode .service-item:nth-child(9) .lucide { background: hsl(142 71% 50% / 0.15); color: hsl(142 71% 55%); }
html.dark-mode .service-item:nth-child(10) .lucide { background: hsl(24 95% 58% / 0.15); color: hsl(24 95% 63%); }
html.dark-mode .service-item:nth-child(11) .lucide { background: hsl(330 80% 60% / 0.15); color: hsl(330 80% 65%); }
html.dark-mode .service-item:nth-child(12) .lucide { background: hsl(200 90% 53% / 0.15); color: hsl(200 90% 60%); }
html.dark-mode .service-item:nth-child(13) .lucide { background: hsl(45 93% 52% / 0.15); color: hsl(45 93% 58%); }
html.dark-mode .service-item:nth-child(14) .lucide { background: hsl(175 80% 43% / 0.15); color: hsl(175 80% 50%); }
html.dark-mode .service-item:nth-child(15) .lucide { background: hsl(300 65% 55% / 0.15); color: hsl(300 65% 62%); }
html.dark-mode .service-item:nth-child(16) .lucide { background: hsl(10 85% 60% / 0.15); color: hsl(10 85% 65%); }

/* --- Service "NEW" Badge --- */
.service-item.has-notification {
  border-color: hsl(0 84% 55% / 0.3);
}

.service-item.has-notification::after {
  content: 'NEW';
  position: absolute;
  top: -5px;
  right: -5px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.3px;
  line-height: 1;
  color: white;
  background: linear-gradient(135deg, hsl(0 84% 55%), hsl(350 90% 60%));
  padding: 3px 5px;
  border-radius: 4px;
  box-shadow: 0 1px 4px hsl(0 0% 0% / 0.18), 0 0 0 2px hsl(var(--card));
  animation: badgePulse 2s ease-in-out infinite;
  z-index: 2;
}

@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* --- View All Arrow --- */
.view-all .lucide {
  display: none;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  background: none;
  color: hsl(var(--primary));
}

.view-all.highlight-attention .lucide {
  display: block;
  animation: pointRight 1.6s ease-in-out infinite;
}

@keyframes pointRight {
  0%, 100% { transform: translateX(0); opacity: 1; }
  30% { transform: translateX(7px); opacity: 1; }
  45% { transform: translateX(2px); opacity: 0.6; }
  65% { transform: translateX(7px); opacity: 1; }
  80% { transform: translateX(0); opacity: 0.6; }
}

/* --- Premium CTA Banner --- */
.premium-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: linear-gradient(135deg, hsl(var(--primary)) 0%, hsl(0 84% 44%) 100%);
  border: none;
  border-radius: var(--radius);
  color: white;
  cursor: pointer;
  min-height: 72px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-primary);
  transition: transform 200ms ease, box-shadow 200ms ease;
  animation: fadeInUp 0.5s ease both;
  animation-delay: 0.15s;
}

.premium-cta:active {
  transform: scale(0.98);
  box-shadow: 0 3px 10px -2px hsl(var(--primary) / 0.3);
}

.cta-icon {
  flex-shrink: 0;
  background-color: hsl(var(--primary) / 0.1);
  border-radius: 12px;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--primary));
}

.cta-icon .lucide {
  width: 20px;
  height: 20px;
}

.premium-cta .cta-icon {
  background-color: rgba(255,255,255,0.2);
  color: white;
}

.cta-text h2 {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  color: hsl(var(--foreground));
  letter-spacing: -0.02em;
}

.cta-text span {
  font-size: 13px;
  color: hsl(var(--muted-foreground));
}

.premium-cta .cta-text h2 {
  color: white;
}

.premium-cta .cta-text span {
  color: rgba(255,255,255,0.8);
}

.cta-price-tag {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  background-color: rgba(255,255,255,0.2);
  color: white;
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  backdrop-filter: blur(4px);
}

.cta-price-tag .lucide {
  width: 14px;
  height: 14px;
}

/* --- Article Items --- */
#posts-container,
#search-results-container,
#favorites-container,
#all-articles-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.articles {
  margin-bottom: 24px;
}

.article-item {
  display: flex;
  gap: 14px;
  align-items: center;
  text-decoration: none;
  color: hsl(var(--foreground));
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border) / 0.5);
  background-color: hsl(var(--card));
  box-shadow: var(--shadow-xs);
  transition: transform 200ms ease, box-shadow 200ms ease;
  cursor: pointer;
  user-select: none;
  min-height: 84px;
  animation: fadeInUp 0.4s ease both;
}

.article-item:active {
  transform: scale(0.98);
  box-shadow: none;
}

.article-item-content {
  flex: 1;
  min-width: 0;
}

.article-item-title {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.article-item-date {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  font-weight: 500;
}

.article-item-thumbnail {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background-color: hsl(var(--muted));
}

/* --- Single Post View --- */
#single-post-view {
  padding-bottom: 20px;
}

.view-promo-hero {
  margin-bottom: 20px;
}

.single-post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.single-post-actions {
  display: flex;
  gap: 4px;
}

#single-post-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
  margin-top: 16px;
  margin-bottom: 14px;
  color: hsl(var(--foreground));
  letter-spacing: -0.03em;
}

#single-post-content,
.page-content {
  font-size: 15px;
  line-height: 1.7;
}

#single-post-content p,
.page-content p {
  margin-bottom: 1em;
}

#single-post-content > p {
  text-align: justify;
}

#single-post-content img,
#single-post-content video {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid hsl(var(--border));
}

#single-post-content figure {
  margin: 16px 0;
  overflow: auto;
}

.wp-block-embed iframe {
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  max-width: 100%;
  border-radius: 10px;
}

#single-post-content {
  line-height: 1.8;
}

.wp-block-table {
  overflow-x: auto;
}

table,
td,
th {
  border: 1px solid hsl(var(--border));
  text-align: left;
  line-height: 1.6;
  font-size: 14px;
}

table {
  border-collapse: collapse;
  width: 100%;
  white-space: nowrap;
}

.wrap table,
.howTo table {
  white-space: normal;
}

th,
td {
  padding: 8px 10px;
}

.wp-block-table thead,
.wp-block-table tfoot {
  background-color: hsl(var(--primary) / 0.08);
}

#single-post-content h2,
#single-post-content h3 {
  font-size: 15px;
  font-weight: 700;
  background-color: hsl(var(--primary));
  padding: 8px 12px;
  color: hsl(var(--primary-foreground));
  margin-top: 20px;
  margin-bottom: 12px;
  border-radius: 10px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

#single-post-content h4 {
  margin-top: 16px;
  margin-bottom: 12px;
  color: hsl(var(--primary));
  font-size: 15px;
  font-weight: 700;
  line-height: 1.6;
}

#single-post-content strong {
  font-weight: 700;
}

#single-post-content a {
  color: hsl(var(--primary));
  font-weight: 500;
  text-underline-offset: 3px;
}

.has-text-align-center {
  text-align: center;
}

#single-post-content ol,
#single-post-content ul,
.page-content ol,
.page-content ul {
  margin: 0 0 1em 2.5em;
}

#single-post-content blockquote {
  border-left: 3px solid hsl(var(--primary));
  padding: 10px 14px;
  background-color: hsl(var(--primary) / 0.04);
  border-radius: 0 10px 10px 0;
  margin: 12px 0;
}

#single-post-content blockquote p:last-child {
  margin-bottom: 0;
}

.rank-math-list {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.rank-math-list-item {
  border: 1px solid hsl(var(--border));
  border-radius: 10px;
  overflow: hidden;
}

.rank-math-question {
  margin-bottom: 0 !important;
  padding: 8px 10px;
  background-color: hsl(var(--primary) / 0.06);
  font-weight: 600;
}

.rank-math-answer {
  padding: 8px 10px;
}

.rank-math-answer > p:last-child {
  margin-bottom: 0 !important;
}

/* --- Favorite Button --- */
#favorite-btn.favorited {
  color: hsl(var(--primary));
}

#favorite-btn.favorited .lucide {
  fill: hsl(var(--primary));
}

/* --- Back Button --- */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: hsl(var(--foreground));
  font-size: 14px;
  cursor: pointer;
  padding: 8px;
  min-height: 44px;
  border-radius: 12px;
  transition: background-color 150ms ease;
}

.back-btn:active {
  background-color: hsl(var(--accent));
}

.back-btn svg,
.single-post-actions svg {
  width: 20px;
  height: 20px;
}

/* --- Bottom Navigation --- */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 580px;
  margin: 0 auto;
  height: var(--bottom-nav-height);
  background-color: hsl(var(--card) / 0.85);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  border-top: 1px solid hsl(var(--border) / 0.5);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.nav-item {
  position: relative;
  background: none;
  border: none;
  color: hsl(var(--muted-foreground));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  flex-grow: 1;
  padding: 8px 4px;
  min-height: 48px;
  transition: color 200ms ease;
}

.nav-item .lucide {
  width: 22px;
  height: 22px;
  transition: transform 200ms ease;
}

.nav-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.nav-item.active {
  color: hsl(var(--primary));
}

.nav-item.active .lucide {
  transform: scale(1.1);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 3px;
  background: hsl(var(--primary));
  border-radius: 0 0 4px 4px;
}

.nav-item:active {
  color: hsl(var(--primary));
}

/* --- Side Menu --- */
#side-menu {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 280px;
  background-color: hsl(var(--card));
  z-index: 2001;
  transform: translateX(-100%);
  transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
  border-right: 1px solid hsl(var(--border));
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  box-shadow: var(--shadow-lg);
}

.side-menu-header {
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid hsl(var(--border));
}

.side-menu-header h3 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: hsl(var(--primary));
}

#side-menu-profile-section {
  margin-bottom: 16px;
}

.smp-status,
.smp-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius);
  background-color: hsl(var(--background));
  border: 1px solid hsl(var(--border) / 0.5);
}

.smp-cta {
  cursor: pointer;
  min-height: 64px;
  transition: transform 150ms ease;
}

.smp-cta:active {
  transform: scale(0.98);
}

.smp-status .lucide,
.smp-cta .lucide:first-child {
  color: hsl(var(--primary));
}

.smp-cta .lucide:last-child {
  margin-left: auto;
  color: hsl(var(--muted-foreground));
}

.smp-text h4 {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.smp-text span {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
}

.side-menu-nav {
  list-style: none;
  flex-grow: 1;
}

.side-menu-nav li {
  margin-bottom: 2px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  color: hsl(var(--foreground));
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
  min-height: 48px;
  transition: background-color 150ms ease, color 150ms ease;
}

.menu-item:active {
  background-color: hsl(var(--primary) / 0.08);
  color: hsl(var(--primary));
}

.menu-item .lucide {
  width: 20px;
  height: 20px;
  color: hsl(var(--muted-foreground));
  transition: color 150ms ease;
}

.menu-item:active .lucide {
  color: hsl(var(--primary));
}

.side-menu-footer {
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid hsl(var(--border));
  text-align: center;
}

.side-menu-footer span {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  margin-bottom: 12px;
  display: block;
  font-weight: 500;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.social-link {
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  padding: 10px;
  min-height: 44px;
  min-width: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.social-link:active {
  color: hsl(var(--primary));
  background-color: hsl(var(--primary) / 0.08);
  transform: scale(0.92);
}

/* --- Menu Overlay --- */
#menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 300ms ease, visibility 300ms ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

html.menu-open #side-menu {
  transform: translateX(0);
}

html.menu-open #menu-overlay {
  opacity: 1;
  visibility: visible;
}

/* --- Search --- */
.search-bar-container {
  position: relative;
  margin-bottom: 14px;
}

.search-bar-container .lucide {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: hsl(var(--muted-foreground));
  width: 18px;
  height: 18px;
  pointer-events: none;
}

#search-input {
  width: 100%;
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  color: hsl(var(--foreground));
  border-radius: var(--radius);
  padding: 0 14px 0 44px;
  font-size: 14px;
  font-family: inherit;
  height: 48px;
  box-shadow: var(--shadow-xs);
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

#search-input:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 3px hsl(var(--ring) / 0.12);
}

.search-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.chip {
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  color: hsl(var(--muted-foreground));
  padding: 7px 16px;
  border-radius: 9999px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  min-height: 36px;
  box-shadow: var(--shadow-xs);
  transition: all 200ms ease;
}

.chip:active {
  background-color: hsl(var(--primary));
  color: white;
  border-color: hsl(var(--primary));
  transform: scale(0.95);
}

/* --- Premium CTA Card (Settings) --- */
.premium-cta-card,
.premium-status-card {
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border) / 0.5);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  animation: fadeInUp 0.4s ease both;
}

.premium-status-card {
  background-color: hsl(var(--success) / 0.06);
  border-color: hsl(var(--success) / 0.15);
}

.premium-status-card .cta-icon {
  background-color: hsl(var(--success) / 0.12);
  color: hsl(var(--success));
}

.premium-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.premium-benefits {
  list-style: none;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.premium-benefits li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
}

.premium-benefits .lucide {
  color: hsl(var(--primary));
  width: 18px;
  height: 18px;
}

/* --- Buttons --- */
.primary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  min-height: 48px;
  box-shadow: var(--shadow-primary);
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.primary-button:active {
  transform: scale(0.98);
  box-shadow: 0 2px 8px -2px hsl(var(--primary) / 0.3);
}

.ghost-button {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: hsl(var(--foreground));
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  min-height: 44px;
  border-radius: 10px;
  transition: background-color 150ms ease;
}

.ghost-button:active {
  background-color: hsl(var(--accent));
}

.manage-subscription-btn {
  width: 100%;
  background: none;
  border: none;
  color: hsl(var(--muted-foreground));
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  padding-top: 14px;
  border-top: 1px solid hsl(var(--border));
}

/* --- Settings Groups --- */
.settings-group {
  margin-bottom: 24px;
  animation: fadeInUp 0.4s ease both;
}

.settings-group:nth-child(2) { animation-delay: 0.05s; }
.settings-group:nth-child(3) { animation-delay: 0.1s; }

.settings-group-header {
  font-size: 12px;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0 4px;
  margin-bottom: 8px;
}

.settings-group-list {
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border) / 0.5);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  color: hsl(var(--foreground));
  cursor: pointer;
  user-select: none;
  min-height: 54px;
  transition: background-color 150ms ease;
}

.setting-item:not(:last-of-type) {
  border-bottom: 1px solid hsl(var(--border) / 0.5);
}

.setting-item:active {
  background-color: hsl(var(--accent));
}

.setting-item-content {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  font-weight: 500;
}

.setting-item-content .lucide {
  color: hsl(var(--muted-foreground));
  width: 20px;
  height: 20px;
}

.setting-item > .lucide:last-child {
  color: hsl(var(--muted-foreground));
  width: 16px;
  height: 16px;
}

/* --- Toggle Switch --- */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: hsl(var(--input));
  transition: background-color 200ms ease;
  border-radius: 14px;
}

.toggle-switch .slider::before {
  position: absolute;
  content: '';
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.toggle-switch input:checked + .slider {
  background-color: hsl(var(--primary));
}

.toggle-switch input:checked + .slider::before {
  transform: translateX(20px);
}

/* --- Loaders --- */
.loader {
  border: 3px solid hsl(var(--border));
  border-top: 3px solid hsl(var(--primary));
  border-radius: 50%;
  width: 36px;
  height: 36px;
  animation: spin 0.7s linear infinite;
  margin: 3rem auto;
}

.mini-loader {
  border: 2px solid hsl(var(--border));
  border-top: 2px solid hsl(var(--primary));
  border-radius: 50%;
  width: 28px;
  height: 28px;
  animation: spin 0.7s linear infinite;
  margin: 16px auto;
}

/* --- Empty States --- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 56px 24px;
  color: hsl(var(--muted-foreground));
  animation: fadeIn 0.4s ease;
}

.empty-state .lucide {
  width: 52px;
  height: 52px;
  margin-bottom: 18px;
  stroke-width: 1.5;
  color: hsl(var(--muted-foreground) / 0.5);
}

.empty-state h2 {
  font-size: 18px;
  font-weight: 700;
  color: hsl(var(--foreground));
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.empty-state p {
  font-size: 14px;
  max-width: 260px;
  line-height: 1.5;
}

/* --- Offline Page --- */
.offline-page-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 56px 24px;
  min-height: 60vh;
  color: hsl(var(--muted-foreground));
}

.offline-page-container .lucide {
  width: 56px;
  height: 56px;
  margin-bottom: 20px;
  stroke-width: 1.5;
}

.offline-page-container h2 {
  font-size: 22px;
  font-weight: 700;
  color: hsl(var(--foreground));
  margin-bottom: 8px;
  letter-spacing: -0.03em;
}

.offline-page-container p {
  font-size: 14px;
  max-width: 280px;
  margin-bottom: 24px;
  line-height: 1.5;
}

/* --- Notice/Alert --- */
.app-notice {
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 12px 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  animation: fadeInUp 0.3s ease both;
}

.app-notice.info {
  border-left: 3px solid hsl(217 91% 60%);
  background-color: hsl(217 91% 60% / 0.04);
}

.app-notice.warning {
  border-left: 3px solid hsl(38 92% 50%);
  background-color: hsl(38 92% 50% / 0.04);
}

.app-notice .lucide {
  width: 18px;
  height: 18px;
  color: hsl(var(--muted-foreground));
  flex-shrink: 0;
  margin-top: 1px;
}

.app-notice-content {
  flex: 1;
}

.app-notice-content h4 {
  font-size: 14px;
  font-weight: 700;
  color: hsl(var(--foreground));
  margin-bottom: 2px;
}

.app-notice-content p {
  font-size: 13px;
  color: hsl(var(--muted-foreground));
  line-height: 1.4;
  margin: 0;
}

/* --- Sponsor Slider --- */
.sponsor-slider-container {
  margin: 8px 0 16px 0;
  background-color: hsl(var(--card));
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid hsl(var(--border) / 0.5);
  position: relative;
  box-shadow: var(--shadow-sm);
}

.sponsor-slider {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.sponsor-slides {
  display: flex;
  width: 100%;
  transition: transform 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

.sponsor-slide {
  min-width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: hsl(var(--muted) / 0.5);
}

.sponsor-slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: pointer;
}

.sponsor-slide img:active {
  opacity: 0.9;
}

.sponsor-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 10;
}

.sponsor-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: hsl(var(--muted-foreground) / 0.25);
  cursor: pointer;
  transition: all 250ms ease;
}

.sponsor-dot.active {
  background-color: hsl(var(--primary));
  width: 18px;
  border-radius: 3px;
}


.sponsor-slide.active .sponsor-slide-progress {
  animation: slideProgress 5s linear;
}

.sponsor-slide-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 100%;
  background: hsl(var(--primary));
  transform-origin: left;
  transform: scaleX(0);
}

.sponsor-fade-in {
  animation: sponsorFadeIn 400ms ease;
}

/* --- App Version --- */
.app-version {
  text-align: center;
  font-size: 12px;
  color: hsl(var(--muted-foreground) / 0.6);
  margin-top: 28px;
  padding-bottom: 8px;
  font-weight: 500;
}

/* --- Tap Ripple Effect --- */
.ripple-host {
  position: relative;
  overflow: hidden;
}

.ripple-circle {
  position: absolute;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.12;
  transform: scale(0);
  animation: rippleExpand 500ms ease forwards;
  pointer-events: none;
  z-index: 0;
}

@keyframes rippleExpand {
  to {
    transform: scale(2.5);
    opacity: 0;
  }
}

/* --- Utility --- */
.hidden {
  display: none !important;
}

/* --- Page Content (About, Privacy, Terms) --- */
.page-content h2,
#terms-view h2 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 16px;
  margin-bottom: 12px;
  color: hsl(var(--foreground));
  letter-spacing: -0.03em;
}

/* --- Responsive --- */
@media (max-width: 480px) {
  .premium-cta {
    padding: 14px;
  }
  .cta-text h2 {
    font-size: 15px;
  }
}

@media (max-width: 360px) {
  .service-list {
    grid-template-columns: repeat(3, 1fr);
  }
  main {
    padding: 10px;
    padding-bottom: calc(var(--bottom-nav-height) + 10px);
  }
}
