:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f4f4f5; /* Zinc-100 */
  --bg-card: #ffffff;
  --border-color: #e4e4e7; /* Zinc-200 */
  --text-primary: #09090b; /* Zinc-950 */
  --text-secondary: #71717a; /* Zinc-500 */
  --accent-blue: #0284c7;
  --accent-cyan: #0891b2;
  --accent-pink: #db2777;
  --font-family: 'Outfit', sans-serif;
  --header-height: 54px;
  --nav-height: 60px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  display: flex;
  justify-content: center;
  align-items: center;
}

.social-app {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
  padding-top: 80px;
}

/* Header */
.app-header {
  height: var(--header-height);
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  flex-shrink: 0;
}

.app-header h2 {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.wallet-badge {
  font-size: 11px;
  background: rgba(8, 145, 178, 0.15);
  color: var(--accent-cyan);
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 700;
}

/* Viewport and views */
.app-viewport {
  flex-grow: 1;
  position: relative;
  overflow: hidden;
  margin-bottom: var(--nav-height);
}

.social-view {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: #ffffff;
}

.social-view.active {
  opacity: 1;
  pointer-events: auto;
}

/* Story line formatting */
.stories-row {
  display: flex;
  gap: 12px;
  padding: 16px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border-color);
  background: #fafafa;
  flex-shrink: 0;
}

.stories-row::-webkit-scrollbar {
  display: none;
}

.story-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.story-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border: 2.5px solid #ffffff;
  outline: 2px solid #e4e4e7;
}

.border-glow {
  outline-color: var(--accent-blue);
}

.story-item span {
  font-size: 10px;
  color: var(--text-secondary);
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Posts layouts */
.feed-posts-list {
  display: flex;
  flex-direction: column;
  padding: 12px 16px 30px 16px;
  gap: 16px;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

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

.post-avatar-mini {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.post-username {
  font-size: 13px;
  font-weight: 700;
}

.post-image-area {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #e4e4e7, #f4f4f5);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.post-image-area img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-art-placeholder {
  font-size: 48px;
}

.post-caption-box {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.post-caption-box p {
  font-size: 13px;
  line-height: 1.45;
}

.post-tags {
  color: var(--accent-cyan);
  font-weight: 600;
}

.post-actions-row {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding: 10px 16px;
  font-size: 13px;
}

.post-act-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.post-act-btn:hover {
  color: var(--text-primary);
}

.tip-badge {
  background: rgba(8, 145, 178, 0.08);
  border: 1px solid rgba(8, 145, 178, 0.2);
  color: var(--accent-cyan);
  border-radius: 8px;
  padding: 2px 8px;
}

/* Explore Grid */
.search-bar-row {
  padding: 16px;
  flex-shrink: 0;
}

.search-bar-row input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 16px;
  color: var(--text-primary);
  font-family: var(--font-family);
  outline: none;
  font-size: 14px;
}

.trending-tags-scroller {
  display: flex;
  gap: 8px;
  padding: 0 16px 14px 16px;
  overflow-x: auto;
  flex-shrink: 0;
}

.trend-tag {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.explore-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 0 16px 20px 16px;
}

.explore-tile {
  aspect-ratio: 1 / 1;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
}

/* Create Studio */
.creator-container {
  margin: auto;
  width: 85%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 0;
}

.uploader-box {
  background: var(--bg-secondary);
  border: 2px dashed var(--border-color);
  border-radius: 20px;
  height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
}

.uploader-art {
  font-size: 40px;
}

.post-preview-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.preview-img-container {
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  overflow: hidden;
  background: #f4f4f5;
  border: 1px solid var(--border-color);
}

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

.filter-options-scroller {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.img-filter-btn {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.img-filter-btn.active {
  background: var(--text-primary);
  color: #fff;
  border-color: var(--text-primary);
}

.input-group textarea {
  width: 100%;
  height: 80px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font-family);
  outline: none;
  font-size: 13px;
  resize: none;
}

/* Activity notifications list */
.activity-header {
  padding: 20px 16px 10px 16px;
  flex-shrink: 0;
}

.activity-list {
  display: flex;
  flex-direction: column;
  padding: 0 16px 20px 16px;
  gap: 10px;
}

.activity-item {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.act-avatar {
  font-size: 20px;
}

.act-text {
  font-size: 13px;
  line-height: 1.4;
}

.act-time {
  margin-left: auto;
  font-size: 10px;
  color: var(--text-secondary);
}

/* Profile screen details */
.profile-header-card {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex-shrink: 0;
}

.profile-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.profile-avatar-box {
  position: relative;
}

.profile-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  border: 2px solid var(--border-color);
}

.stats-row {
  display: flex;
  gap: 20px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-item strong {
  font-size: 16px;
}

.stat-item span {
  font-size: 11px;
  color: var(--text-secondary);
}

.profile-bio-details h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

.profile-bio-details p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 12px;
}

.edit-profile-btn {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px;
  border-radius: 8px;
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.profile-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 10px 16px 30px 16px;
}

.profile-tile {
  aspect-ratio: 1 / 1;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

/* Bottom navigation navbar */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  display: flex;
  z-index: 100;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.02);
}

.nav-tab {
  flex-grow: 1;
  background: none;
  border: none;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
}

.nav-tab.active {
  color: var(--accent-blue);
}

.nav-icon {
  font-size: 18px;
}

.nav-label {
  font-size: 9px;
  font-weight: 600;
}

/* Modal specific elements */
.emoji-selector-row {
  display: flex;
  justify-content: space-around;
  font-size: 24px;
  padding: 10px 0;
}

.emoji-opt {
  cursor: pointer;
  transition: transform 0.1s;
}

.emoji-opt.selected-emoji {
  transform: scale(1.3);
  filter: drop-shadow(0 2px 5px rgba(2,132,199,0.3));
}

.comments-body {
  height: 250px;
}

.comment-card {
  border-bottom: 1px dashed var(--border-color);
  padding: 8px 4px;
  font-size: 13px;
}

.comment-user {
  color: var(--accent-blue);
  margin-right: 6px;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(9, 9, 11, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  width: 100%;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  padding: 20px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.1, 0.76, 0.55, 0.94);
  box-shadow: 0 -4px 15px rgba(0,0,0,0.05);
}

.modal.active .modal-content {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.close-btn {
  background: var(--bg-secondary);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
}

.action-btn-small {
  background: var(--accent-blue);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-family: var(--font-family);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.action-btn {
  width: 100%;
  background: var(--accent-blue);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.text-watermark-row {
  display: flex;
  gap: 8px;
}

.text-watermark-row input {
  flex-grow: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 13px;
  outline: none;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}

.input-group input {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 13px;
  outline: none;
}
