/* =========================
   A) DESIGN TOKENS (REFINED COMMUNITY STYLE)
   ========================= */
:root{
  /* Color Palette */
  --bg:#ffffff;
  --bg-alt: #f9fafb;
  --ink:#101828;
  --ink-rgb: 16, 24, 40;
  --muted:#667085;
  --muted-light: #98a2b3;
  --line:rgba(16,24,40,.06);
  
  --black:#0b0b0f;
  --blue-soft:#eaf2ff;
  --sand-soft:#fff2dd;
  --chip:#f2f4f7;
  
  --accent:#2b6be6;
  --accent-hover: #1d58c9;
  --accent-gradient: linear-gradient(135deg, #2b6be6, #1a56cc);
  --success:#12b76a;
  --warn:#f79009;
  --error:#f04438;

  /* Type colors for Dance IDs */
  --typeDancer:#2b6be6;
  --typeCouple:#7a5af8;
  --typeJudge:#b54708;
  --typeTournament:#b6922e;
  --typeClub:#12b76a;

  /* Typography - Fluid Scale */
  --font-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.8rem);
  --font-sm: clamp(0.875rem, 0.85rem + 0.125vw, 0.9rem);
  --font-base: clamp(1rem, 0.95rem + 0.25vw, 1.05rem);
  --font-md: clamp(1.125rem, 1.05rem + 0.375vw, 1.25rem);
  --font-lg: clamp(1.266rem, 1.15rem + 0.5vw, 1.5rem);
  --font-xl: clamp(1.424rem, 1.3rem + 0.75vw, 1.75rem);
  --font-xxl: clamp(1.602rem, 1.45rem + 1vw, 2rem);

  /* Spacing */
  --sp-05: 4px;
  --sp-1: 8px;
  --sp-1-5: 12px;
  --sp-2: 16px;
  --sp-3: 24px;
  --sp-4: 32px;
  --sp-5: 40px;
  --sp-6: 48px;

  /* Shadows */
  --shadow-color: 16deg 24% 40%;
  --shadow-xs: 0px 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-sm: 0px 1px 3px rgba(16, 24, 40, 0.1), 0px 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0px 4px 8px -2px rgba(16, 24, 40, 0.1), 0px 2px 4px -2px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0px 12px 16px -4px rgba(16, 24, 40, 0.08), 0px 4px 6px -2px rgba(16, 24, 40, 0.03);
  --shadow-xl: 0px 20px 24px -4px rgba(16, 24, 40, 0.08), 0px 8px 8px -4px rgba(16, 24, 40, 0.03);
  --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
  --glow-focus: 0 0 0 3px rgba(43, 107, 230, 0.15);

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 999px;

  /* Physics */
  --spring-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(16,24,40,0.15); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(16,24,40,0.25); }

html, body { height: 100%; background: var(--bg); color: var(--ink); }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  overflow-x: hidden;
  font-size: var(--font-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; transition: color 0.2s var(--ease-smooth); }

/* =========================
   B) BOARD LAYOUT
   ========================= */
.board {
  min-height: 100vh;
  width: 100%;
  background: var(--bg);
  overflow: hidden;
}
@media (min-width: 992px) {
  .board {
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    margin: var(--sp-4) auto;
    max-width: 1400px;
    min-height: calc(100vh - var(--sp-6));
    border: 1px solid var(--line);
  }
}

.board-row {
  display: flex;
  flex-wrap: nowrap;
  min-height: 100%;
}

.col-left {
  flex: 0 0 280px; width: 280px;
  border-right: 1px solid var(--line);
  padding: var(--sp-3) var(--sp-2);
}
.col-mid {
  flex: 1 1 auto; min-width: 0;
  padding: var(--sp-3) var(--sp-4);
}
.col-right {
  flex: 0 0 320px; width: 320px;
  border-left: 1px solid var(--line);
  padding: var(--sp-3) var(--sp-3);
  position: relative;
}
.col-right-sticky {
  position: sticky; top: var(--sp-3);
  display: flex; flex-direction: column; gap: var(--sp-4);
}

