:root {
  --bg-color: #000; /* Pure black */
  --text-color: #fff;
  --border-color: rgba(255, 255, 255, 0.15);
  --header-bg: rgba(0, 0, 0, 0.9); /* Pure black with transparency */
  --nav-bg: rgba(0, 0, 0, 0.9); /* Pure black with transparency */
  --tab-inactive: #e0e0e0;
  --icon-color: #e0e0e0;
  --hover-bg: rgba(255, 255, 255, 0.15);
  --logo-filter: none;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-family);
  font-weight: 400;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg-color: #fff;
    --text-color: #000;
    --border-color: rgba(0, 0, 0, 0.15);
    --header-bg: rgba(255, 255, 255, 0.9);
    --nav-bg: rgba(255, 255, 255, 0.9);
    --tab-inactive: #333;
    --icon-color: #333;
    --hover-bg: rgba(0, 0, 0, 0.08);
    --logo-filter: none;
  }
}

body {
  background-color: var(--bg-color); /* Will be #000 in dark mode */
  color: var(--text-color);
  max-width: 600px;
  margin: 0 auto;
  padding-bottom: 70px;
  font-size: 14px;
  line-height: 1.4;
  font-family: var(--font-family);
  font-weight: 400;
}

@media (min-width: 601px) {
  body {
    border-left: none;
    border-right: none;
    box-shadow: none;
  }
}

h1, h2, h3, h4, h5, h6, p, span, div, a {
  font-family: var(--font-family);
  font-weight: 400;
}

header {
  position: sticky;
  top: 0;
  background-color: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
  padding: 0 16px;
  box-shadow: none;
}

.header-container {
  display: flex;
  flex-direction: column;
  height: auto;
  padding: 4px 0;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 44px;
}

.app-logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.header-icons {
  margin-left: auto;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 6px 0 10px 0;
  max-width: 600px;
  margin: 0 auto;
  z-index: 1000;
  height: 45px;
  box-shadow: none;
  border-top: 1px solid var(--border-color);
}

@media (prefers-color-scheme: light) {
  .bottom-nav {
    background-color: var(--nav-bg);
    box-shadow: none;
  }
}

.header-icons {
  display: flex;
  align-items: center;
  gap: 15px;
}

.menu-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  fill: currentColor;
  transition: color 0.2s ease;
}

.menu-icon:hover {
  color: var(--text-color);
}

.menu-icon svg {
  width: 24px;
  height: 24px;
}

.profile-icon {
  width: 28px !important;
  height: 28px !important;
  border-radius: 50%;
  background-color: #1d9bf0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: white;
  cursor: pointer;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

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

.profile-icon:hover {
  background-color: #0055AA;
}

.search-icon {
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

.spinner-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  background-color: var(--bg-color);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #1d9bf0;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #fff;
  text-decoration: none;
  font-size: 10px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.2s ease;
  background-color: transparent;
  width: 44px;
  height: 44px;
  justify-content: center;
  position: relative;
}

.nav-item:hover {
  background-color: transparent;
}

.nav-item.active {
  background-color: transparent !important;
  color: #fff !important;
  box-shadow: none;
}

.nav-item.active .nav-icon {
  color: #fff !important;
  fill: #fff !important;
}

@media (prefers-color-scheme: light) {
  .nav-item.active .nav-icon {
    color: #000 !important;
    fill: #000 !important;
  }
  
  .nav-item {
    color: #000;
  }
  
  .nav-item.active {
    color: #000 !important;
  }
  
  .menu-icon {
    color: #000;
  }
  
  .search-icon {
    color: #000;
  }
}

.nav-icon {
  font-size: 20px;
  color: inherit;
}

.hidden {
  display: none !important;
}

.app-title h1 {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

@media (prefers-color-scheme: light) {
    .app-title h1 {
        color: #000;
    }
}

.jetin-logo {
  display: none;
}

.create-post-center-btn {
    background-color: transparent !important;
    color: var(--text-color) !important;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none !important;
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid var(--border-color);
}

.create-post-center-btn .nav-icon {
    color: var(--text-color) !important;
    font-size: 20px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#create-post-nav-item.active .create-post-center-btn {
    background-color: var(--hover-bg) !important;
    box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.3) !important;
}

.create-post-center-btn:hover {
    background-color: var(--hover-bg) !important;
    transform: scale(1.05);
    box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.3) !important;
}

