/* ==========================================================================
   GIGGLEHUB: Funny GIF Portal & Instant Messaging Stylesheet
   ========================================================================== */

:root {
  --bg-primary: #0a0c14;
  --bg-secondary: #121524;
  --bg-card: #181d33;
  --bg-card-hover: #1f2542;
  --border-color: #273053;
  --border-light: #374375;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent-purple: #a855f7;
  --accent-pink: #ec4899;
  --accent-cyan: #06b6d4;
  --accent-amber: #f59e0b;
  --accent-emerald: #10b981;
  --gradient-neon: linear-gradient(135deg, #a855f7 0%, #ec4899 50%, #06b6d4 100%);
  --gradient-card: linear-gradient(180deg, rgba(24, 29, 51, 0.95) 0%, rgba(18, 21, 36, 0.95) 100%);
  --shadow-glow: 0 0 25px rgba(168, 85, 247, 0.25);
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.gif-hub-body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(168, 85, 247, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.08) 0%, transparent 40%);
  background-attachment: fixed;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-purple);
}

/* ==========================================================================
   Header & Nav
   ========================================================================== */
.gh-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 12, 20, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 24px;
}

.gh-nav-container {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.gh-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.gh-logo-icon {
  width: 42px;
  height: 42px;
  background: var(--gradient-neon);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 0 15px rgba(236, 72, 153, 0.4);
  animation: logo-bounce 3s infinite ease-in-out;
}

@keyframes logo-bounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-3px) rotate(4deg); }
}

.gh-logo-text {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: var(--gradient-neon);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gh-online-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.gh-online-dot {
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}

/* Search bar */
.gh-search-wrapper {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.gh-search-input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 30px;
  padding: 10px 18px 10px 42px;
  color: var(--text-main);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}

.gh-search-input:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
  background: var(--bg-card);
}

.gh-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 15px;
  pointer-events: none;
}

/* Nav Actions */
.gh-nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gh-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.gh-btn-primary {
  background: var(--gradient-neon);
  color: #fff;
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.gh-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(236, 72, 153, 0.4);
}

.gh-btn-ghost {
  background: var(--bg-secondary);
  color: var(--text-main);
  border-color: var(--border-color);
}

.gh-btn-ghost:hover {
  background: var(--bg-card);
  border-color: var(--border-light);
  transform: translateY(-1px);
}

.gh-user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 5px 12px 5px 8px;
  border-radius: 30px;
  cursor: pointer;
  transition: var(--transition);
}

.gh-user-chip:hover {
  border-color: var(--accent-cyan);
}

.gh-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(6, 182, 212, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.gh-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   Subnav / Category Bar
   ========================================================================== */
.gh-subnav {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 24px;
}

.gh-subnav-container {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  overflow-x: auto;
}

.gh-category-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.gh-pill {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  user-select: none;
}

.gh-pill:hover {
  color: var(--text-main);
  border-color: var(--border-light);
  transform: translateY(-1px);
}

.gh-pill.active {
  background: var(--accent-purple);
  color: #fff;
  border-color: var(--accent-purple);
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.4);
}

.gh-sort-select {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
}

/* ==========================================================================
   Mobile Tab Switcher
   ========================================================================== */
.gh-mobile-tabs {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99;
  background: rgba(18, 21, 36, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-color);
  padding: 8px 16px;
  justify-content: space-around;
}

.gh-m-tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.gh-m-tab-btn.active {
  color: var(--accent-pink);
}

/* ==========================================================================
   Main Grid Layout (GIFs + Live Chat)
   ========================================================================== */
.gh-main-layout {
  max-width: 1600px;
  margin: 20px auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 24px;
  align-items: start;
}

/* GIF Feed Section */
.gh-feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.gh-feed-title {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.gh-gif-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.gh-gif-card {
  background: var(--gradient-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
}

.gh-gif-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-purple);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(168, 85, 247, 0.2);
}

.gh-gif-media-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #0f121d;
  overflow: hidden;
  cursor: pointer;
}

.gh-gif-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  display: block;
}

.gh-gif-card:hover .gh-gif-img {
  transform: scale(1.03);
}

.gh-gif-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(10, 12, 20, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #e2e8f0;
}

.gh-gif-zoom-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(10, 12, 20, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  opacity: 0;
  transition: var(--transition);
}