@media (max-width: 991.98px) {
  .col-left { flex: 0 0 78px; width: 78px; padding: var(--sp-2) var(--sp-1); }
  .col-right { display: none; }
  .col-mid { padding: var(--sp-2); }
}

/* =========================
   C) AVATARS & RINGS
   ========================= */
.avatar-user, .avatar-danceid {
  position: relative;
  background: var(--bg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--spring-bounce);
}
.avatar-user:hover, .avatar-danceid:hover { transform: scale(1.05); }

.avatar-user {
  width: 54px; height: 54px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px var(--line), var(--shadow-sm);
}
.avatar-user.sm {
  width: 36px; height: 36px; border: 2px solid var(--bg);
}
.avatar-danceid {
  width: 54px; height: 54px; border-radius: 16px; object-fit: cover;
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px var(--line), var(--shadow-sm);
}
.avatar-danceid.sm {
  width: 36px; height: 36px; border-radius: 10px; border: 2px solid var(--bg);
}

.has-status::after {
  content: ''; position: absolute; bottom: 2px; right: 2px;
  width: 12px; height: 12px; background: var(--success);
  border: 2px solid var(--bg); border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.05);
}

/* =========================
   D) IDENTITY SWITCHER
   ========================= */
.identity-switch {
  display: flex; align-items: center; gap: var(--sp-1-5);
  padding: var(--sp-1-5);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  cursor: pointer; user-select: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s var(--ease-smooth);
}
.identity-switch:hover {
  background: #fff;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.identity-switch:active { transform: scale(0.98); }

.id-title { font-weight: 800; font-size: var(--font-base); letter-spacing: -0.01em; line-height: 1.1; }
.id-sub { color: var(--muted); font-weight: 500; font-size: var(--font-xs); margin-top: 2px; }
.id-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--radius-full);
  border: 1px solid var(--line);
  background: var(--chip);
  font-weight: 700; color: var(--ink);
  font-size: 0.75rem; margin-top: var(--sp-1);
}
@media (max-width: 991.98px) { .identity-text { display: none; } }

/* =========================
   E) NAVIGATION
   ========================= */
.left-nav .nav-link {
  color: var(--ink);
  border-radius: var(--radius-md);
  padding: var(--sp-1-5) var(--sp-2);
  display: flex; align-items: center; gap: var(--sp-1-5);
  font-weight: 600; font-size: var(--font-sm);
  transition: all 0.2s var(--ease-smooth);
  position: relative; overflow: hidden;
}
.left-nav .nav-link::after {
  content: ''; position: absolute; inset: 0; background: currentColor; opacity: 0;
  transition: opacity 0.3s; pointer-events: none;
}
.left-nav .nav-link:active::after { opacity: 0.1; }

.left-nav .nav-link:hover { background: var(--bg-alt); color: var(--accent); }
.left-nav .nav-link i { width: 20px; color: var(--muted); transition: color 0.2s; text-align: center; }
.left-nav .nav-link:hover i { color: var(--accent); transform: scale(1.1); }

