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

body {
  background: #0d0e12;
  font-family: 'Inter', sans-serif;
  color: white;
  -webkit-font-smoothing: antialiased;
}

/* Preloader Screen */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0d0e12;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

#preloader.fade-out {
  opacity: 0;
  visibility: hidden;
}

.loader {
  width: 48px;
  height: 48px;
  border: 4px solid #1f222a;
  border-bottom-color: #43ef5b;
  border-radius: 50%;
  animation: rotation 1s linear infinite;
}

@keyframes rotation {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Layout Architecture */
.desktop-wrapper {
  width: 100%;
  min-height: 100vh;
}

.desktop-container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  display: block;
}

.app-container {
  width: 100%;
  background: #16181f;
  min-height: 100vh;
  position: relative;
}

/* Sidebars hidden on mobile view */
.sidebar-left, .sidebar-right {
  display: none;
}

.cover {
  height: 180px;
  background: url('https://images.unsplash.com/photo-1517841905240-472988babdf9?w=1400') center/cover;
}

/* Profile Section */
.profile-section {
  padding: 20px 24px;
  background: #16181f;
  position: relative;
}

.top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: -65px;
  margin-bottom: 15px;
}

.avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 4px solid #16181f;
  object-fit: cover;
  background: #16181f;
}

.follow-btn {
  padding: 10px 20px;
  border-radius: 30px;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: white;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

h1 {
  font-size: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.online {
  font-size: 12px;
  color: #36ff70;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.online-dot {
  width: 8px;
  height: 8px;
  background: #36ff70;
  border-radius: 50%;
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(54, 255, 112, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(54, 255, 112, 0); }
  100% { box-shadow: 0 0 0 0 rgba(54, 255, 112, 0); }
}

.bio {
  margin-top: 15px;
  line-height: 1.6;
  color: #c9cbcf;
  font-size: 15px;
}

.bio ul {
  margin-top: 12px;
  padding-left: 18px;
}

.join-btn {
  width: 100%;
  margin-top: 24px;
  padding: 16px;
  border: none;
  border-radius: 40px;
  background: #43ef5b;
  color: #000;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Tabs System */
.tabs {
  display: flex;
  background: #1e212b;
  border-top: 1px solid rgba(255,255,255,.04);
  border-bottom: 1px solid rgba(255,255,255,.04);
  position: sticky;
  top: 0;
  z-index: 10;
}

.tab {
  flex: 1;
  padding: 16px;
  background: none;
  border: none;
  color: #84878d;
  font-weight: 700;
  font-size: 15px;
  position: relative;
  cursor: pointer;
  transition: color 0.2s;
}

.tab.active {
  color: white;
}

.tab.active::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 3px;
  background: #43ef5b;
}

.content {
  display: none;
  padding: 20px 16px;
  background: #111217;
}

.content.active {
  display: block;
}

/* Post Components */
.post {
  background: #1e212b;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 24px;
  border: 1px solid rgba(255,255,255,0.03);
}

.post-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.post-header img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.post-header h3 { font-size: 15px; font-weight: 600; }
.post-header p { font-size: 12px; color: #84878d; margin-top: 2px; }

.post-text {
  padding: 0 16px 16px;
  color: #e2e4e9;
  font-size: 15px;
  line-height: 1.5;
}

/* Locked Post Architecture */
.blur-card {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5; 
  background: #090a0d;
  display: flex;
  align-items: center;
  justify-content: center;
}

.blur-card > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(24px);
  transform: scale(1.15);
  opacity: 0.55;
}

.unlock-box {
  position: absolute;
  width: 85%;
  max-width: 310px;
  background: rgba(22,24,31,0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 24px 20px;
  border-radius: 20px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.unlock-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: -48px auto 12px;
  border: 3px solid #2a2e3d;
  object-fit: cover;
  display: block;
}

.unlock-box h2 { font-size: 20px; margin-bottom: 4px; font-weight: 700; }
.unlock-box p { color: #a9acb4; font-size: 14px; margin-bottom: 16px; }
.unlock-box button {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 40px;
  background: #43ef5b;
  color: #000;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Media Grid Layout */
.media-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.media-item {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  background: #090a0d;
  cursor: pointer;
}

.media-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(18px);
  transform: scale(1.1);
  opacity: 0.6;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Bottom CTA Layout Block */
.bottom-cta-box {
  text-align: center;
  padding: 35px 20px 20px;
  background: linear-gradient(to bottom, transparent, rgba(30, 33, 43, 0.4));
  border-radius: 20px;
  margin-top: 20px;
  border: 1px dashed rgba(255, 255, 255, 0.08);
}

.bottom-cta-box p {
  font-size: 15px;
  color: #a9acb4;
  margin-bottom: 16px;
  font-weight: 500;
}

.bottom-cta-btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 40px;
  background: #43ef5b;
  color: #000;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(67, 239, 91, 0.15);
  transition: all 0.2s ease;
}

/* Popup Overlay Module */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.popup-overlay.active {
  opacity: 1;
  visibility: visible;
}

.popup-box {
  background: #16181f;
  width: 90%;
  max-width: 380px;
  padding: 32px 24px;
  border-radius: 24px;
  text-align: center;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.popup-overlay.active .popup-box {
  transform: scale(1);
}

.close-btn {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: #6c7078;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s;
}

.close-btn:hover { color: #fff; }

.popup-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 16px;
  border: 3px solid #2a2e3d;
  object-fit: cover;
  display: block;
}

.popup-box h2 { font-size: 22px; margin-bottom: 8px; font-weight: 700; }
.popup-box p { color: #a9acb4; font-size: 15px; margin-bottom: 24px; line-height: 1.5; }

.popup-action-btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 40px;
  background: #43ef5b;
  color: #000;
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(67, 239, 91, 0.15);
  transition: all 0.2s ease;
}

/* ==========================================================================
   DESKTOP RESPONSIVE ENGINE (3-COLUMN LAYOUT)
   ========================================================================== */

@media (max-width: 767px) {
  .app-container {
    max-width: 480px;
    margin: 0 auto;
  }
}

@media (min-width: 1024px) {
  body {
    background: #090a0d;
  }

  .desktop-container {
    display: grid;
    grid-template-columns: 260px 660px 320px;
    justify-content: center;
    gap: 30px;
    padding: 30px 20px;
    max-width: 1320px;
  }

  .sidebar-left, .sidebar-right {
    display: block;
  }

  /* 1. Left Sidebar Elements */
  .sidebar-left {
    position: sticky;
    top: 30px;
    height: fit-content;
  }

  .brand-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px 25px;
  }

  .brand-logo {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #43ef5b, #13a325);
    border-radius: 10px;
    position: relative;
  }

  .brand-logo::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
    top: 11px;
    left: 11px;
  }

  .brand-text {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #ffffff, #a9acb4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  .sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    color: #a9acb4;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    border-radius: 14px;
    transition: all 0.2s ease;
  }

  .nav-item i {
    font-style: normal;
    font-size: 18px;
  }

  .nav-item.active, .nav-item:hover {
    background: #16181f;
    color: white;
  }

  /* 2. Center Panel Enhancements */
  .app-container {
    min-height: auto;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 30px 70px rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.04);
  }

  .cover { height: 220px; }
  .profile-section { padding: 24px 32px; }
  .top-row { margin-top: -85px; }
  .avatar { width: 110px; height: 110px; border-width: 5px; }
  .content { padding: 30px 24px; }
  
  .media-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }

  /* 3. Right Sidebar Elements */
  .sidebar-right {
    position: sticky;
    top: 30px;
    height: fit-content;
  }

  .sticky-promo-card {
    background: #16181f;
    border-radius: 24px;
    padding: 24px;
    border: 1px solid rgba(255,255,255,0.04);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  }

  .sticky-promo-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
  }

  .sticky-promo-card p {
    font-size: 14px;
    color: #a9acb4;
    line-height: 1.6;
    margin-bottom: 20px;
  }

  .promo-price {
    font-size: 24px;
    font-weight: 800;
    color: #43ef5b;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
  }

  .right-promo-btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 40px;
    background: linear-gradient(135deg, #43ef5b, #2bcb42);
    color: #000;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(67, 239, 91, 0.15);
    transition: all 0.2s ease;
  }

  /* Interactive States */
  .follow-btn:hover { background: rgba(255,255,255,0.15); }
  .join-btn:hover, .post-action-btn:hover, .bottom-cta-btn:hover, .popup-action-btn:hover, .right-promo-btn:hover {
    background: #39e050;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(67, 239, 91, 0.3);
  }
  .tab:hover { color: #fff; }
  .media-item:hover img { transform: scale(1.08); opacity: 0.8; }
}