.gh-gif-card:hover .gh-gif-zoom-btn {
  opacity: 1;
}

.gh-gif-content {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.gh-gif-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gh-reactions-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.gh-react-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 4px 8px;
  border-radius: 14px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.gh-react-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-pink);
  transform: scale(1.06);
  color: #fff;
}

.gh-react-btn.reacted {
  background: rgba(236, 72, 153, 0.15);
  border-color: var(--accent-pink);
  color: var(--accent-pink);
  font-weight: 700;
}

.gh-gif-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

.gh-card-action-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.gh-card-action-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.gh-card-action-btn.send-chat:hover {
  border-color: var(--accent-purple);
  color: var(--accent-purple);
}

/* ==========================================================================
   Live Instant Messaging Lounge (Right Sidebar)
   ========================================================================== */
.gh-chat-panel {
  position: sticky;
  top: 90px;
  background: var(--gradient-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 120px);
  min-height: 600px;
  overflow: hidden;
}

.gh-chat-header {
  padding: 14px 18px;
  background: rgba(18, 21, 36, 0.85);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gh-chat-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gh-chat-title {
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
}

.gh-chat-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gh-icon-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.gh-icon-btn:hover {
  color: var(--text-main);
  border-color: var(--border-light);
}

.gh-icon-btn.active {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

/* Channel Pills */
.gh-chat-channels {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(10, 12, 20, 0.6);
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
}

.gh-channel-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.gh-channel-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.gh-channel-btn.active {
  color: #fff;
  background: var(--accent-purple);
  border-color: var(--accent-purple);
}

/* Chat Messages Stream */
.gh-chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gh-message-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.gh-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a855f7, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.gh-msg-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.gh-msg-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.gh-msg-author {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-cyan);
}

.gh-msg-time {
  font-size: 10px;
  color: var(--text-dim);
}

.gh-msg-text {
  font-size: 13px;
  color: var(--text-main);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: 4px 12px 12px 12px;
  line-height: 1.4;
  word-break: break-word;
}

.gh-msg-gif {
  margin-top: 4px;
  max-width: 240px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.gh-msg-gif img {
  width: 100%;
  display: block;
  border-radius: var(--radius-sm);
}

/* Chat Input Bar */
.gh-chat-input-area {
  padding: 12px 16px;
  background: rgba(18, 21, 36, 0.95);
  border-top: 1px solid var(--border-color);
  position: relative;
}

.gh-attached-gif-preview {
  display: none;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--accent-purple);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  margin-bottom: 8px;
}

.gh-attached-gif-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
}

.gh-attached-gif-title {
  flex: 1;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gh-remove-gif-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 14px;
}

.gh-remove-gif-btn:hover {
  color: var(--accent-pink);
}

.gh-chat-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gh-chat-input {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--text-main);
  outline: none;
  transition: var(--transition);
}

.gh-chat-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.2);
}

.gh-picker-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--accent-pink);
  font-size: 11px;
  font-weight: 800;
  padding: 8px 12px;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
}

.gh-picker-btn:hover {
  background: rgba(236, 72, 153, 0.2);
  border-color: var(--accent-pink);
  transform: scale(1.04);
}

.gh-send-btn {
  background: var(--gradient-neon);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.4);
}

.gh-send-btn:hover {
  transform: scale(1.08);
}

/* ==========================================================================
   Inline GIF Picker Popover
   ========================================================================== */
.gh-gif-picker-popover {
  display: none;
  position: absolute;
  bottom: 80px;
  right: 16px;
  left: 16px;
  height: 300px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 15px rgba(168, 85, 247, 0.3);
  z-index: 50;
  flex-direction: column;
  overflow: hidden;
  animation: popUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popUp {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.gh-picker-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.gh-picker-search {
  flex: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 12px;
  outline: none;
}

.gh-picker-grid {
  flex: 1;
  padding: 8px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.gh-picker-item {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
}

.gh-picker-item:hover {
  border-color: var(--accent-pink);
  transform: scale(1.03);
}

.gh-picker-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ==========================================================================
   Soundboard Modal / Drawer
   ========================================================================== */
.gh-soundboard-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(10, 12, 20, 0.8);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.gh-soundboard-card {
  width: 100%;
  max-width: 520px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7), var(--shadow-glow);
  padding: 24px;
}

.gh-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.gh-modal-title {
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.gh-close-modal-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
}

.gh-close-modal-btn:hover {
  color: #fff;
}

.gh-sb-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.gh-sb-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.gh-sb-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-purple);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.25);
}

