@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-main: #0b0f19;
  --bg-secondary: #111827;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #6366f1;
  --accent-indigo: #6366f1;
  --accent-pink: #ec4899;
  --accent-emerald: #10b981;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

/* SVG Icon Helper */
.icon-svg {
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  stroke-width: 2;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.15em;
}

/* Minimal Professional Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-main);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.03em;
}

.brand-dot {
  width: 10px;
  height: 10px;
  background: var(--accent-indigo);
  border-radius: 50%;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-btn {
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-btn-primary {
  background: var(--accent-indigo);
  color: #fff;
}

.nav-btn-primary:hover {
  background: #4f46e5;
}

.nav-btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.nav-btn-secondary:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Navbar Profile Avatar */
.nav-profile-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1.5px solid var(--accent-indigo);
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-pink));
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.2s ease;
  overflow: hidden;
}

.nav-profile-avatar:hover {
  transform: scale(1.06);
}

.nav-profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

/* Container */
.container {
  max-width: 620px;
  width: 92%;
  margin: 0.5rem auto 2rem auto;
  flex: 1;
}

/* Leaderboard Grid & Distinct Rank Badge Colors #1 - #10 */
.leaderboard-grid {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.leader-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.leader-card:hover {
  border-color: var(--accent-indigo);
  transform: translateX(4px);
}

.leader-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.rank-badge {
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
}

.rank-1 { background: rgba(245, 158, 11, 0.18); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.35); }
.rank-2 { background: rgba(6, 182, 212, 0.18); color: #06b6d4; border: 1px solid rgba(6, 182, 212, 0.35); }
.rank-3 { background: rgba(249, 115, 22, 0.18); color: #f97316; border: 1px solid rgba(249, 115, 22, 0.35); }
.rank-4 { background: rgba(99, 102, 241, 0.18); color: #6366f1; border: 1px solid rgba(99, 102, 241, 0.35); }
.rank-5 { background: rgba(16, 185, 129, 0.18); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.35); }
.rank-6 { background: rgba(236, 72, 153, 0.18); color: #ec4899; border: 1px solid rgba(236, 72, 153, 0.35); }
.rank-7 { background: rgba(168, 85, 247, 0.18); color: #a855f7; border: 1px solid rgba(168, 85, 247, 0.35); }
.rank-8 { background: rgba(244, 63, 94, 0.18); color: #f43f5e; border: 1px solid rgba(244, 63, 94, 0.35); }
.rank-9 { background: rgba(59, 130, 246, 0.18); color: #3b82f6; border: 1px solid rgba(59, 130, 246, 0.35); }
.rank-10 { background: rgba(20, 184, 166, 0.18); color: #14b8a6; border: 1px solid rgba(20, 184, 166, 0.35); }

.leader-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--accent-indigo);
  flex-shrink: 0;
}

.leader-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.leader-likes {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #f87171;
}

/* Clean Threads Post Cards */
.threads-feed {
  display: flex;
  flex-direction: column;
}

.threads-card {
  display: flex;
  flex-direction: column;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border-subtle);
  background: transparent;
}

.threads-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.user-info-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.threads-avatar-squircle {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid var(--accent-indigo);
  flex-shrink: 0;
}

.threads-author {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  text-decoration: none;
}

.threads-author:hover {
  color: var(--accent-indigo);
}

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

.threads-text {
  font-size: 0.96rem;
  color: var(--text-primary);
  line-height: 1.55;
  margin: 0.25rem 0 0.65rem 0;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
}

.flame-like-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.2rem 0.3rem;
  border-radius: 6px;
  transition: transform 0.15s ease, color 0.15s ease;
  outline: none;
}

.flame-like-btn:hover {
  transform: scale(1.12);
  color: #ef4444;
}

.flame-icon-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  vertical-align: middle;
}

/* Profile Layout Customizations */
.profile-wrapper {
  max-width: 480px;
  margin: 0 auto;
  padding-top: 0.5rem;
}

.profile-header-flex {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.profile-avatar-left {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid var(--accent-indigo);
  flex-shrink: 0;
}

.profile-info-right {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.profile-name-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.clean-likes-count {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #f87171;
  margin-top: 0.25rem;
}

.clean-welcome-note {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.5rem;
  text-align: left;
  font-style: italic;
}

/* Modern Segmented Control Tab Switcher */
.segmented-control {
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 1.5rem;
}

.segmented-btn {
  flex: 1;
  padding: 0.65rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.88rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  outline: none;
}

.segmented-btn.active {
  background: var(--accent-indigo);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* Ultra-Thin Single Row Input Bar Wrapper */
.thin-input-bar-wrapper {
  position: relative;
  width: 100%;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
}

.thin-input-field {
  width: 100%;
  height: 48px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0 5.5rem 0 1rem;
  color: var(--text-primary);
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.thin-input-field:focus {
  border-color: var(--border-focus);
}

.thin-send-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  height: 36px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  border: none;
  padding: 0 0.85rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: opacity 0.2s ease, transform 0.15s ease;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
  z-index: 5;
}

.thin-send-btn:hover {
  opacity: 0.92;
  transform: translateY(-50%) scale(1.02);
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.input-clean {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.btn-primary-full {
  width: 100%;
  padding: 0.9rem;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.98rem;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.25);
}

.action-icon-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  transition: all 0.25s ease;
}

.action-icon-btn:hover {
  border-color: var(--accent-indigo);
  color: var(--accent-indigo);
  background: rgba(99, 102, 241, 0.08);
}

.copy-pulse-green {
  border-color: #10b981 !important;
  color: #10b981 !important;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.4);
  animation: greenGlowPulse 0.6s ease-in-out;
}

@keyframes greenGlowPulse {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(16, 185, 129, 0); }
  50% { transform: scale(1.05); box-shadow: 0 0 16px rgba(16, 185, 129, 0.6); }
  100% { transform: scale(1); box-shadow: 0 0 14px rgba(16, 185, 129, 0.4); }
}

.share-icon-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.share-icon-btn:hover:not(:disabled) {
  border-color: var(--accent-indigo);
  color: var(--accent-indigo);
  background: rgba(99, 102, 241, 0.1);
}

.shared-green-disabled {
  background: rgba(16, 185, 129, 0.15) !important;
  border-color: #10b981 !important;
  color: #10b981 !important;
  cursor: default !important;
  pointer-events: none !important;
  opacity: 0.9;
}

.sender-tg-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--accent-emerald);
  transition: opacity 0.2s ease;
}

.sender-tg-link:hover {
  opacity: 0.8;
}

.sender-tg-avatar {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--accent-emerald);
}

.stat-mini-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  padding: 0.5rem 0;
  background: transparent;
  border: none;
  box-shadow: none;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 1rem auto 1.5rem auto;
}

.stat-mini-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--text-primary);
}

.stat-mini-divider {
  color: var(--border-subtle);
  font-size: 0.8rem;
}

.dashboard-main-tabs {
  display: flex;
  gap: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1.5rem;
}

.dash-tab-btn {
  padding-bottom: 0.75rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.dash-tab-btn.active {
  color: var(--accent-indigo);
  border-bottom-color: var(--accent-indigo);
  font-weight: 600;
}

.inbox-sub-tabs {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.sub-tab-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.sub-tab-btn.active {
  background: var(--accent-indigo);
  border-color: var(--accent-indigo);
  color: #fff;
}

.message-list {
  display: flex;
  flex-direction: column;
}

.message-row {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.message-row:last-child {
  border-bottom: none;
}

.message-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.tag-anon {
  color: var(--accent-indigo);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.tag-public {
  color: var(--accent-emerald);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.message-text-content {
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

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

.alert {
  padding: 0.85rem 1.1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  margin-top: auto;
}
