/* ============================================================
   ShenLuoSheng.com — My Little Pony Style Theme
   ============================================================ */

/* ---- Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&display=swap');

:root {
  /* MLP color palette - pastel & magical */
  --mlp-pink: #FF69B4;
  --mlp-pink-light: #FFB6C1;
  --mlp-pink-pale: #FFF0F5;
  --mlp-purple: #9370DB;
  --mlp-purple-light: #DDA0DD;
  --mlp-lavender: #E6E6FA;
  --mlp-blue: #87CEEB;
  --mlp-blue-light: #B0E0E6;
  --mlp-blue-pale: #E0F7FF;
  --mlp-yellow: #FFD700;
  --mlp-yellow-light: #FFFACD;
  --mlp-green: #98FB98;
  --mlp-green-light: #E0FFE0;
  --mlp-orange: #FFA07A;
  --mlp-white: #FFFEFE;
  --mlp-black: #2D1B4E;
  --mlp-gold: #FFD700;
  --mlp-rainbow1: #FF6B6B;
  --mlp-rainbow2: #FFA07A;
  --mlp-rainbow3: #FFD700;
  --mlp-rainbow4: #98FB98;
  --mlp-rainbow5: #87CEEB;
  --mlp-rainbow6: #DDA0DD;

  /* Layout */
  --header-height: 80px;
  --footer-height: 60px;
  --max-width: 1200px;
  --radius: 16px;
  --radius-sm: 10px;
}

/* ---- Reset & Base ---- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Quicksand', 'Comic Sans MS', sans-serif;
  font-size: 17px;
  color: var(--mlp-black);
  line-height: 1.6;
  min-height: 100vh;
  background: linear-gradient(170deg,
    #fce4ec 0%,
    #f3e5f5 25%,
    #e8eaf6 50%,
    #e0f7fa 75%,
    #fff3e0 100%
  );
  background-attachment: fixed;
  overflow-x: hidden;
}

/* ---- Floating Hearts & Sparkles ---- */
.float-heart {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  animation: float-up 15s linear infinite;
  opacity: 0.15;
  font-size: 20px;
}
.float-heart:nth-child(1) { left: 5%; animation-duration: 18s; animation-delay: 0s; }
.float-heart:nth-child(2) { left: 15%; animation-duration: 22s; animation-delay: -4s; font-size: 14px; }
.float-heart:nth-child(3) { left: 30%; animation-duration: 16s; animation-delay: -8s; }
.float-heart:nth-child(4) { left: 45%; animation-duration: 20s; animation-delay: -2s; font-size: 24px; }
.float-heart:nth-child(5) { left: 55%; animation-duration: 14s; animation-delay: -6s; }
.float-heart:nth-child(6) { left: 65%; animation-duration: 19s; animation-delay: -10s; font-size: 16px; }
.float-heart:nth-child(7) { left: 75%; animation-duration: 17s; animation-delay: -3s; }
.float-heart:nth-child(8) { left: 85%; animation-duration: 21s; animation-delay: -7s; font-size: 18px; }
.float-heart:nth-child(9) { left: 92%; animation-duration: 15s; animation-delay: -5s; }
.float-heart:nth-child(10) { left: 10%; animation-duration: 23s; animation-delay: -9s; font-size: 12px; }

@keyframes float-up {
  from { transform: translateY(100vh) rotate(0deg); opacity: 0.15; }
  to { transform: translateY(-100px) rotate(360deg); opacity: 0; }
}

/* ---- Cloud decoration (soft) ---- */
.cloud {
  position: fixed;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  width: 100px;
  height: 30px;
  z-index: 0;
  pointer-events: none;
  animation: cloud-float 30s linear infinite;
  filter: blur(1px);
}
.cloud::before, .cloud::after {
  content: '';
  position: absolute;
  background: inherit;
  border-radius: 50%;
}
.cloud::before {
  width: 50px;
  height: 40px;
  top: -18px;
  left: 18px;
}
.cloud::after {
  width: 65px;
  height: 32px;
  top: -12px;
  left: 42px;
}
@keyframes cloud-float {
  from { transform: translateX(-200px); }
  to { transform: translateX(calc(100vw + 200px)); }
}

/* ---- Header ---- */
.pixel-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, 
    var(--mlp-pink) 0%, 
    var(--mlp-purple) 50%, 
    var(--mlp-blue) 100%
  );
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  box-shadow: 0 4px 20px rgba(147, 112, 219, 0.3);
}

.header-title {
  font-family: 'Fredoka One', cursive;
  font-size: 26px;
  color: var(--mlp-white);
  text-shadow: 2px 2px 0 rgba(0,0,0,0.1), 0 0 20px rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-decoration: none;
}

.header-title .pixel-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--mlp-yellow), var(--mlp-orange));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 2px 10px rgba(255, 215, 0, 0.4);
}