@media (prefers-color-scheme: light) {
    .create-post-center-btn {
        background-color: transparent !important;
        border-color: var(--border-color);
    }
    
    #create-post-nav-item.active .create-post-center-btn {
        background-color: var(--hover-bg) !important;
        box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.5) !important;
    }
    
    .create-post-center-btn:hover {
        background-color: var(--hover-bg) !important;
        box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.5) !important;
    }
    
    .create-post-center-btn .nav-icon {
        color: var(--text-color) !important;
    }
}

.bottom-nav {
    padding: 6px 0 10px 0;
}

.create-post-btn {
    display: none !important;
}

.media-container {
    width: calc(100% - 50px);
    margin-left: 50px;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
    background-color: #1a1a1a;
    display: flex;
    justify-content: center;
    align-items: center;
}

@media (prefers-color-scheme: light) {
    .media-container {
        background-color: #f0f2f5;
    }
}

.nav-icon {
  fill: currentColor;
  color: #fff;
  transition: fill 0.2s ease, color 0.2s ease;
}

.nav-item.active .nav-icon {
  fill: currentColor;
  color: currentColor;
}

@media (prefers-color-scheme: light) {
  .nav-item.active .nav-icon {
    fill: #000;
    color: #000;
  }
  
  .nav-icon {
    color: #000;
    fill: #000;
  }
}

.app-title h1 {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

@media (prefers-color-scheme: light) {
    .app-title h1 {
        color: #000;
    }
}

.suggestion-card {
    cursor: pointer;
}

.content-tabs-container {
  display: flex;
  background-color: #2d2d2d;
  border-radius: 20px;
  margin: 8px 0;
  padding: 3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  height: 36px;
  width: 100%;
}

.content-tab {
  flex: 1;
  text-align: center;
  padding: 6px 0;
  font-weight: 700;
  color: var(--tab-inactive);
  position: relative;
  font-size: 14px;
  cursor: pointer;
  border-radius: 16px;
  transition: all 0.2s ease;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
}

.content-tab.active {
  color: var(--tab-inactive);
  background-color: transparent;
  box-shadow: none;
}

.content-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 3px;
  background-color: #1877F2;
  border-radius: 2px;
}

@media (prefers-color-scheme: light) {
    .content-tabs-container {
        background-color: #f0f2f5;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    }
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #fff;
    text-decoration: none;
    font-size: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    background-color: transparent;
    width: 44px;
    height: 44px;
    justify-content: center;
}

.nav-item:hover {
    background-color: transparent;
}

.nav-item.active {
    background-color: transparent;
    color: #fff;
    box-shadow: none;
}

@media (prefers-color-scheme: light) {
    .nav-item .nav-icon {
        color: #000;
        fill: #000;
    }
    
    .nav-item.active .nav-icon {
        color: #000;
        fill: #000;
    }
    
    .nav-item {
        color: #000;
    }
    
    .nav-item.active {
        color: #000;
    }
}

.create-post-center-btn {
    background-color: transparent !important;
    color: var(--text-color) !important;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none !important;
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid var(--border-color);
}

.create-post-center-btn .nav-icon {
    color: var(--text-color) !important;
    font-size: 20px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#create-post-nav-item.active .create-post-center-btn {
    background-color: var(--hover-bg) !important;
    box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.3) !important;
}

.create-post-center-btn:hover {
    background-color: var(--hover-bg) !important;
    transform: scale(1.05);
    box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.3) !important;
}

