/* ===== Top Page Specific Styles ===== */

/* ===== Decorative Elements ===== */
.sparkle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--gold);
  border-radius: 50%;
  animation: sparkle 3s ease-in-out infinite;
}

.sparkle::before,
.sparkle::after {
  content: '';
  position: absolute;
  background: var(--gold);
}

.sparkle::before {
  width: 2px;
  height: 16px;
  left: 3px;
  top: -4px;
}

.sparkle::after {
  width: 16px;
  height: 2px;
  left: -4px;
  top: 3px;
}

@keyframes sparkle {
  0%, 100% { opacity: 0.4; transform: scale(0.8) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.2) rotate(45deg); }
}

.floating-circle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.4;
  animation: float 8s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(10deg); }
}

/* ===== Hero Section ===== */
.hero {
  position: relative;
  padding: 5rem 2rem 6rem;
  text-align: center;
  background:
    radial-gradient(ellipse at 20% 20%, var(--lavender-pale) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, var(--rose-pale) 0%, transparent 50%),
    var(--bg-cream);
  overflow: hidden;
}

.hero .floating-circle:nth-child(1) {
  width: 300px;
  height: 300px;
  background: var(--lavender-pale);
  top: -100px;
  right: -50px;
}

.hero .floating-circle:nth-child(2) {
  width: 200px;
  height: 200px;
  background: var(--rose-pale);
  bottom: -50px;
  left: -50px;
  animation-delay: 2s;
}

.hero .sparkle:nth-child(3) { top: 15%; left: 15%; }
.hero .sparkle:nth-child(4) { top: 25%; right: 20%; animation-delay: 1s; }
.hero .sparkle:nth-child(5) { bottom: 30%; left: 25%; animation-delay: 2s; }
.hero .sparkle:nth-child(6) { top: 45%; right: 12%; animation-delay: 0.5s; }

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--white);
  padding: 0.5rem 1.2rem;
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text-medium);
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 15px var(--shadow);
  animation: fadeInDown 0.8s ease-out;
}

.hero-badge span {
  color: var(--gold);
}

.hero h1 {
  font-family: 'Shippori Mincho', serif;
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 1.2rem;
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero h1 .gradient-text {
  background: linear-gradient(135deg, var(--lavender) 0%, var(--rose-deep) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-medium);
  margin-bottom: 2.5rem;
  animation: fadeInUp 0.8s ease-out 0.4s both;
}

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

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

.search-container {
  animation: fadeInUp 0.8s ease-out 0.6s both;
}

.search-box {
  display: flex;
  gap: 0.8rem;
  max-width: 600px;
  margin: 0 auto 1.5rem;
  background: var(--white);
  padding: 0.5rem;
  border-radius: 35px;
  box-shadow: 0 4px 30px var(--shadow);
}

.search-box input {
  flex: 1;
  padding: 1rem 1.5rem;
  border: none;
  border-radius: 30px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-dark);
  background: transparent;
}

.search-box input::placeholder {
  color: var(--text-light);
}

.search-box input:focus {
  outline: none;
}

.search-box button {
  background: linear-gradient(135deg, var(--gold) 0%, var(--coral) 100%);
  color: var(--white);
  border: none;
  padding: 1rem 2rem;
  border-radius: 30px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-box button:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 20px rgba(212, 175, 135, 0.4);
}

.categories {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  animation: fadeInUp 0.8s ease-out 0.8s both;
}

.category-tag {
  background: var(--white);
  padding: 0.6rem 1.2rem;
  border-radius: 20px;
  font-size: 0.9rem;
  color: var(--text-medium);
  cursor: pointer;
  transition: all 0.3s;
  border: 2px solid transparent;
  text-decoration: none;
}

.category-tag:hover {
  border-color: var(--lavender-light);
  transform: translateY(-2px);
}

.category-tag.active {
  background: linear-gradient(135deg, var(--lavender) 0%, var(--rose) 100%);
  color: var(--white);
}

/* ===== Search Tabs ===== */
.search-tabs-section {
  max-width: 1200px;
  margin: -1.5rem auto 0;
  padding: 0 2rem;
  position: relative;
  z-index: 2;
}

.search-tabs {
  background: var(--white);
  border-radius: 16px;
  padding: 0.5rem;
  display: flex;
  gap: 0.3rem;
  box-shadow: 0 4px 20px var(--shadow);
}

.search-tab {
  flex: 1;
  background: transparent;
  border: none;
  padding: 1rem;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-medium);
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.search-tab:hover {
  background: var(--bg-beige);
}

.search-tab.active {
  background: linear-gradient(135deg, var(--lavender) 0%, var(--rose) 100%);
  color: var(--white);
}

