/* ============================================
   PULSE - Next-Gen Social Media Styles
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: #0a0a1a;
  color: #fff;
  font-family: 'Inter', system-ui, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(108, 92, 231, 0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(108, 92, 231, 0.5); }

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes popIn {
  0% { transform: scale(0); }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
@keyframes heartBurst {
  0% { transform: scale(0); opacity: 1; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes pulse-ring {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(1.4); opacity: 0; }
}
@keyframes storyGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
@keyframes notifBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.animate-fadeInUp { animation: fadeInUp 0.5s ease-out forwards; }
.animate-fadeIn { animation: fadeIn 0.3s ease-out forwards; }
.animate-slideInRight { animation: slideInRight 0.4s ease-out forwards; }
.animate-slideInLeft { animation: slideInLeft 0.4s ease-out forwards; }
.animate-scaleIn { animation: scaleIn 0.3s ease-out forwards; }
.animate-popIn { animation: popIn 0.3s ease-out forwards; }
.animate-float { animation: float 3s ease-in-out infinite; }
.animate-slideUp { animation: slideUp 0.4s cubic-bezier(0.32, 0.72, 0, 1) forwards; }

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }

/* ============================================
   GLASS MORPHISM & CARDS
   ============================================ */
.glass {
  background: rgba(26, 26, 46, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(108, 92, 231, 0.1);
}

.glass-strong {
  background: rgba(26, 26, 46, 0.9);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(108, 92, 231, 0.15);
}

.post-card {
  background: rgba(26, 26, 46, 0.6);
  border: 1px solid rgba(108, 92, 231, 0.08);
  border-radius: 20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.post-card:hover {
  border-color: rgba(108, 92, 231, 0.2);
  box-shadow: 0 8px 40px rgba(108, 92, 231, 0.08);
}

/* ============================================
   STORY RING
   ============================================ */
.story-ring {
  background: linear-gradient(45deg, #6C5CE7, #a855f7, #ec4899, #f97316, #6C5CE7);
  background-size: 300% 300%;
  animation: storyGradient 3s ease infinite;
  padding: 3px;
  border-radius: 50%;
}

.story-ring-viewed {
  background: rgba(75, 75, 88, 0.5);
  padding: 2px;
  border-radius: 50%;
}

.story-ring img,
.story-ring-viewed img {
  border: 3px solid #0a0a1a;
  border-radius: 50%;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-pulse {
  background: linear-gradient(135deg, #6C5CE7 0%, #a855f7 100%);
  color: white;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-pulse:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(108, 92, 231, 0.4);
}

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

.btn-outline {
  background: transparent;
  color: #d4c9ff;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: 12px;
  border: 2px solid rgba(108, 92, 231, 0.4);
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-outline:hover {
  background: rgba(108, 92, 231, 0.1);
  border-color: rgba(108, 92, 231, 0.7);
}

/* ============================================
   LIKE ANIMATION
   ============================================ */
.like-btn {
  transition: all 0.2s ease;
  cursor: pointer;
}

.like-btn:hover {
  transform: scale(1.1);
}

.like-btn.liked {
  color: #ec4899;
  animation: heartBurst 0.4s ease-out;
}

.like-btn.liked i {
  filter: drop-shadow(0 0 8px rgba(236, 72, 153, 0.6));
}

/* Double tap heart overlay */
.heart-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-size: 80px;
  color: white;
  filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.4));
  pointer-events: none;
  z-index: 10;
}

.heart-overlay.show {
  animation: heartBurst 0.8s ease-out forwards;
}

/* ============================================
   LOADING SKELETON
   ============================================ */
.skeleton {
  background: linear-gradient(90deg, rgba(26, 26, 46, 0.6) 25%, rgba(40, 40, 70, 0.6) 50%, rgba(26, 26, 46, 0.6) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 12px;
}

/* ============================================
   NAVIGATION
   ============================================ */
.nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #757584;
}

.nav-item:hover {
  color: #d4c9ff;
  background: rgba(108, 92, 231, 0.08);
}

.nav-item.active {
  color: #6C5CE7;
}

.nav-item.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  width: 4px;
  height: 4px;
  background: #6C5CE7;
  border-radius: 50%;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #b8b8c1;
  font-weight: 500;
  font-size: 15px;
}

.sidebar-link:hover {
  background: rgba(108, 92, 231, 0.1);
  color: #fff;
}

.sidebar-link.active {
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.2) 0%, rgba(168, 85, 247, 0.1) 100%);
  color: #fff;
  border: 1px solid rgba(108, 92, 231, 0.2);
}

.sidebar-link.active i {
  color: #6C5CE7;
}