@media (prefers-color-scheme: light) {
    .create-post-center-btn {
        background-color: transparent !important;
        border-color: var(--border-color);
    }
    
    #create-post-nav-item.active .create-post-center-btn {
        background-color: var(--hover-bg) !important;
        box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.5) !important;
    }
    
    .create-post-center-btn:hover {
        background-color: var(--hover-bg) !important;
        box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.5) !important;
    }
    
    .create-post-center-btn .nav-icon {
        color: var(--text-color) !important;
    }
}

@media (prefers-color-scheme: light) {
  .nav-item .nav-icon {
    color: #000;
    fill: #000;
  }
}

.header-icons {
    display: flex;
    align-items: center;
    gap: 15px;
}

.reels-icon, .menu-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    fill: currentColor;
    transition: color 0.2s ease;
}

.reels-icon:hover, .menu-icon:hover {
    color: var(--text-color);
}

.reels-icon svg, .menu-icon svg {
    width: 24px;
    height: 24px;
}

.profile-icon {
    width: 28px !important;
    height: 28px !important;
    border-radius: 50%;
    background-color: #1d9bf0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    cursor: pointer;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

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

.profile-icon:hover {
    background-color: #0055AA;
}

.header-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    fill: currentColor;
    transition: color 0.2s ease;
    border-radius: 50%;
    padding: 4px;
}

.header-icon:hover {
    background-color: var(--hover-bg);
}

.header-icon .nav-icon {
    width: 20px;
    height: 20px;
}

#groups-nav-item .nav-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
    color: #fff;
}

@media (prefers-color-scheme: light) {
    #groups-nav-item .nav-icon {
        color: #000;
        fill: #000;
    }
    
    .header-icon {
        color: #000;
        fill: #000;
    }
    
    .reels-icon, .menu-icon {
        color: #000;
        fill: #000;
    }
}

.menu-icon .nav-icon {
  width: 24px;
  height: 24px;
  fill: #fff;
  color: #fff;
  transition: fill 0.2s ease, color 0.2s ease;
}

@media (prefers-color-scheme: light) {
  .menu-icon .nav-icon {
    fill: #000;
    color: #000;
  }
}

.menu-icon:hover .nav-icon {
  fill: #fff;
  color: #fff;
}

@media (prefers-color-scheme: light) {
  .menu-icon:hover .nav-icon {
    fill: #000;
    color: #000;
  }
}

.menu-icon.active .nav-icon {
  fill: #fff;
  color: #fff;
}

@media (prefers-color-scheme: light) {
  .menu-icon.active .nav-icon {
    fill: #000;
    color: #000;
  }
}

#groups-nav-item,
#videos-nav-item {
  background-color: #2d2d2d !important;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: -8px 0;
}

#groups-nav-item .nav-icon,
#videos-nav-item .nav-icon {
  color: #fff !important;
  fill: #fff !important;
}

@media (prefers-color-scheme: light) {
  #groups-nav-item,
  #videos-nav-item {
    background-color: #f0f2f5 !important;
  }
  
  #groups-nav-item .nav-icon,
  #videos-nav-item .nav-icon {
    color: #000 !important;
    fill: #000 !important;
  }
}

.bottom-nav {
  z-index: 999;
}

.stories-section {
  z-index: 998;
}

#profile-nav-item .profile-icon {
  width: 28px !important;
  height: 28px !important;
  background-color: #1d9bf0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

#profile-nav-item .profile-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.app-logo {
  display: flex;
  align-items: center;
}

.logo-image {
  height: 60px;
  width: auto;
  filter: var(--logo-filter);
  transition: filter 0.3s ease;
}

.logo-image {
  filter: brightness(0) saturate(100%) invert(27%) sepia(89%) saturate(2596%) hue-rotate(198deg) brightness(95%) contrast(101%);
}

@media (prefers-color-scheme: light) {
  .logo-image {
    filter: brightness(0) saturate(100%) invert(27%) sepia(89%) saturate(2596%) hue-rotate(198deg) brightness(95%) contrast(101%);
  }
}

.app-title {
  display: none;
}