.gh-sb-btn:active {
  transform: scale(0.97);
}

.gh-sb-icon {
  font-size: 24px;
}

.gh-sb-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.gh-sb-name {
  font-size: 13px;
  font-weight: 700;
}

.gh-sb-desc {
  font-size: 11px;
  color: var(--text-dim);
}

/* ==========================================================================
   Add GIF Modal & Lightbox
   ========================================================================== */
.gh-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(10, 12, 20, 0.85);
  backdrop-filter: blur(10px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.gh-lightbox-content {
  max-width: 800px;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}

.gh-lightbox-img-wrap {
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 550px;
}

.gh-lightbox-img-wrap img {
  max-width: 100%;
  max-height: 550px;
  object-fit: contain;
}

.gh-lightbox-footer {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-secondary);
}

/* Form Styles */
.gh-form-group {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gh-form-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.gh-form-input, .gh-form-select {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-main);
  font-size: 13px;
  outline: none;
}

.gh-form-input:focus, .gh-form-select:focus {
  border-color: var(--accent-purple);
}

/* Toast notifications */
.gh-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(40px);
  background: rgba(18, 21, 36, 0.95);
  border: 1px solid var(--accent-cyan);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), 0 0 15px rgba(6, 182, 212, 0.3);
  color: #fff;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.gh-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1080px) {
  .gh-main-layout {
    grid-template-columns: 1fr;
    padding-bottom: 70px;
  }

  .gh-chat-panel {
    position: static;
    height: 600px;
  }

  .gh-mobile-tabs {
    display: flex;
  }

  .gh-mobile-hidden {
    display: none !important;
  }
}

/* ==========================================================================
   PHONE VIEW, SWIPE REELS & MEDIA STYLES
   ========================================================================== */

/* Reels trigger button in header */
.gh-btn-reels {
  background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 0 16px rgba(236, 72, 153, 0.4);
  position: relative;
  overflow: hidden;
}

.gh-btn-reels:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 0 24px rgba(236, 72, 153, 0.6);
}

.gh-badge-glow {
  font-size: 9px;
  background: #ff007f;
  color: #fff;
  padding: 2px 5px;
  border-radius: 6px;
  font-weight: 900;
  letter-spacing: 0.5px;
  box-shadow: 0 0 8px #ff007f;
  animation: pulse-dot 1.5s infinite;
}

/* Phone Swipe Promo Banner on feed */
.gh-swipe-banner {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.15) 0%, rgba(139, 92, 246, 0.2) 50%, rgba(6, 182, 212, 0.15) 100%);
  border: 1px solid rgba(236, 72, 153, 0.35);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 20px rgba(236, 72, 153, 0.15);
}

.gh-swipe-banner:hover {
  border-color: var(--accent-pink);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 25px rgba(236, 72, 153, 0.3);
}

.gh-swipe-banner-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.gh-swipe-phone-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 14px rgba(236, 72, 153, 0.4);
  flex-shrink: 0;
}

.gh-swipe-banner-title {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gh-badge-pill {
  font-size: 10px;
  font-weight: 800;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid #10b981;
  color: #34d399;
  padding: 2px 8px;
  border-radius: 12px;
}

.gh-swipe-banner-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Card Media Type Badges */
.gh-media-type-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(10, 12, 20, 0.82);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 2;
}

.gh-media-type-badge.video {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.gh-media-type-badge.audio {
  border-color: var(--accent-pink);
  color: var(--accent-pink);
}

/* ==========================================================================
   Full-Screen Phone View Modal & Swiper
   ========================================================================== */
.gh-phone-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(8, 10, 16, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease-out;
}

.gh-phone-side-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-right: 20px;
  z-index: 510;
}

.gh-phone-nav-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.gh-phone-nav-btn:hover {
  background: var(--accent-purple);
  border-color: var(--accent-purple);
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.5);
}

