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

body {
  background: #0a0a0a;
  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: #111;
  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 #2d2d2d;
  border-bottom-color: #43ef5b;
  border-radius: 50%;
  animation: rotation 1s linear infinite;
}

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

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

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

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

/* Profile Section */
.profile-section {
  padding: 20px 24px;
  background: #1e1e1e;
  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 #1e1e1e;
  object-fit: cover;
  background: #1e1e1e;
}

.follow-btn {
  padding: 10px 20px;
  border-radius: 30px;
  border: 1px solid rgba(255,255,255,.3);
  background: rgba(0,0,0,0.5);
  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: #dbdbdb;
  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 & Content Feed */
.tabs {
  display: flex;
  background: #242424;
  border-top: 1px solid rgba(255,255,255,.05);
  border-bottom: 1px solid rgba(255,255,255,.05);
  position: sticky;
  top: 0;
  z-index: 10;
}

.tab {
  flex: 1;
  padding: 16px;
  background: none;
  border: none;
  color: #888;
  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: #191919;
}

.content.active {
  display: block;
}

/* Post Element Structure */
.post {
  background: #242424;
  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: #888; margin-top: 2px; }

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

/* Locker Cards (Posts) */
.blur-card {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5; 
  background: #111;
  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.6;
}

.unlock-box {
  position: absolute;
  width: 85%;
  max-width: 310px;
  background: rgba(30,30,30,0.75);
  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.08);
  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 #333;
  object-fit: cover;
  display: block;
}

.unlock-box h2 { font-size: 20px; margin-bottom: 4px; font-weight: 700; }
.unlock-box p { color: #bbb; 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: #111;
  cursor: pointer;
}

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

/* Bottom CTA Callout Component */
.bottom-cta-box {
  text-align: center;
  padding: 35px 20px 20px;
  background: linear-gradient(to bottom, transparent, rgba(36, 36, 36, 0.6));
  border-radius: 20px;
  margin-top: 20px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
}

.bottom-cta-box p {
  font-size: 15px;
  color: #b3b3b3;
  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 & Box */
.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: #1e1e1e;
  width: 90%;
  max-width: 380px;
  padding: 32px 24px;
  border-radius: 24px;
  text-align: center;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  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: #888;
  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 #333;
  object-fit: cover;
  display: block;
}

.popup-box h2 {
  font-size: 22px;
  margin-bottom: 8px;
  font-weight: 700;
}

.popup-box p {
  color: #bbb;
  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;
}

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

@media (min-width: 768px) {
  .desktop-bg-wrapper {
    padding: 40px 0;
  }
  .app-container {
    max-width: 680px;
    margin: 0 auto;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.06);
  }
  .cover { height: 240px; }
  .profile-section { padding: 24px 32px; }
  .top-row { margin-top: -85px; }
  .avatar {
    width: 120px;
    height: 120px;
    border-width: 5px;
  }
  .content { padding: 30px; }
  .media-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
  
  /* Desktop Hover Effects */
  .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 {
    background: #39e050;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(67, 239, 91, 0.25);
  }
  .tab:hover { color: #fff; }
  .media-item:hover img { transform: scale(1.15); }
}