:root {
  --bg: #0b0b0b;
  --card: #151515;
  --text: #ffffff;
  --muted: #a1a1a1;
  --accent: #ffb703;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', sans-serif;
}

/* ================= PROFILE ================= */

.profile {
  display: flex;
  gap: 30px;
  padding: 60px 40px;
  align-items: center;
}

.avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
}

.muted { color: var(--muted); }

.actions { margin-top: 14px; }

.btn {
  background: var(--accent);
  padding: 10px 18px;
  border-radius: 8px;
  color: #000;
  text-decoration: none;
  font-weight: 600;
  margin-right: 10px;
}

.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid #333;
}

/* ================= TABS ================= */

.tabs {
  display: flex;
  justify-content: center;
  gap: 30px;
  border-top: 1px solid #222;
  border-bottom: 1px solid #222;
}

.tab {
  background: none;
  border: none;
  color: var(--muted);
  padding: 16px;
  cursor: pointer;
  font-weight: 600;
}

.tab.active {
  color: var(--text);
  border-bottom: 2px solid var(--accent);
}

/* ================= FEED (General Grid) ================= */

.feed {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px,1fr));
  gap: 18px;
  padding: 30px 40px;
}

.post {
  background: var(--card);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  opacity: 0;
}

/* ================= GRAPHIC DESIGN (Square) ================= */

.square {
  aspect-ratio: 1 / 1;
}

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

/* ================= FULL VIDEO (Horizontal) ================= */

.horizontal {
  aspect-ratio: 16 / 9;
  grid-column: span 2;
}

.horizontal video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ================= TAB VISIBILITY & ANIMATIONS ================= */

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

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

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

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes rotateScaleIn {
  from {
    opacity: 0;
    transform: scale(0.9) rotateY(-10deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotateY(0deg);
  }
}

@keyframes expandIn {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.tab-content {
  display: none;
  opacity: 0;
}

.tab-content.active {
  display: grid;
  animation: slideInUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.tab-content.fade-out {
  animation: slideOutDown 0.3s ease-in-out forwards;
}

/* ================= OVERLAY (For Images) ================= */

.ig-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.ig-container {
  display: flex;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  width: min(92%, 900px);
  max-height: 90vh;
}

.ig-media {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ig-media img,
.ig-media video {
  max-width: 100%;
  max-height: 90vh;
}

.ig-info {
  width: 280px;
  padding: 20px;
  background: #111;
}

.ig-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 28px;
  cursor: pointer;
  color: white;
}

/* ================= MOBILE ================= */

@media (max-width: 768px) {
  .ig-container {
    flex-direction: column;
  }

  .ig-info {
    width: 100%;
  }
}

/* ================= REELS FOLDER SYSTEM (NEW) ================= */

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

.folder-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 30px; /* Spacing between folders */
  justify-content: center;
  margin-bottom: 50px;
  grid-column: 1 / -1; /* Ensures it spans full width */
  width: 100%;
}

/* FOLDER ICONS */
.folder {
  width: 140px; /* Folder width */
  aspect-ratio: 9 / 16;
  background: #222;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 2px solid transparent;
  animation: travelFloat 3s ease-in-out infinite;
}

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

.folder .folder-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
  padding: 12px 5px;
  text-align: center;
}

.folder span {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.folder:nth-child(1) { animation-delay: 0s; }
.folder:nth-child(2) { animation-delay: 0.1s; }
.folder:nth-child(3) { animation-delay: 0.2s; }
.folder:nth-child(4) { animation-delay: 0.3s; }
.folder:nth-child(5) { animation-delay: 0.4s; }
.folder:nth-child(6) { animation-delay: 0.5s; }
.folder:nth-child(7) { animation-delay: 0.6s; }

.folder:hover {
  transform: translateY(-12px) scale(1.05);
  box-shadow: 0 12px 24px rgba(0,0,0,0.5);
  animation: none;
}

.folder.active {
  border-color: #ffb703; /* Active accent color */
  transform: scale(1.05);
}

/* VIDEO GRID (BIGGER VIDEOS) */
.video-grid {
  display: grid;
  /* Min size 280px makes videos larger */
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
  gap: 25px;
  width: 100%;
  padding-bottom: 60px;
  grid-column: 1 / -1;
}

.reel-item {
  aspect-ratio: 9 / 16;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.reel-item:hover {
  transform: scale(1.02);
  z-index: 10;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.reel-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* TEXT LABEL ON REELS */
.reel-item p {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 10px 15px;
  font-size: 15px;
  color: #fff;
  font-weight: 700;
  text-align: center;
  background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
  
  /* CRITICAL: Allows mouse hover to reach the video element */
  pointer-events: none; 
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

/* Responsive: Mobile Adjustments */
@media (max-width: 600px) {
  .folder { width: 100px; }
  
  .video-grid { 
    /* 2 Columns on mobile looks best */
    grid-template-columns: repeat(2, 1fr); 
    gap: 15px;
  }
}