.search-tab .count {
  background: rgba(255,255,255,0.2);
  padding: 0.2rem 0.5rem;
  border-radius: 10px;
  font-size: 0.75rem;
}

.search-tab.active .count {
  background: rgba(255,255,255,0.3);
}

/* ===== Main Content ===== */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* ===== Category Browse ===== */
.category-section {
  margin-bottom: 3rem;
}

/* Category Grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.category-card {
  background: var(--white);
  border-radius: 16px;
  padding: 1.5rem 1rem;
  text-align: center;
  text-decoration: none;
  color: var(--text-dark);
  border: 1px solid var(--bg-greige);
  transition: all 0.3s;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px var(--shadow);
  border-color: var(--lavender-light);
}

.category-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 0.8rem;
  background: linear-gradient(135deg, var(--lavender-pale) 0%, var(--rose-pale) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}

.category-name {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
}

.category-count {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* ===== Divination Types ===== */
.divination-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

.divination-card {
  background: var(--white);
  border-radius: 12px;
  padding: 1rem;
  text-decoration: none;
  color: var(--text-dark);
  border: 1px solid var(--bg-greige);
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.divination-card:hover {
  border-color: var(--lavender-light);
  background: var(--lavender-pale);
}

.divination-icon {
  width: 40px;
  height: 40px;
  background: var(--bg-beige);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

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

.divination-name {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.1rem;
}

.divination-count {
  font-size: 0.75rem;
  color: var(--text-light);
}

/* ===== Popular Keywords ===== */
.keywords-section {
  background: var(--white);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 3rem;
  border: 1px solid var(--bg-greige);
}

.keywords-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.keyword-tag {
  background: var(--bg-beige);
  padding: 0.6rem 1.2rem;
  border-radius: 20px;
  text-decoration: none;
  color: var(--text-medium);
  font-size: 0.9rem;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.keyword-tag:hover {
  background: var(--lavender);
  color: var(--white);
}

.keyword-tag .hot {
  background: var(--coral);
  color: var(--white);
  padding: 0.1rem 0.4rem;
  border-radius: 8px;
  font-size: 0.65rem;
  font-weight: 700;
}

/* ===== Online Fortunetellers ===== */
.online-section {
  margin-bottom: 3rem;
}

.online-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.online-count {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(76, 175, 80, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  color: var(--green);
  font-size: 0.9rem;
  font-weight: 600;
}

.online-count::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

.online-scroll {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.online-scroll::-webkit-scrollbar {
  height: 6px;
}

.online-scroll::-webkit-scrollbar-track {
  background: var(--bg-greige);
  border-radius: 3px;
}

.online-scroll::-webkit-scrollbar-thumb {
  background: var(--lavender-light);
  border-radius: 3px;
}

.online-card {
  flex: 0 0 200px;
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--bg-greige);
  cursor: pointer;
  transition: all 0.3s;
  scroll-snap-align: start;
  text-decoration: none;
  color: inherit;
}

.online-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px var(--shadow);
}

.online-card-header {
  height: 100px;
  background: linear-gradient(135deg, var(--lavender-pale) 0%, var(--rose-pale) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.online-avatar {
  width: 60px;
  height: 60px;
  background: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 4px 15px var(--shadow);
  overflow: hidden;
}

.online-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.online-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--green);
  color: var(--white);
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  font-size: 0.65rem;
  font-weight: 700;
}

.online-card-body {
  padding: 1rem;
  text-align: center;
}

.online-name {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
}

.online-specialty {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.online-rating {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  font-size: 0.8rem;
}

.online-rating .stars {
  color: var(--gold);
}

.online-rating .score {
  font-weight: 700;
  color: var(--lavender);
}

/* ===== Advanced Search Panel ===== */
.advanced-search {
  background: var(--white);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 3rem;
  border: 1px solid var(--bg-greige);
}

.advanced-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  cursor: pointer;
}

.advanced-header h3 {
  font-family: 'Shippori Mincho', serif;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toggle-icon {
  font-size: 1.2rem;
  color: var(--text-light);
  transition: transform 0.3s;
}

.toggle-icon.open {
  transform: rotate(180deg);
}

.advanced-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.filter-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dark);
}

.filter-select {
  padding: 0.8rem 1rem;
  border: 2px solid var(--bg-greige);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-dark);
  background: var(--white);
  cursor: pointer;
  transition: all 0.3s;
}

.filter-select:focus {
  outline: none;
  border-color: var(--lavender-light);
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.8rem;
  background: var(--bg-beige);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 0.85rem;
}

.checkbox-item:hover {
  background: var(--lavender-pale);
}

.checkbox-item input {
  display: none;
}

.checkbox-item input:checked + span {
  color: var(--lavender);
  font-weight: 600;
}

.checkbox-item input:checked ~ .check-icon {
  color: var(--lavender);
}

.price-slider {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.price-range-display {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-medium);
}

.range-slider {
  width: 100%;
  height: 6px;
  background: var(--bg-greige);
  border-radius: 3px;
  -webkit-appearance: none;
  cursor: pointer;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, var(--lavender) 0%, var(--rose) 100%);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(155, 139, 196, 0.4);
}