.left-nav .nav-link.active {
  background: var(--black);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.left-nav .nav-link.active i { color: #fff; }

.badge-dot {
  min-width: 20px; height: 20px; border-radius: var(--radius-full);
  background: var(--accent); color: #fff; font-size: 0.7rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin-left: auto; box-shadow: 0 2px 5px rgba(43, 107, 230, 0.3);
}
@media (max-width: 991.98px) {
  .left-nav .nav-link { justify-content: center; padding: var(--sp-1-5) var(--sp-1); }
  .left-nav .nav-link span.label { display: none; }
  .badge-dot { display: none; }
  .special-access { display: none; }
}

/* =========================
   F) HEADER & TABS
   ========================= */
.mid-top {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: var(--sp-3); gap: var(--sp-2);
}
.mid-title { font-size: var(--font-xl); font-weight: 800; letter-spacing: -0.03em; color: var(--ink); }
.mid-sub { color: var(--muted); font-weight: 500; font-size: var(--font-sm); }

.tabs {
  display: flex; gap: var(--sp-3); align-items: center;
  position: relative;
}
.tabs button {
  border: none; background: none; padding: var(--sp-1) 0;
  color: var(--muted); font-weight: 600; font-size: var(--font-sm);
  position: relative; transition: color 0.3s var(--ease-smooth);
}
.tabs button:hover { color: var(--ink); }
.tabs button.active { color: var(--ink); font-weight: 700; }
.tabs button.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px;
  height: 3px; border-radius: 3px; background: var(--black);
  transform-origin: center; animation: scaleIn 0.3s var(--spring-bounce);
}
@keyframes scaleIn { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* =========================
   G) CARDS & ELEMENTS
   ========================= */
.cardish, .feed-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--bg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: var(--sp-4);
  transition: transform 0.3s var(--spring-bounce), box-shadow 0.3s var(--ease-smooth), background-color 0.3s;
}
.feed-card:hover, .cardish:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.feed-card.blue { background: var(--blue-soft); border-color: rgba(43, 107, 230, 0.1); }
.feed-card.blue:hover { background: #e0edff; }
.feed-card.sand { background: var(--sand-soft); border-color: rgba(247, 144, 9, 0.1); }
.feed-card.sand:hover { background: #ffebd1; }

.inner { padding: var(--sp-3); }

.post-header { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-1-5); }
.post-name { font-weight: 700; font-size: var(--font-base); line-height: 1.2; }
.post-meta { color: var(--muted); font-size: var(--font-xs); font-weight: 500; }

.kebab {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  border: 1px solid transparent; color: var(--muted);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: all 0.2s;
}
.kebab:hover { background: rgba(0,0,0,0.05); color: var(--ink); transform: rotate(90deg); }

.post-text {
  margin-top: var(--sp-2);
  color: var(--ink);
  font-weight: 400;
  font-size: var(--font-sm);
  letter-spacing: 0.01em;
}
.mention { color: var(--accent); font-weight: 600; background: rgba(43, 107, 230, 0.08); padding: 0 4px; border-radius: 4px; }

.media-grid {
  margin-top: var(--sp-2); display: grid; grid-template-columns: 1fr 1fr 1.25fr; gap: var(--sp-1-5);
}
.media {
  border-radius: var(--radius-md); overflow: hidden;
  border: 1px solid var(--line); background: var(--bg-alt);
  position: relative; min-height: 160px;
  background-size: cover;
}
.media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.5s var(--ease-smooth);
}
.media:hover img { transform: scale(1.05); }
.media.big { min-height: 200px; }

.reaction-row {
  margin-top: var(--sp-2); display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-1) 0; color: var(--muted); font-weight: 600; font-size: var(--font-xs);
}

.action-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(4px);
  padding: 6px 12px; border-radius: var(--radius-full);
  font-weight: 600; color: var(--ink); font-size: var(--font-xs);
  cursor: pointer; display: flex; align-items: center; gap: 6px;
  transition: all 0.2s var(--spring-bounce);
}
.action-btn:hover { background: #fff; transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.action-btn:active { transform: scale(0.95); }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius-full);
  border: 1px solid var(--line);
  background: var(--bg);
  font-weight: 600; font-size: var(--font-xs); cursor: pointer;
  transition: all 0.2s;
}
.pill:hover { background: var(--bg-alt); border-color: var(--muted-light); }
.pill:hover i { transform: rotate(-10deg) scale(1.1); transition: transform 0.3s var(--spring-bounce); }

/* Primary Action with Gradient */
.btn-danceid {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--radius-full);
  background: var(--black); 
  background: linear-gradient(135deg, #1f2937, #000);
  color: #fff; font-weight: 700; font-size: var(--font-sm); border: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: all 0.3s var(--spring-bounce);
  position: relative; overflow: hidden;
}
.btn-danceid::before {
  content: ''; position: absolute; inset: 0; background: rgba(255,255,255,0.1); opacity: 0; transition: opacity 0.2s;
}
.btn-danceid:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 8px 20px rgba(0,0,0,0.2); }
.btn-danceid:hover::before { opacity: 1; }
.btn-danceid:active { transform: scale(0.96); }