.header-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pixel-btn {
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.25);
  color: var(--mlp-white);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 25px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pixel-btn:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
}

.pixel-btn:active {
  transform: translateY(0px);
}

.pixel-btn.gold {
  background: linear-gradient(135deg, var(--mlp-yellow), var(--mlp-orange));
  border-color: transparent;
  color: var(--mlp-black);
}

.pixel-btn.green {
  background: linear-gradient(135deg, var(--mlp-blue), var(--mlp-purple));
  border-color: transparent;
  color: var(--mlp-white);
}

/* ---- Main Content ---- */
.main-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 16px;
  position: relative;
  z-index: 1;
  min-height: calc(100vh - var(--header-height) - var(--footer-height));
}

/* ---- Stats Bar ---- */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 32px;
  padding: 16px 24px;
  margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  border-radius: var(--radius);
  box-shadow: 0 2px 20px rgba(147, 112, 219, 0.1);
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
  color: var(--mlp-black);
  font-size: 15px;
}

.stat-item .stat-value {
  font-family: 'Fredoka One', cursive;
  font-size: 20px;
  display: block;
  background: linear-gradient(135deg, var(--mlp-pink), var(--mlp-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-item .stat-label {
  font-size: 13px;
  opacity: 0.6;
  font-weight: 600;
}

/* ---- Photo Grid ---- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding: 8px;
}

.photo-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(147, 112, 219, 0.08);
  padding: 10px;
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}

.photo-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, 
    var(--mlp-rainbow1), var(--mlp-rainbow2), var(--mlp-rainbow3), 
    var(--mlp-rainbow4), var(--mlp-rainbow5), var(--mlp-rainbow6)
  );
  border-radius: var(--radius) var(--radius) 0 0;
}

.photo-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 30px rgba(147, 112, 219, 0.2);
}

.photo-card:active {
  transform: translateY(-2px);
}

.photo-card .photo-frame {
  position: relative;
  width: 100%;
  padding-bottom: 75%;
  background: #f0e6ff;
  overflow: hidden;
  border-radius: var(--radius-sm);
}

.photo-card .photo-frame img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.photo-card:hover .photo-frame img {
  transform: scale(1.08);
}

.photo-card .photo-info {
  padding: 12px 6px 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.photo-card .photo-name {
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: var(--mlp-black);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-card .photo-stats {
  display: flex;
  gap: 10px;
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 12px;
  color: var(--mlp-purple);
}

.like-badge, .comment-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* ---- Rainbow Loading Animation ---- */
.rainbow-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
}

.rainbow-spinner {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 5px solid transparent;
  border-top-color: var(--mlp-pink);
  border-right-color: var(--mlp-yellow);
  border-bottom-color: var(--mlp-blue);
  border-left-color: var(--mlp-purple);
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}

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

.rainbow-loader-text {
  font-family: 'Fredoka One', cursive;
  font-size: 16px;
  background: linear-gradient(90deg, 
    var(--mlp-rainbow1), var(--mlp-rainbow2), var(--mlp-rainbow3), 
    var(--mlp-rainbow4), var(--mlp-rainbow5)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: blink 1.2s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0.5; }
}

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: 80px 20px;
}

.empty-state .empty-icon {
  display: inline-flex;
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--mlp-pink), var(--mlp-purple));
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(255, 105, 180, 0.3);
}

.empty-state h2 {
  font-family: 'Fredoka One', cursive;
  font-size: 20px;
  color: var(--mlp-black);
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 16px;
  color: rgba(45, 27, 78, 0.6);
}

/* ---- Footer ---- */
.pixel-footer {
  background: linear-gradient(135deg, 
    var(--mlp-pink) 0%, 
    var(--mlp-purple) 50%, 
    var(--mlp-blue) 100%
  );
  height: var(--footer-height);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 -4px 20px rgba(147, 112, 219, 0.2);
}

.footer-text {
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--mlp-white);
  opacity: 0.9;
}

/* ---- Notification Toast ---- */
.pixel-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-radius: var(--radius);
  padding: 14px 28px;
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--mlp-black);
  z-index: 9999;
  box-shadow: 0 4px 25px rgba(147, 112, 219, 0.2);
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  border: 2px solid rgba(255, 182, 193, 0.5);
}

.pixel-toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }

  .header-title {
    font-size: 18px;
  }

  .header-title .pixel-icon {
    width: 36px;
    height: 36px;
    font-size: 20px;
  }

  .pixel-btn {
    font-size: 11px;
    padding: 8px 14px;
  }

  .stats-bar {
    gap: 16px;
    padding: 12px 16px;
  }

  .stat-item {
    font-size: 13px;
  }

  .stat-item .stat-value {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .photo-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .header-nav {
    display: none;
  }

  .header-title {
    font-size: 15px;
  }
}

/* ---- Modal / Lightbox ---- */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(45, 27, 78, 0.8);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal-overlay.show {
  display: flex;
}