.bottom-nav .nav-icon {
  width: 24px;
  height: 24px;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-color);
  text-decoration: none;
  font-size: 10px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.2s ease;
  background-color: transparent;
  width: 44px;
  height: 44px;
  justify-content: center;
}

.create-post-center-btn {
  width: 44px;
  height: 44px;
}

#create-post-nav-item.active .create-post-center-btn {
  background-color: var(--hover-bg) !important;
  box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.3) !important;
}

.post-text {
  font-size: 15px;
  line-height: 1.5;
  font-weight: 400;
}

.username {
  font-weight: 600;
  font-size: 14px;
}

.timestamp {
  font-size: 12px;
  color: #a8a8a8;
  font-weight: 400;
}

@media (prefers-color-scheme: light) {
  .timestamp {
    color: #737373;
  }
}

.post-image {
    width: auto;
    margin-left: 54px;
    margin-right: 0;
    border-radius: 16px;
    margin-bottom: 10px;
    overflow: hidden;
    background-color: #1a1a1a;
    display: flex;
    justify-content: center;
    align-items: center;
    max-height: 600px;
    height: auto;
    margin-top: 8px;
}

.post-image img {
    width: 100%;
    max-width: 600px;
    height: auto;
    max-height: 600px;
    object-fit: contain;
    cursor: pointer;
    border-radius: 16px;
}

.media-grid {
    width: auto;
    margin-left: 54px;
    margin-right: 0;
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    border-radius: 16px;
    margin-bottom: 10px;
    gap: 2px;
    margin-top: 8px;
    position: relative;
    max-height: 600px;
    height: 400px;
}

.grid-media-container {
    flex: 0 0 auto;
    width: 100%;
    scroll-snap-align: start;
    position: relative;
    background-color: #1a1a1a;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border-radius: 16px;
    height: 100%;
}

.grid-media {
    width: 100%;
    height: 100%;
    max-height: 600px;
    object-fit: cover;
    border-radius: 16px;
}

@media (prefers-color-scheme: light) {
    .post-image,
    .grid-media-container {
        background-color: #f0f2f5;
    }
}

@media (min-width: 601px) {
    .post-image img {
        max-width: 600px;
    }
    
    .media-grid {
        max-width: 600px;
    }
}

@media (max-width: 600px) {
    .post-image img {
        max-width: 100%;
    }
    
    .media-grid {
        max-width: 100%;
    }
}

/* ===== ICON STATE MANAGEMENT ===== */
/* Default: outline icons visible, fill icons hidden */
.nav-item .home-outline,
.nav-item .notifications-outline {
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.nav-item .home-fill,
.nav-item .notifications-fill {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Active state: hide outline, show fill */
.nav-item.active .home-outline {
  display: none;
}

.nav-item.active .home-fill {
  display: block;
}

.nav-item.active .notifications-outline {
  display: none;
}

.nav-item.active .notifications-fill {
  display: block;
}

/* Search and create post always show */
#search-nav-item .nav-icon,
#create-post-nav-item .nav-icon {
  display: block !important;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Profile icon active state */
.nav-item.active #profile-icon {
  box-shadow: 0 0 0 2px #1877F2;
}

/* Create post button specific */
.create-post-center-btn .nav-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: block !important;
    color: var(--text-color) !important;
    fill: var(--text-color) !important;
}

/* Hide the old FontAwesome icon */
.create-post-center-btn i.nav-icon {
    display: none;
}

/* Light mode adjustments */
@media (prefers-color-scheme: light) {
  .nav-item .home-outline,
  .nav-item .notifications-outline,
  .nav-item .home-fill,
  .nav-item .notifications-fill,
  #search-nav-item .nav-icon,
  #create-post-nav-item .nav-icon {
    color: #000;
    fill: #000;
  }
  
  .nav-item.active .home-fill,
  .nav-item.active .notifications-fill {
    color: #000 !important;
    fill: #000 !important;
  }
}

body {
  background-color: #000 !important;
}
@media (prefers-color-scheme: light) {
  body {
    background-color: #fff !important;
  }
}
