/* ============================================
   Gallery Page Styles - Multi-Theme & Social Feed
   Themes: Instagram Post, TikTok Grid, Masonry
   ============================================ */

.gallery-page {
  min-height: 100vh;
  padding-bottom: 90px;
}

/* ============================================
   Header
   ============================================ */
.gallery-header {
  position: sticky;
  top: 0;
  background: rgba(26, 26, 46, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: var(--z-sticky);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: var(--space-md);
}

.gallery-header__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.gallery-header__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-gold);
}

/* Theme Switcher Segmented Control */
.theme-selector-bar {
  display: flex;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50px;
  padding: 3px;
  margin-bottom: var(--space-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.theme-tab {
  flex: 1;
  text-align: center;
  padding: 7px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 50px;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.theme-tab:hover {
  color: white;
}

.theme-tab.active {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: white;
  box-shadow: 0 2px 10px rgba(183, 110, 121, 0.4);
}

/* Search Bar */
.gallery-search {
  position: relative;
  width: 100%;
}

.gallery-search input {
  width: 100%;
  padding: 10px 16px 10px 38px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  color: var(--color-text);
  font-size: 0.85rem;
  outline: none;
  transition: all var(--transition-normal);
}

.gallery-search input:focus {
  background: rgba(183, 110, 121, 0.1);
  border-color: var(--color-primary);
}

.gallery-search__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.gallery-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md) 0;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* ============================================
   THEME 1: INSTAGRAM FEED MODE
   ============================================ */
.feed-instagram {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  max-width: 480px;
  margin: 0 auto;
  padding: var(--space-md);
}

.ig-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-md);
  animation: fadeInUp 0.4s ease;
}

/* Instagram Card Header */
.ig-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}

.ig-author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ig-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-gold), var(--color-primary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: #1A1A2E;
  padding: 2px;
}

.ig-author-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--color-text);
}

.ig-time {
  font-size: 0.72rem;
  color: var(--color-text-muted);
}

/* Instagram Image Box */
.ig-media {
  position: relative;
  width: 100%;
  aspect-ratio: 3/4;
  background: #000;
  overflow: hidden;
  cursor: pointer;
}

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

/* Double-tap Heart Animation */
.heart-pop {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-size: 5rem;
  color: #ff3366;
  text-shadow: 0 0 20px rgba(255, 51, 102, 0.8);
  pointer-events: none;
  z-index: 10;
}

.heart-pop.animate {
  animation: popScale 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popScale {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  50% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* Instagram Actions Bar */
.ig-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 4px;
}

.ig-actions-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ig-action-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: transform var(--transition-fast);
}

.ig-action-btn:hover {
  transform: scale(1.15);
}

.ig-action-btn.liked {
  color: #ff3366;
}

.ig-action-btn .btn-count {
  font-size: 0.85rem;
  font-weight: 600;
}

/* Instagram Details */
.ig-body {
  padding: 6px 16px 14px;
}

.ig-likes-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-gold);
  margin-bottom: 6px;
}

.ig-caption {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.ig-caption strong {
  color: white;
  margin-right: 6px;
}

.ig-view-comments {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  cursor: pointer;
  margin-bottom: 8px;
  display: block;
}

/* Quick Comment Input */
.ig-comment-form {
  display: flex;
  gap: 8px;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 10px;
}

.ig-comment-form input {
  flex: 1;
  background: transparent;
  border: none;
  color: white;
  font-size: 0.85rem;
  outline: none;
}

.ig-comment-form input::placeholder {
  color: var(--color-text-muted);
}

.ig-comment-form button {
  background: transparent;
  border: none;
  color: var(--color-primary-light);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

.ig-comment-form button:hover {
  color: var(--color-gold);
}

/* ============================================
   THEME 2: TIKTOK GRID MODE
   ============================================ */
.feed-tiktok {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  padding: var(--space-md);
}

@media (min-width: 600px) {
  .feed-tiktok { grid-template-columns: repeat(3, 1fr); }
}

.tiktok-card {
  position: relative;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 9/16;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

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

/* TikTok Side Floating Controls */
.tiktok-actions {
  position: absolute;
  right: 8px;
  bottom: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  z-index: 5;
}

.tiktok-action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: white;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.4);
  padding: 6px;
  border-radius: 50%;
  backdrop-filter: blur(5px);
}

.tiktok-action-item span:first-child {
  font-size: 1.3rem;
}

.tiktok-action-item span:last-child {
  font-size: 0.65rem;
  font-weight: 600;
}

.tiktok-action-item.liked span:first-child {
  color: #ff3366;
}

.tiktok-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, transparent 100%);
  z-index: 4;
}

.tiktok-user {
  font-weight: 700;
  font-size: 0.85rem;
  color: white;
  margin-bottom: 3px;
}

.tiktok-caption {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================
   THEME 3: FACEBOOK FEED MODE
   ============================================ */
.feed-facebook {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  max-width: 500px;
  margin: 0 auto;
  padding: var(--space-md);
}

.fb-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  animation: fadeInUp 0.4s ease;
}

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

.fb-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #1877F2;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
}

.fb-author-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-text);
}

.fb-time {
  font-size: 0.72rem;
  color: var(--color-text-muted);
}

.fb-message {
  padding: 4px 16px 10px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--color-text);
}

.fb-media {
  width: 100%;
  aspect-ratio: 3/4;
  background: #000;
  cursor: pointer;
}

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

.fb-reactions-bar {
  display: flex;
  justify-content: space-between;
  padding: 10px 16px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.fb-actions-bar {
  display: flex;
  justify-content: space-around;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.fb-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.fb-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: white;
}

.fb-btn.liked {
  color: #1877F2;
}

/* ============================================
   THEME 4: MASONRY GRID MODE
   ============================================ */
.feed-masonry {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  padding: var(--space-md);
}

@media (min-width: 600px) {
  .feed-masonry { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 900px) {
  .feed-masonry { grid-template-columns: repeat(4, 1fr); }
}

/* ============================================
   Comments Modal Sheet
   ============================================ */
.comments-modal-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-lg);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.comments-header {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-gold);
  font-size: 1.1rem;
}

.comments-list {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 380px;
}

.comment-item {
  display: flex;
  gap: 10px;
  font-size: 0.85rem;
  line-height: 1.4;
}

.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  color: white;
  flex-shrink: 0;
}

.comment-content {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  padding: 8px 12px;
  border-radius: var(--radius-md);
}

.comment-author {
  font-weight: 600;
  color: var(--color-gold-light);
  margin-bottom: 2px;
}

.comment-text {
  color: var(--color-text);
  word-break: break-word;
}

.comment-time {
  font-size: 0.65rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.comments-input-area {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ============================================
   Share Sheet Modal
   ============================================ */
.share-sheet-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.share-options-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: var(--space-lg) 0;
}

.share-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 12px 6px;
  color: white;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.share-btn:hover {
  background: rgba(183, 110, 121, 0.2);
  transform: translateY(-2px);
}

.share-btn span:first-child {
  font-size: 1.6rem;
}

.share-btn span:last-child {
  font-size: 0.72rem;
  font-weight: 500;
}

/* ============================================
   Floating Action Button (Add Photo)
   ============================================ */
.fab-btn {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  padding: 14px 22px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: white;
  border-radius: 50px;
  box-shadow: var(--shadow-glow), 0 8px 24px rgba(0, 0, 0, 0.4);
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  z-index: var(--z-sticky);
  transition: all var(--transition-normal);
}

.fab-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 0 35px rgba(183, 110, 121, 0.7);
  color: white;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
  color: var(--color-text-muted);
}