.modal-content {
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius);
  box-shadow: 0 10px 50px rgba(147, 112, 219, 0.3);
  padding: 12px;
}

.modal-content img {
  max-width: 100%;
  max-height: calc(90vh - 140px);
  display: block;
  border-radius: var(--radius-sm);
}

.modal-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--mlp-pink), var(--mlp-purple));
  border: none;
  border-radius: 50%;
  color: var(--mlp-white);
  font-family: 'Quicksand', sans-serif;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(255, 105, 180, 0.4);
  transition: transform 0.2s;
}

.modal-close:hover {
  transform: scale(1.1);
}

.modal-details {
  padding: 12px 8px 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-like-btn {
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--mlp-yellow), var(--mlp-orange));
  color: var(--mlp-black);
  border: none;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 10px rgba(255, 215, 0, 0.3);
}

.modal-like-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.modal-like-btn.liked {
  background: linear-gradient(135deg, var(--mlp-pink), var(--mlp-purple));
  color: var(--mlp-white);
}

.modal-comments {
  max-height: 200px;
  overflow-y: auto;
  padding: 10px;
  margin-top: 8px;
  background: rgba(230, 230, 250, 0.5);
  border-radius: var(--radius-sm);
}

.comment-item {
  padding: 8px 0;
  border-bottom: 1px solid rgba(147, 112, 219, 0.15);
  font-size: 14px;
}

.comment-item:last-child {
  border-bottom: none;
}

.comment-author {
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 12px;
  color: var(--mlp-purple);
}

.comment-text {
  color: var(--mlp-black);
  margin-top: 2px;
}

.comment-time {
  font-size: 11px;
  color: rgba(45, 27, 78, 0.4);
  float: right;
}

.comment-form {
  display: flex;
  gap: 8px;
  padding: 8px;
  margin-top: 8px;
}

.pixel-input {
  font-family: 'Quicksand', sans-serif;
  font-size: 14px;
  padding: 8px 14px;
  background: var(--mlp-white);
  border: 2px solid rgba(147, 112, 219, 0.2);
  border-radius: 20px;
  color: var(--mlp-black);
  outline: none;
  transition: border-color 0.2s;
}

.pixel-input:focus {
  border-color: var(--mlp-purple);
  box-shadow: 0 0 0 3px rgba(147, 112, 219, 0.1);
}

.pixel-input.name-input {
  width: 100px;
}

.pixel-input.comment-input {
  flex: 1;
}

/* ---- Photo Detail Page ---- */
.photo-detail-container {
  max-width: 900px;
  margin: 0 auto;
}

.photo-detail-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(147, 112, 219, 0.08);
  padding: 16px;
}

.photo-detail-card .detail-image {
  width: 100%;
  margin-bottom: 16px;
  background: #f0e6ff;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.photo-detail-card .detail-image img {
  width: 100%;
  display: block;
}

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

.detail-title {
  font-family: 'Fredoka One', cursive;
  font-size: 20px;
  color: var(--mlp-black);
}

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

.detail-like-count {
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 14px;
  background: linear-gradient(135deg, var(--mlp-pink), var(--mlp-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.detail-description {
  font-size: 16px;
  color: rgba(45, 27, 78, 0.7);
  margin-bottom: 16px;
  padding: 12px;
  background: rgba(230, 230, 250, 0.4);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--mlp-purple);
}

.comments-section {
  background: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 16px;
  box-shadow: 0 2px 10px rgba(147, 112, 219, 0.05);
}

.comments-title {
  font-family: 'Fredoka One', cursive;
  font-size: 16px;
  color: var(--mlp-black);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(147, 112, 219, 0.2);
}

.comments-list {
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 12px;
}

.no-comments {
  color: rgba(45, 27, 78, 0.4);
  font-size: 15px;
  text-align: center;
  padding: 20px;
}

/* ---- Back button ---- */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
}

/* ---- Search / Filter ---- */
.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  justify-content: center;
}

.search-input {
  font-family: 'Quicksand', sans-serif;
  font-size: 15px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.8);
  border: 2px solid rgba(147, 112, 219, 0.2);
  border-radius: 25px;
  color: var(--mlp-black);
  outline: none;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 2px 10px rgba(147, 112, 219, 0.05);
  transition: all 0.2s;
}

.search-input:focus {
  border-color: var(--mlp-purple);
  box-shadow: 0 0 0 3px rgba(147, 112, 219, 0.1);
}

/* ---- Scroll to top ---- */
.scroll-top {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--mlp-pink), var(--mlp-purple));
  border: none;
  border-radius: 50%;
  color: var(--mlp-white);
  font-size: 20px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  box-shadow: 0 2px 15px rgba(255, 105, 180, 0.3);
  transition: transform 0.2s;
}

.scroll-top.show {
  display: flex;
}

.scroll-top:hover {
  transform: scale(1.1);
}