/* =========================
   H) COMPOSER
   ========================= */
.composer-top { padding: var(--sp-2); display: flex; gap: var(--sp-1-5); }
.composer-box {
  flex: 1; border: none; background: var(--chip);
  border-radius: var(--radius-lg); padding: 12px 16px;
  color: var(--muted); font-weight: 500; cursor: text;
  box-shadow: var(--shadow-inner);
  transition: height 0.3s var(--ease-smooth);
}
.composer-actions {
  padding: 0 var(--sp-2) var(--sp-2); display: flex; gap: var(--sp-1); flex-wrap: wrap;
}
.composer-send {
  margin-left: auto; background: var(--accent-gradient); color: #fff;
  border: none; padding: 8px 24px; border-radius: var(--radius-full); font-weight: 700;
  box-shadow: 0 4px 10px rgba(43, 107, 230, 0.3);
  transition: transform 0.2s var(--spring-bounce);
}
.composer-send:hover { transform: scale(1.05); }

/* =========================
   I) RIGHT WIDGETS
   ========================= */
.right-title { font-size: var(--font-lg); font-weight: 800; letter-spacing: -0.02em; margin: var(--sp-1) 0 var(--sp-2); }

.stories { display: flex; gap: var(--sp-1-5); overflow-x: auto; padding-bottom: var(--sp-2); scrollbar-width: none; }
.story {
  width: 130px; height: 180px; border-radius: var(--radius-lg); overflow: hidden;
  position: relative; border: 1px solid var(--line);
  flex: 0 0 auto; background: var(--black);
  box-shadow: var(--shadow-md); cursor: pointer;
  transition: transform 0.3s var(--spring-bounce);
}
.story:hover { transform: translateY(-4px) rotate(1deg); }
.story img { width: 100%; height: 100%; object-fit: cover; opacity: 0.9; }

.story::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 40px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent); z-index: 2;
}
.story::after {
  content: ''; position: absolute; top: 8px; left: 8px; width: 30%; height: 2px;
  background: rgba(255,255,255,0.8); border-radius: 2px; z-index: 3;
}

.story .label {
  position: absolute; left: 8px; bottom: 8px;
  color: #fff; font-weight: 700; font-size: 0.75rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5); z-index: 2;
}

.sug { padding: var(--sp-1) 0; }
.sug .n { font-weight: 700; font-size: var(--font-sm); }
.btn-follow {
  background: var(--bg); border: 1px solid var(--line); color: var(--ink);
  border-radius: var(--radius-full); padding: 4px 12px; font-size: 0.75rem; font-weight: 700;
  transition: all 0.2s;
}
.btn-follow:hover { background: var(--black); color: #fff; border-color: var(--black); }

.reco-tile {
  height: 100px; border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--bg);
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--sp-1); font-weight: 700; font-size: var(--font-sm); cursor: pointer;
  transition: all 0.3s var(--spring-bounce);
}
.reco-tile:hover { background: var(--bg-alt); transform: scale(1.03); border-color: var(--accent); color: var(--accent); }
.reco-tile i { font-size: 1.5rem; color: var(--muted); transition: color 0.3s; }
.reco-tile:hover i { color: var(--accent); }

/* =========================
   J) LISTS & HEADERS
   ========================= */
.page-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2);
  padding: var(--sp-3); border-bottom: 1px solid var(--line);
}
.page-head .h { font-weight: 800; font-size: var(--font-lg); }
.page-head .d { color: var(--muted); font-weight: 500; font-size: var(--font-sm); margin-top: 2px; }

.list-item {
  padding: var(--sp-2) var(--sp-3); border-top: 1px solid var(--line);
  display: flex; gap: var(--sp-2); align-items: center; justify-content: space-between;
  transition: background 0.2s;
}
.list-item:hover { background: var(--bg-alt); }