/* Realistic Smartphone Bezel on desktop */
.gh-phone-device-frame {
  width: 100%;
  max-width: 410px;
  height: 86vh;
  max-height: 860px;
  background: #000;
  border-radius: 46px;
  border: 9px solid #1e2438;
  box-shadow: 
    0 0 0 2px rgba(255, 255, 255, 0.1),
    0 25px 60px rgba(0, 0, 0, 0.9),
    0 0 40px rgba(168, 85, 247, 0.3);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
}

/* Notch / Dynamic Island */
.gh-phone-notch {
  position: absolute;
  top: 8px;
  left: 0;
  right: 0;
  z-index: 520;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.gh-phone-island {
  width: 110px;
  height: 24px;
  background: #000;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

/* Status Bar & Controls Overlay */
.gh-phone-status-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 38px 16px 12px 16px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
  z-index: 515;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: auto;
}

.gh-phone-ctrl-btn {
  background: rgba(24, 29, 51, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.gh-phone-ctrl-btn:hover {
  background: rgba(236, 72, 153, 0.6);
  border-color: var(--accent-pink);
}

.gh-phone-brand-pill {
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
  padding: 4px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ==========================================================================
   Vertical Reels Deck (Hardware Accelerated Motion & Smooth Snap)
   ========================================================================== */
.gh-reels-deck {
  width: 100%;
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background: #000;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.gh-reels-deck::-webkit-scrollbar {
  display: none;
}

.gh-reel-card {
  width: 100%;
  height: 100%;
  min-height: 100%;
  max-height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: hidden;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform, opacity;
  contain: paint layout;
}

/* Full Bleed Media */
.gh-reel-media-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  background: #000;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.gh-reel-media {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
  transform: scale(0.96) translateZ(0);
  opacity: 0.88;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
  will-change: transform, opacity;
  backface-visibility: hidden;
}

/* Active Card Smooth Motion Entrance */
.gh-reel-card.active .gh-reel-media {
  transform: scale(1) translateZ(0);
  opacity: 1;
}

.gh-reel-video {
  background: #000;
  object-fit: contain;
}

/* Right-Hand Floating Action Bar (TikTok / Reels Style) */
.gh-reel-actions {
  position: absolute;
  right: 14px;
  bottom: 84px;
  z-index: 512;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  pointer-events: auto;
}

.gh-reel-action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.gh-reel-act-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(24, 29, 51, 0.75);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.gh-reel-act-btn:hover {
  transform: scale(1.15);
  background: rgba(236, 72, 153, 0.5);
  border-color: var(--accent-pink);
}

.gh-reel-act-btn.liked {
  color: #ff007f;
  background: rgba(255, 0, 127, 0.2);
  border-color: #ff007f;
  animation: heartPulse 0.4s ease;
}

@keyframes heartPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.35); }
  100% { transform: scale(1.15); }
}

.gh-reel-act-count {
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* Bottom Caption & Audio Overlay */
.gh-reel-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 68px;
  padding: 30px 16px 20px 16px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.5) 60%, transparent 100%);
  z-index: 512;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: auto;
}