.advanced-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--bg-greige);
}

.btn-reset {
  background: var(--bg-beige);
  color: var(--text-medium);
  border: none;
  padding: 0.8rem 2rem;
  border-radius: 25px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-reset:hover {
  background: var(--bg-greige);
}

.btn-search {
  background: linear-gradient(135deg, var(--lavender) 0%, var(--rose) 100%);
  color: var(--white);
  border: none;
  padding: 0.8rem 3rem;
  border-radius: 25px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-search:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(155, 139, 196, 0.4);
}

/* ===== Recent Searches ===== */
.recent-section {
  margin-bottom: 3rem;
}

.recent-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.recent-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--white);
  padding: 0.6rem 1rem;
  border-radius: 20px;
  border: 1px solid var(--bg-greige);
  text-decoration: none;
  color: var(--text-medium);
  font-size: 0.85rem;
  transition: all 0.3s;
}

.recent-item:hover {
  border-color: var(--lavender-light);
  color: var(--lavender);
}

.recent-item .icon {
  color: var(--text-light);
}

.recent-item .remove {
  color: var(--text-light);
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 50%;
  transition: all 0.3s;
}

.recent-item .remove:hover {
  background: var(--rose-pale);
  color: var(--rose-deep);
}

/* ===== Ranking Preview ===== */
.ranking-section {
  background: linear-gradient(135deg, var(--lavender-pale) 0%, var(--rose-pale) 100%);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 3rem;
}

.ranking-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.ranking-card {
  background: var(--white);
  border-radius: 16px;
  padding: 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  color: inherit;
}

.ranking-card:hover {
  transform: translateX(5px);
  box-shadow: 0 8px 25px var(--shadow);
}

.ranking-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.ranking-number.gold {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  color: var(--white);
}

.ranking-number.silver {
  background: linear-gradient(135deg, #C0C0C0 0%, #A0A0A0 100%);
  color: var(--white);
}

.ranking-number.bronze {
  background: linear-gradient(135deg, #CD7F32 0%, #B87333 100%);
  color: var(--white);
}

.ranking-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--lavender-pale) 0%, var(--rose-pale) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  overflow: hidden;
}

.ranking-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.ranking-name {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.ranking-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.8rem;
  color: var(--text-light);
}

.ranking-meta .stars {
  color: var(--gold);
}

/* ===== Latest Articles Section ===== */
.articles-section {
  margin-bottom: 3rem;
}

.articles-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.articles-scroll {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.articles-scroll::-webkit-scrollbar {
  height: 6px;
}

.articles-scroll::-webkit-scrollbar-track {
  background: var(--bg-greige);
  border-radius: 3px;
}

.articles-scroll::-webkit-scrollbar-thumb {
  background: var(--lavender-light);
  border-radius: 3px;
}

.article-card {
  flex: 0 0 200px;
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--bg-greige);
  text-decoration: none;
  color: inherit;
  transition: all 0.3s;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px var(--shadow);
  border-color: var(--lavender-light);
}

.article-thumbnail {
  width: 100%;
  height: 110px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--lavender-pale) 0%, var(--rose-pale) 100%);
}

.article-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.article-card:hover .article-thumbnail img {
  transform: scale(1.05);
}

.article-thumbnail-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  opacity: 0.5;
}

.article-content {
  padding: 0.8rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.article-category {
  display: inline-block;
  background: var(--lavender-pale);
  color: var(--lavender);
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  font-size: 0.65rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  align-self: flex-start;
}

.article-title {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-dark);
  margin: 0 0 0.4rem 0;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-date {
  font-size: 0.7rem;
  color: var(--text-light);
}

/* ===== Responsive - Top Page ===== */
@media (max-width: 768px) {
  .hero { padding: 3rem 1.5rem 4rem; }
  .hero h1 { font-size: 2.2rem; }

  .search-box {
    flex-direction: column;
    padding: 0.8rem;
  }

  .search-box button {
    width: 100%;
    justify-content: center;
  }

  .search-tabs {
    flex-wrap: wrap;
  }

  .search-tab {
    flex: 1 1 45%;
  }

  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .advanced-body {
    grid-template-columns: 1fr;
  }

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