.status-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px; border-radius: var(--radius-full);
  border: 1px solid var(--line); background: var(--bg);
  font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em;
}
.dot { width: 6px; height: 6px; border-radius: 50%; box-shadow: 0 0 4px currentColor; }
.dot.open { background: var(--success); color: var(--success); }
.dot.soon { background: var(--warn); color: var(--warn); }
.dot.done { background: var(--muted); color: var(--muted); }

/* =========================
   K) DANCE ID CARD
   ========================= */
.did-card {
  border-radius: var(--radius-xl); border: 1px solid var(--line);
  background: var(--bg); box-shadow: var(--shadow-md);
  overflow: hidden; position: relative; min-width: 240px; cursor: pointer;
  transition: transform 0.3s var(--spring-bounce), box-shadow 0.3s;
}
.did-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-xl); }
.did-inner { padding: var(--sp-3); padding-top: var(--sp-5); text-align: center; }
.did-cover {
  height: 120px; background: var(--chip);
  position: relative;
}
.did-cover img { width: 100%; height: 100%; object-fit: cover; }

.did-badge {
  position: absolute; left: 50%; top: 90px; transform: translateX(-50%);
  width: 64px; height: 64px; border-radius: var(--radius-lg);
  background: var(--bg); border: 4px solid var(--bg);
  box-shadow: var(--shadow-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: var(--ink); z-index: 10;
}

.did-name { font-weight: 800; font-size: var(--font-md); margin-bottom: 2px; }
.did-type { font-size: 0.7rem; text-transform: uppercase; font-weight: 800; letter-spacing: 0.1em; margin-bottom: var(--sp-1); opacity: 0.8; }

/* =========================
   L) UTILS & ANIMATIONS
   ========================= */
.fade-enter { opacity: 0; transform: translateY(20px); animation: fadeInUp 0.5s var(--spring-bounce) forwards; }
@keyframes fadeInUp { to { opacity: 1; transform: translateY(0); } }

.skeleton {
  background: linear-gradient(90deg, var(--chip) 25%, #e6e8eb 50%, var(--chip) 75%);
  background-size: 200% 100%;
  animation: skeleton-load 1.5s infinite;
  border-radius: var(--radius-sm);
  color: transparent !important;
}
@keyframes skeleton-load { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.fab {
  position: fixed; right: var(--sp-4); bottom: var(--sp-4);
  width: 56px; height: 56px; border-radius: 20px;
  background: var(--black); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg); cursor: pointer; z-index: 100;
  transition: transform 0.3s var(--spring-bounce);
}
.fab:hover { transform: scale(1.1) rotate(90deg); }
.fab::after {
  content: 'Create'; position: absolute; right: 70px; 
  background: var(--ink); color: #fff; padding: 4px 8px; border-radius: 4px;
  font-size: 0.8rem; opacity: 0; transition: opacity 0.2s; pointer-events: none;
}
.fab:hover::after { opacity: 1; }

.toastish {
  position: fixed; bottom: var(--sp-4); left: 50%; transform: translateX(-50%) translateY(20px);
  background: rgba(16, 24, 40, 0.9); backdrop-filter: blur(8px);
  color: #fff; padding: 12px 24px; border-radius: var(--radius-full);
  font-weight: 700; font-size: var(--font-sm); z-index: 1000;
  opacity: 0; pointer-events: none; transition: all 0.4s var(--spring-bounce);
  box-shadow: var(--shadow-lg);
}
.toastish.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.form-control:focus {
  border-color: var(--accent);
  box-shadow: var(--glow-focus);
}

/* Mobile Tweaks */
.social-btn-mobile {
  position: fixed; right: var(--sp-4); bottom: 100px; /* Over FAB */
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--line);
  color: var(--accent); box-shadow: var(--shadow-md);
  display: flex; align-items: center; justify-content: center;
  z-index: 90; display: none;
}
@media (max-width: 991.98px) {
  .social-btn-mobile { display: flex; }
}