.gh-reel-author-tag {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gh-reel-author-name {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.gh-reel-cat-pill {
  font-size: 10px;
  font-weight: 700;
  background: rgba(168, 85, 247, 0.35);
  border: 1px solid var(--accent-purple);
  color: #e9d5ff;
  padding: 2px 7px;
  border-radius: 10px;
}

.gh-reel-title {
  font-size: 13px;
  font-weight: 600;
  color: #f1f5f9;
  line-height: 1.35;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Rotating Vinyl Disc */
.gh-reel-disc-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.gh-reel-disc {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle, #333 30%, #111 70%);
  border: 2px solid #555;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  animation: spinDisc 3s linear infinite;
}

@keyframes spinDisc {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.gh-reel-disc-title {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Double-Tap Beating Heart Animation */
.gh-heart-burst {
  position: absolute;
  pointer-events: none;
  font-size: 90px;
  color: #ff007f;
  filter: drop-shadow(0 0 20px rgba(255, 0, 127, 0.8));
  z-index: 525;
  animation: heartBurst 0.75s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes heartBurst {
  0% { transform: scale(0) rotate(-15deg); opacity: 0; }
  40% { transform: scale(1.3) rotate(0deg); opacity: 1; }
  70% { transform: scale(1.1) rotate(5deg); opacity: 0.9; }
  100% { transform: scale(0.7) translateY(-60px) rotate(15deg); opacity: 0; }
}

/* ==========================================================================
   Add Media Modal Type Switcher Tabs
   ========================================================================== */
.gh-media-type-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  background: var(--bg-secondary);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.gh-type-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 8px 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.gh-type-tab-btn:hover {
  color: #fff;
}

.gh-type-tab-btn.active {
  background: var(--accent-purple);
  color: #fff;
  box-shadow: 0 2px 8px rgba(168, 85, 247, 0.3);
}

/* Mobile Breakpoint for Phone View */
@media (max-width: 640px) {
  .gh-phone-side-controls {
    display: none;
  }

  .gh-phone-device-frame {
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    border: none;
  }

  .gh-phone-notch {
    display: none;
  }

  .gh-phone-status-bar {
    padding: 16px 14px 10px 14px;
  }

  .gh-swipe-banner {
    flex-direction: column;
    align-items: flex-start;
  }
}



/* ==========================================================================
   Media Fixer, Broken Image Moderation & Reaction Prevention Styles
   ========================================================================== */

.gh-badge-warning {
  background: #f59e0b;
  color: #000;
  font-weight: 800;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 4px;
  letter-spacing: 0.5px;
}

.gh-btn-danger {
  background: #ef4444 !important;
  color: #fff !important;
  border: 1px solid #dc2626 !important;
}

.gh-btn-danger:hover {
  background: #dc2626 !important;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.4);
}

/* Card in Flagged State */
.gh-gif-card.flagged-media {
  border-color: rgba(239, 68, 68, 0.7) !important;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.25) !important;
}

/* Broken Card Overlay Banner */
.gh-broken-card-banner {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(25, 10, 10, 0.94), rgba(15, 15, 15, 0.98));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  z-index: 10;
  backdrop-filter: blur(4px);
}

.gh-broken-icon {
  font-size: 28px;
  margin-bottom: 6px;
  filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.6));
}

.gh-broken-title {
  font-size: 13px;
  font-weight: 700;
  color: #fca5a5;
  margin-bottom: 4px;
}

.gh-broken-desc {
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 12px;
  max-width: 220px;
  line-height: 1.4;
}

.gh-broken-toolbar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.gh-mod-btn {
  font-size: 11px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.gh-mod-btn.btn-delete {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  color: #f87171;
}

.gh-mod-btn.btn-delete:hover {
  background: #ef4444;
  color: #fff;
  transform: translateY(-1px);
}

.gh-mod-btn.btn-restore {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.5);
  color: #34d399;
}

.gh-mod-btn.btn-restore:hover {
  background: #10b981;
  color: #fff;
  transform: translateY(-1px);
}

.gh-mod-btn.btn-rename {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.5);
  color: #60a5fa;
}

.gh-mod-btn.btn-rename:hover {
  background: #3b82f6;
  color: #fff;
  transform: translateY(-1px);
}

.gh-mod-btn.btn-replace {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.5);
  color: #fbbf24;
}

.gh-mod-btn.btn-replace:hover {
  background: #f59e0b;
  color: #000;
  transform: translateY(-1px);
}

/* Phone View Reel Reacted Glow State */
.gh-reel-act-btn.reacted {
  background: rgba(250, 204, 21, 0.25) !important;
  border-color: #facc15 !important;
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.6) !important;
  transform: scale(1.08);
}

/* Reel Broken Slide Banner */
.gh-reel-broken-box {
  background: rgba(20, 10, 10, 0.92);
  border: 1px solid rgba(239, 68, 68, 0.5);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  max-width: 320px;
  margin: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

/* Shake Animation when trying to spam reacted buttons */
@keyframes ghPulseShake {
  0%, 100% { transform: scale(1); }
  20%, 60% { transform: scale(1.1) translateX(-5px) rotate(-5deg); }
  40%, 80% { transform: scale(1.1) translateX(5px) rotate(5deg); }
}

.gh-pulse-shake {
  animation: ghPulseShake 0.4s ease-in-out !important;
}

/* Flagged Item List in Modal */
.gh-flagged-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 14px;
  border-radius: 8px;
  gap: 12px;
}

.gh-flagged-thumb {
  width: 52px;
  height: 52px;
  border-radius: 6px;
  object-fit: cover;
  background: #000;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}