/* ============================================
   NOTIFICATIONS BADGE
   ============================================ */
.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  background: linear-gradient(135deg, #ec4899, #f97316);
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  animation: notifBounce 2s ease-in-out infinite;
}

/* ============================================
   INPUT FIELDS
   ============================================ */
.input-pulse {
  background: rgba(26, 26, 46, 0.8);
  border: 2px solid rgba(108, 92, 231, 0.15);
  border-radius: 14px;
  padding: 12px 16px;
  color: white;
  font-size: 15px;
  transition: all 0.3s ease;
  outline: none;
  width: 100%;
}

.input-pulse::placeholder {
  color: rgba(183, 183, 193, 0.5);
}

.input-pulse:focus {
  border-color: #6C5CE7;
  box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.1);
}

/* ============================================
   MODAL / OVERLAY
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

.modal-content {
  background: #1a1a2e;
  border: 1px solid rgba(108, 92, 231, 0.15);
  border-radius: 24px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: scaleIn 0.3s ease-out;
}

/* ============================================
   EXPLORE GRID
   ============================================ */
.explore-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.explore-grid .grid-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  cursor: pointer;
  border-radius: 4px;
}

.explore-grid .grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.explore-grid .grid-item:hover img {
  transform: scale(1.05);
}

.explore-grid .grid-item .overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.explore-grid .grid-item:hover .overlay {
  opacity: 1;
}

/* ============================================
   TOOLTIP
   ============================================ */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a2e;
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  border: 1px solid rgba(108, 92, 231, 0.2);
}

.tooltip:hover::after {
  opacity: 1;
}

/* ============================================
   VERIFIED BADGE
   ============================================ */
.verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: linear-gradient(135deg, #6C5CE7, #a855f7);
  border-radius: 50%;
  margin-left: 4px;
  font-size: 8px;
}

/* ============================================
   GLOW EFFECTS
   ============================================ */
.glow-purple {
  box-shadow: 0 0 60px rgba(108, 92, 231, 0.15);
}

.text-glow {
  text-shadow: 0 0 30px rgba(108, 92, 231, 0.3);
}

/* ============================================
   PROFILE COVER
   ============================================ */
.profile-cover {
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.3) 0%, rgba(168, 85, 247, 0.2) 50%, rgba(236, 72, 153, 0.15) 100%);
  position: relative;
}

.profile-cover::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 40%, rgba(108, 92, 231, 0.3), transparent 50%),
              radial-gradient(circle at 70% 60%, rgba(168, 85, 247, 0.2), transparent 50%);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .desktop-sidebar { display: none !important; }
  .mobile-nav { display: flex !important; }
  .main-content { margin-left: 0 !important; margin-right: 0 !important; }
}

@media (min-width: 769px) {
  .mobile-nav { display: none !important; }
}

@media (max-width: 1280px) {
  .right-sidebar { display: none !important; }
}

/* ============================================
   STORY VIEWER
   ============================================ */
.story-viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-progress {
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

.story-progress-fill {
  height: 100%;
  background: white;
  border-radius: 2px;
  transition: width 0.1s linear;
}

/* ============================================
   COMMENT SECTION
   ============================================ */
.comment-section {
  max-height: 300px;
  overflow-y: auto;
}

.comment-section::-webkit-scrollbar { width: 3px; }
.comment-section::-webkit-scrollbar-thumb { background: rgba(108, 92, 231, 0.2); border-radius: 2px; }

/* ============================================
   TABS
   ============================================ */
.tab-btn {
  padding: 12px 24px;
  font-weight: 600;
  font-size: 14px;
  color: #757584;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tab-btn:hover {
  color: #d4c9ff;
}

.tab-btn.active {
  color: #6C5CE7;
  border-color: #6C5CE7;
}

/* ============================================
   SEARCH
   ============================================ */
.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-result-item:hover {
  background: rgba(108, 92, 231, 0.08);
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, #6C5CE7, #a855f7, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Image container */
.post-image-container {
  position: relative;
  overflow: hidden;
  background: rgba(26, 26, 46, 0.4);
  cursor: pointer;
}

.post-image-container img {
  width: 100%;
  display: block;
  transition: opacity 0.3s ease;
}

/* Login page */
.login-bg {
  background: radial-gradient(ellipse at 20% 50%, rgba(108, 92, 231, 0.15) 0%, transparent 50%),
              radial-gradient(ellipse at 80% 50%, rgba(168, 85, 247, 0.1) 0%, transparent 50%),
              radial-gradient(ellipse at 50% 100%, rgba(236, 72, 153, 0.08) 0%, transparent 50%);
}
