/* ============================================================
     MikTok v2.0 - Professional Main Stylesheet
     Creator: Mikiyas Berhanu | Ethiopia
     ============================================================ */

  :root {
      --primary: #fe2c55;
      --primary-dark: #d4163c;
      --primary-glow: rgba(254,44,85,0.25);
      --secondary: #25f4ee;
      --secondary-dark: #1bc8c3;
      --ride-color: #f59e0b;
      --ride-dark: #d97706;
      --bg: #0f0f13;
      --bg-card: #1a1a24;
      --bg-card2: #222230;
      --bg-hover: #2a2a3a;
      --text: #f0f0f8;
      --text-muted: #aaaabd;
      --text-dim: #9292ab;
      --border: #2a2a3a;
      --border-light: #333348;
      --success: #00c67e;
      --warning: #ffb800;
      --danger: #fe2c55;
      --info: #3b82f6;
      --verified: #20d5ec;
      --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
      --radius: 14px;
      --radius-sm: 8px;
      --radius-xs: 6px;
      --radius-full: 9999px;
      --transition: 0.2s ease;
      --transition-slow: 0.4s ease;
      --shadow: 0 8px 32px rgba(0,0,0,0.5);
      --shadow-sm: 0 2px 12px rgba(0,0,0,0.3);
      --shadow-glow: 0 0 40px rgba(254,44,85,0.15);
      --navbar-h: 64px;
      --bottom-nav-h: 64px;
  }

  /* ---- Light Theme ---- */
  body.light-theme {
      --bg: #f5f5f8;
      --bg-card: #ffffff;
      --bg-card2: #f0f0f5;
      --bg-hover: #eaeaf5;
      --text: #12121e;
      --text-muted: #666680;
      --text-dim: #666680;
      --border: #dcdce8;
      --border-light: #e8e8f0;
      --shadow: 0 8px 32px rgba(0,0,0,0.12);
      --shadow-sm: 0 2px 12px rgba(0,0,0,0.08);
  }

  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
  body {
      background: var(--bg);
      color: var(--text);
      font-family: var(--font);
      font-size: 15px;
      line-height: 1.6;
      min-height: 100vh;
      overflow-x: hidden;
      transition: background var(--transition-slow), color var(--transition-slow);
  }
  a { color: var(--primary); text-decoration: none; transition: var(--transition); }
  a:hover { opacity: 0.85; }
  img { max-width: 100%; display: block; }

  /* ---- Scrollbar ---- */
  ::-webkit-scrollbar { width: 4px; height: 4px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }
  ::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

  /* ---- Buttons ---- */
  .btn {
      display: inline-flex; align-items: center; gap: 8px;
      padding: 10px 22px; border-radius: var(--radius);
      font-size: 14px; font-weight: 600; cursor: pointer;
      border: none; transition: var(--transition); white-space: nowrap;
      text-decoration: none; letter-spacing: 0.01em;
      position: relative; overflow: hidden;
  }
  .btn::after {
      content: ''; position: absolute; inset: 0;
      background: rgba(255,255,255,0); transition: var(--transition);
  }
  .btn:hover::after { background: rgba(255,255,255,0.08); }
  .btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; box-shadow: 0 4px 15px var(--primary-glow); }
  .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px var(--primary-glow); opacity: 1; }
  .btn-secondary { background: linear-gradient(135deg, var(--secondary), var(--secondary-dark)); color: #000; }
  .btn-ride { background: linear-gradient(135deg, var(--ride-color), var(--ride-dark)); color: #fff; box-shadow: 0 4px 15px rgba(245,158,11,0.3); }
  .btn-ride:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(245,158,11,0.4); opacity: 1; }
  .btn-outline { background: transparent; color: var(--text); border: 1.5px solid var(--border-light); }
  .btn-outline:hover { background: var(--bg-hover); border-color: var(--text-muted); }
  .btn-danger { background: linear-gradient(135deg, #fe2c55, #c41a3d); color: #fff; }
  .btn-success { background: linear-gradient(135deg, #00c67e, #00a066); color: #fff; }
  .btn-warning { background: linear-gradient(135deg, #ffb800, #e09900); color: #000; }
  .btn-ghost { background: transparent; color: var(--text-muted); }
  .btn-ghost:hover { background: var(--bg-hover); color: var(--text); }
  .btn-glass { background: rgba(255,255,255,0.07); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.12); color: var(--text); }
  .btn-lg { padding: 14px 30px; font-size: 16px; }
  .btn-sm { padding: 7px 16px; font-size: 13px; border-radius: var(--radius-sm); }
  .btn-xs { padding: 4px 10px; font-size: 12px; border-radius: var(--radius-xs); }
  .btn-upload { background: var(--bg-card2); border: 1.5px solid var(--border); color: var(--text); }
  .w-full { width: 100%; justify-content: center; }

  /* ---- Form Controls ---- */
  .form-control, .form-group input, .form-group textarea, .form-group select {
      width: 100%; background: var(--bg-card2); color: var(--text);
      border: 1.5px solid var(--border); border-radius: var(--radius-sm);
      padding: 12px 16px; font-size: 15px; font-family: var(--font);
      transition: var(--transition);
  }
  .form-control:focus, .form-group input:focus, .form-group textarea:focus, .form-group select:focus {
      outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow);
      background: var(--bg-card);
  }
  .form-group { margin-bottom: 20px; }
  .form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
  .char-count { font-size: 12px; color: var(--text-muted); float: right; }
  .form-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
  .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

  .input-group { position: relative; display: flex; align-items: center; }
  .input-group input { padding-left: 46px; flex: 1; }
  .input-prefix { position: absolute; left: 14px; color: var(--text-muted); z-index: 1; font-size: 16px; }
  .toggle-pw { position: absolute; right: 14px; background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; }
  .toggle-pw:hover { color: var(--text); }

  /* ---- Alerts ---- */
  .alert { padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 16px; display: flex; align-items: center; gap: 12px; font-weight: 500; font-size: 14px; }
  .alert i { font-size: 18px; flex-shrink: 0; }
  .alert-error { background: rgba(254,44,85,0.1); border: 1px solid rgba(254,44,85,0.3); color: #ff6b8a; }
  .alert-success { background: rgba(0,198,126,0.1); border: 1px solid rgba(0,198,126,0.3); color: #00c67e; }
  .alert-warning { background: rgba(255,184,0,0.1); border: 1px solid rgba(255,184,0,0.3); color: #ffb800; }
  .alert-info { background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.3); color: #60a5fa; }

  /* ---- Badges ---- */
  .badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: var(--radius-full); font-size: 11px; font-weight: 700; letter-spacing: 0.03em; }
  .badge-user { background: var(--bg-hover); color: var(--text-muted); }
  .badge-admin { background: rgba(254,44,85,0.2); color: #ff6b8a; }
  .badge-super_admin { background: rgba(255,184,0,0.2); color: var(--warning); }
  .badge-active { background: rgba(0,198,126,0.2); color: var(--success); }
  .badge-pending { background: rgba(255,184,0,0.2); color: var(--warning); }
  .badge-banned { background: rgba(254,44,85,0.2); color: var(--danger); }
  .badge-primary { background: var(--primary-glow); color: var(--primary); }
  .badge-ride { background: rgba(245,158,11,0.2); color: var(--ride-color); }

  /* ---- Spinner ---- */
  .spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid rgba(255,255,255,0.2); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }

  /* ---- Cards ---- */
  .card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
  .card-hover { transition: var(--transition); }
  .card-hover:hover { border-color: var(--border-light); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
  .card-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; }

  /* ---- NAVBAR ---- */
  .navbar {
      position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
      height: var(--navbar-h);
      background: rgba(15,15,19,0.92);
      backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
      border-bottom: 1px solid var(--border);
      transition: var(--transition);
  }
  body.light-theme .navbar { background: rgba(245,245,248,0.92); }
  .nav-inner {
      max-width: 1400px; margin: 0 auto;
      display: flex; align-items: center; gap: 16px;
      height: 100%; padding: 0 24px;
  }
  .nav-logo { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 20px; flex-shrink: 0; }
  .nav-logo-img { width: 34px; height: 34px; border-radius: 10px; }
  .logo-text { background: linear-gradient(135deg, #fe2c55, #ff6b8a); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

  .nav-search { flex: 1; max-width: 400px; margin: 0 16px; }
  .nav-search form { position: relative; }
  .nav-search input {
      width: 100%; background: var(--bg-card2); border: 1.5px solid var(--border);
      border-radius: var(--radius-full); padding: 9px 44px 9px 18px;
      color: var(--text); font-size: 14px; font-family: var(--font);
      transition: var(--transition);
  }
  .nav-search input:focus { outline: none; border-color: var(--primary); background: var(--bg-card); box-shadow: 0 0 0 3px var(--primary-glow); }
  .nav-search button { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 15px; }

  /* Nav links */
  .nav-links { display: flex; align-items: center; gap: 6px; }
  .nav-link {
      display: flex; align-items: center; gap: 6px;
      padding: 8px 14px; border-radius: var(--radius-sm);
      font-size: 13px; font-weight: 600; color: var(--text-muted);
      transition: var(--transition);
  }
  .nav-link:hover { background: var(--bg-hover); color: var(--text); opacity: 1; }
  .nav-link.ride-link { color: var(--ride-color); }
  .nav-link.ride-link:hover { background: rgba(245,158,11,0.1); }

  .nav-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
  .btn-upload { padding: 8px 16px; font-size: 13px; border-radius: var(--radius-sm); }

  .nav-icon {
      position: relative; width: 38px; height: 38px;
      display: flex; align-items: center; justify-content: center;
      border-radius: var(--radius-sm); background: var(--bg-card2);
      border: 1px solid var(--border); color: var(--text); font-size: 17px;
      transition: var(--transition); cursor: pointer;
  }
  .nav-icon:hover { background: var(--bg-hover); border-color: var(--border-light); color: var(--primary); opacity: 1; }
  .nav-icon .badge { position: absolute; top: -4px; right: -4px; padding: 0; width: 18px; height: 18px; background: var(--primary); color: #fff; border-radius: 50%; font-size: 10px; display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg); }

  .nav-avatar-wrap { position: relative; }
  .nav-avatar { width: 36px; height: 36px; border-radius: 50%; cursor: pointer; object-fit: cover; border: 2px solid var(--border); transition: var(--transition); }
  .nav-avatar:hover { border-color: var(--primary); }

  /* Theme toggle */
  .theme-toggle {
      width: 38px; height: 38px; border-radius: var(--radius-sm);
      background: var(--bg-card2); border: 1px solid var(--border);
      color: var(--text-muted); cursor: pointer; display: flex;
      align-items: center; justify-content: center; font-size: 17px;
      transition: var(--transition);
  }
  .theme-toggle:hover { color: var(--warning); border-color: var(--warning); background: rgba(255,184,0,0.1); }

  /* Dropdown */
  .dropdown-menu {
      position: absolute; right: 0; top: calc(100% + 10px);
      background: var(--bg-card); border: 1px solid var(--border);
      border-radius: var(--radius); padding: 8px;
      min-width: 200px; z-index: 2000;
      box-shadow: var(--shadow);
      opacity: 0; visibility: hidden; transform: translateY(-8px);
      transition: var(--transition);
  }
  .dropdown-menu.open { opacity: 1; visibility: visible; transform: translateY(0); }
  .dropdown-menu a, .dropdown-menu button {
      display: flex; align-items: center; gap: 12px;
      padding: 10px 14px; border-radius: var(--radius-sm);
      font-size: 14px; color: var(--text);
      transition: var(--transition); width: 100%; text-align: left;
      border: none; background: none; cursor: pointer;
  }
  .dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--bg-hover); opacity: 1; }
  .dropdown-menu hr { border: none; border-top: 1px solid var(--border); margin: 6px 0; }
  .dropdown-menu i { width: 18px; color: var(--text-muted); }

  /* Hamburger */
  .hamburger { display: none; background: none; border: none; color: var(--text); font-size: 22px; cursor: pointer; padding: 4px; }

  /* ---- BOTTOM NAV ---- */
  .bottom-nav {
      position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;
      display: none; height: var(--bottom-nav-h);
      background: rgba(15,15,19,0.97);
      backdrop-filter: blur(20px);
      border-top: 1px solid var(--border);
      padding: 0 8px 8px;
  }
  body.light-theme .bottom-nav { background: rgba(245,245,248,0.97); }
  .bn-item {
      flex: 1; display: flex; flex-direction: column; align-items: center;
      justify-content: center; gap: 3px; color: var(--text-muted);
      font-size: 10px; font-weight: 600; transition: var(--transition);
      padding: 6px 2px; border-radius: var(--radius-sm); position: relative;
      text-decoration: none;
  }
  .bn-item i { font-size: 20px; }
  .bn-item.active { color: var(--primary); }
  .bn-item.active i { filter: drop-shadow(0 0 6px var(--primary)); }
  .bn-item:hover { color: var(--text); }

  .bn-upload .upload-circle {
      width: 44px; height: 44px; border-radius: var(--radius-sm);
      background: linear-gradient(135deg, var(--primary), var(--primary-dark));
      display: flex; align-items: center; justify-content: center;
      color: #fff; font-size: 22px; box-shadow: 0 4px 15px var(--primary-glow);
      margin-top: -10px;
  }

  .bn-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 2px solid transparent; }
  .bn-item.active .bn-avatar { border-color: var(--primary); }
  .badge-sm { position: absolute; top: 2px; right: 6px; width: 16px; height: 16px; background: var(--primary); color: #fff; border-radius: 50%; font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

  /* ---- PAGE WRAPPER ---- */
  .page-wrapper { padding-top: var(--navbar-h); min-height: 100vh; }

  /* ---- VIDEO FEED ---- */
  .feed-layout { max-width: 700px; margin: 0 auto; padding: 20px 16px 100px; }

  .feed-tabs { display: flex; align-items: center; gap: 4px; margin-bottom: 20px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px; }
  .feed-tab { flex: 1; text-align: center; padding: 9px 16px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; color: var(--text-muted); transition: var(--transition); cursor: pointer; }
  .feed-tab.active { background: var(--primary); color: #fff; }
  .feed-tab:hover:not(.active) { background: var(--bg-hover); color: var(--text); }

  /* Stories bar */
  .stories-bar { display: flex; gap: 14px; overflow-x: auto; padding: 4px 0 16px; scrollbar-width: none; margin-bottom: 4px; }
  .stories-bar::-webkit-scrollbar { display: none; }
  .story-item { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; flex-shrink: 0; }
  .story-ring {
      width: 62px; height: 62px; border-radius: 50%;
      padding: 3px;
      background: linear-gradient(135deg, var(--primary), var(--secondary));
      position: relative;
  }
  .story-ring.viewed { background: var(--border); }
  .story-ring img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 2px solid var(--bg); }
  .story-add-btn {
      width: 62px; height: 62px; border-radius: 50%;
      background: var(--bg-card2); border: 2px dashed var(--border-light);
      display: flex; align-items: center; justify-content: center;
      font-size: 22px; color: var(--text-muted); cursor: pointer;
      transition: var(--transition);
  }
  .story-add-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-glow); }
  .story-name { font-size: 11px; color: var(--text-muted); text-align: center; max-width: 62px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Video Items */
  .video-item { margin-bottom: 24px; }
  .video-wrapper {
      position: relative; border-radius: var(--radius);
      overflow: hidden; background: #0a0a0f;
      box-shadow: var(--shadow-sm);
      border: 1px solid var(--border);
  }
  .feed-video {
      width: 100%; max-height: 580px; display: block;
      object-fit: cover; background: #0a0a0f;
  }
  .video-tap-area { position: absolute; inset: 0; z-index: 2; }
  .play-icon-overlay {
      position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
      width: 64px; height: 64px; background: rgba(0,0,0,0.6);
      border-radius: 50%; display: flex; align-items: center; justify-content: center;
      font-size: 28px; color: #fff; z-index: 3; opacity: 0; pointer-events: none;
      transition: opacity 0.2s;
  }
  .video-overlay {
      position: absolute; bottom: 0; left: 0; right: 0; z-index: 4;
      background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 100%);
      display: flex; align-items: flex-end; justify-content: space-between;
      padding: 16px;
  }
  .video-info { flex: 1; padding-right: 12px; }
  .video-author { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
  .author-avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,0.5); }
  .author-name { font-weight: 700; font-size: 15px; color: #fff; }
  .verified-icon { color: var(--verified); margin-left: 4px; font-size: 13px; }
  .follow-btn-inline {
      padding: 6px 14px; border-radius: var(--radius-full);
      background: var(--primary); color: #fff; border: none;
      font-size: 12px; font-weight: 700; cursor: pointer;
      transition: var(--transition); margin-left: auto;
  }
  .follow-btn-inline.following { background: transparent; border: 1.5px solid rgba(255,255,255,0.7); }
  .video-desc { font-size: 14px; color: rgba(255,255,255,0.92); margin-bottom: 8px; line-height: 1.5; }
  .video-sound { display: flex; align-items: center; gap: 6px; font-size: 13px; color: rgba(255,255,255,0.75); }
  .video-stats-bottom { display: flex; gap: 14px; font-size: 12px; color: rgba(255,255,255,0.6); margin-top: 6px; }

  /* Action Buttons */
  .video-actions { display: flex; flex-direction: column; align-items: center; gap: 16px; flex-shrink: 0; }
  .action-btn {
      display: flex; flex-direction: column; align-items: center; gap: 4px;
      background: none; border: none; color: #fff; cursor: pointer;
      font-size: 15px; transition: var(--transition); padding: 4px;
  }
  .action-btn i { font-size: 28px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); }
  .action-count { font-size: 12px; font-weight: 700; }
  .action-btn.liked i { color: var(--primary); filter: drop-shadow(0 0 8px var(--primary)); }
  .action-btn.saved i { color: var(--warning); }
  .action-btn:hover { transform: scale(1.15); }

  .sound-disc {
      width: 44px; height: 44px; border-radius: 50%;
      border: 3px solid rgba(255,255,255,0.6);
      animation: spinDisc 4s linear infinite;
      overflow: hidden; cursor: pointer;
  }
  .sound-disc img { width: 100%; height: 100%; object-fit: cover; }
  @keyframes spinDisc { to { transform: rotate(360deg); } }
  .paused .sound-disc { animation-play-state: paused; }

  /* Progress bar */
  .video-progress { position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: rgba(255,255,255,0.2); z-index: 5; }
  .progress-bar { height: 100%; background: var(--primary); width: 0%; transition: width 0.1s linear; }

  /* ---- Comments Modal ---- */
  .comments-modal {
      position: fixed; inset: 0; z-index: 5000; pointer-events: none;
      display: flex; align-items: flex-end; justify-content: center;
  }
  .comments-modal.open { pointer-events: all; }
  .comments-modal::before { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,0.6); opacity: 0; transition: var(--transition); backdrop-filter: blur(4px); }
  .comments-modal.open::before { opacity: 1; }
  .comments-panel {
      position: relative; width: 100%; max-width: 700px;
      background: var(--bg-card); border-radius: var(--radius) var(--radius) 0 0;
      border: 1px solid var(--border); border-bottom: none;
      height: 75vh; display: flex; flex-direction: column;
      transform: translateY(100%); transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }
  .comments-modal.open .comments-panel { transform: translateY(0); }
  .comments-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
  .comments-header span { font-weight: 700; font-size: 16px; }
  .comments-header button { background: var(--bg-hover); border: none; width: 30px; height: 30px; border-radius: 50%; color: var(--text-muted); cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; }
  .comments-list { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 16px; }
  .comment-item { display: flex; gap: 10px; }
  .comment-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
  .comment-body { flex: 1; }
  .comment-user { font-weight: 700; font-size: 13px; margin-right: 6px; color: var(--text); }
  .comment-text { font-size: 14px; color: var(--text); }
  .comment-meta { font-size: 11px; color: var(--text-muted); margin-top: 4px; display: flex; gap: 10px; }
  .comment-input-wrap { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); }
  .comment-input-wrap input { flex: 1; background: var(--bg-card2); border: 1.5px solid var(--border); border-radius: var(--radius-full); padding: 10px 16px; color: var(--text); font-size: 14px; }
  .comment-input-wrap input:focus { outline: none; border-color: var(--primary); }
  #commentSubmit { background: var(--primary); border: none; border-radius: 50%; width: 38px; height: 38px; color: #fff; cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
  #commentSubmit:hover { background: var(--primary-dark); }

  /* ---- Modals ---- */
  .modal-overlay {
      position: fixed; inset: 0; z-index: 4000;
      background: rgba(0,0,0,0.7); backdrop-filter: blur(8px);
      display: flex; align-items: center; justify-content: center; padding: 20px;
      overflow-y: auto;
      padding-top: max(20px, env(safe-area-inset-top, 0px));
      padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
  }
  .modal-box {
      background: var(--bg-card); border: 1px solid var(--border);
      border-radius: var(--radius); padding: 28px; width: 100%;
      max-width: 440px; position: relative;
      animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
      min-height: 0;
      max-height: calc(100vh - 40px);
      max-height: calc(100vh - max(20px, env(safe-area-inset-top, 0px)) - max(20px, env(safe-area-inset-bottom, 0px)));
      overflow-y: auto;
      overscroll-behavior-y: contain;
  }
  @keyframes modalIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
  .modal-close { position: absolute; right: 16px; top: 16px; background: var(--bg-hover); border: none; border-radius: 50%; width: 32px; height: 32px; cursor: pointer; color: var(--text-muted); font-size: 14px; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
  .modal-close:hover { color: var(--text); background: var(--border); }
  .modal-title { font-size: 20px; font-weight: 700; margin-bottom: 20px; }
  .modal-body.text-center { text-align: center; }

  /* Share options */
  .share-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
  .share-options a, .share-options button { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-card2); color: var(--text); font-size: 14px; font-weight: 600; transition: var(--transition); cursor: pointer; }
  .share-options a:hover, .share-options button:hover { background: var(--bg-hover); border-color: var(--border-light); opacity: 1; }
  .share-options i { font-size: 18px; }

  /* More options */
  .more-options-list { display: flex; flex-direction: column; gap: 4px; }
  .more-options-list button { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius-sm); background: none; border: none; color: var(--text); font-size: 15px; cursor: pointer; width: 100%; transition: var(--transition); }
  .more-options-list button:hover { background: var(--bg-hover); }
  .text-danger { color: var(--danger) !important; }

  /* ---- Toast ---- */
  .toast-container { position: fixed; top: 80px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
  .toast {
      display: flex; align-items: center; gap: 12px;
      padding: 14px 18px; border-radius: var(--radius-sm);
      background: var(--bg-card); border: 1px solid var(--border);
      box-shadow: var(--shadow); font-size: 14px; font-weight: 500;
      min-width: 280px; max-width: 380px;
      animation: toastIn 0.3s ease; color: var(--text);
  }
  .toast.success { border-color: var(--success); }
  .toast.error { border-color: var(--danger); }
  .toast.warning { border-color: var(--warning); }
  @keyframes toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

  /* ---- PROFILE PAGE ---- */
  .profile-page { max-width: 900px; margin: 0 auto; padding: 24px 16px 100px; }
  .profile-cover { height: 200px; border-radius: var(--radius); overflow: hidden; background: linear-gradient(135deg, var(--primary), var(--secondary)); margin-bottom: -50px; position: relative; }
  .profile-cover img { width: 100%; height: 100%; object-fit: cover; }
  .profile-header { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 60px 24px 24px; margin-bottom: 20px; }
  .profile-avatar-wrap { position: relative; display: inline-block; margin-bottom: 16px; }
  .profile-avatar { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; border: 4px solid var(--bg); box-shadow: var(--shadow-sm); }
  .profile-name { font-size: 24px; font-weight: 800; }
  .profile-username { font-size: 15px; color: var(--text-muted); margin-bottom: 12px; }
  .profile-bio { font-size: 14px; color: var(--text-muted); margin-bottom: 16px; line-height: 1.6; }
  .profile-stats { display: flex; gap: 28px; margin-bottom: 20px; }
  .stat-item { text-align: center; }
  .stat-num { font-size: 20px; font-weight: 800; }
  .stat-label { font-size: 12px; color: var(--text-muted); }
  .profile-actions { display: flex; gap: 10px; flex-wrap: wrap; }
  .profile-tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
  .profile-tab { padding: 12px 20px; font-size: 14px; font-weight: 600; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; transition: var(--transition); }
  .profile-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
  .profile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .profile-video-thumb { aspect-ratio: 9/16; border-radius: var(--radius-xs); overflow: hidden; position: relative; cursor: pointer; background: var(--bg-card2); }
  .profile-video-thumb img, .profile-video-thumb video { width: 100%; height: 100%; object-fit: cover; }
  .thumb-overlay { position: absolute; bottom: 0; left: 0; right: 0; padding: 8px; background: linear-gradient(to top, rgba(0,0,0,0.7), transparent); display: flex; align-items: center; gap: 4px; color: #fff; font-size: 13px; font-weight: 700; }

  /* ---- SEARCH PAGE ---- */
  .search-page { max-width: 900px; margin: 0 auto; padding: 20px 16px 100px; }
  .search-header { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
  .search-header form { display: flex; gap: 10px; }
  .search-results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
  .user-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 20px; text-align: center; transition: var(--transition); }
  .user-card:hover { border-color: var(--primary); transform: translateY(-2px); }
  .user-card-avatar { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; margin: 0 auto 10px; border: 2px solid var(--border); }
  .trending-tags { display: flex; flex-wrap: wrap; gap: 8px; }
  .tag-chip { background: var(--bg-card2); border: 1px solid var(--border); border-radius: var(--radius-full); padding: 6px 16px; font-size: 13px; color: var(--text); font-weight: 600; transition: var(--transition); cursor: pointer; }
  .tag-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-glow); }

  /* ---- AUTH PAGES ---- */
  .auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: radial-gradient(ellipse at 60% 40%, rgba(254,44,85,0.08), transparent 60%); }
  .auth-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 40px; width: 100%; max-width: 420px; }
  .auth-logo { text-align: center; margin-bottom: 28px; }
  .auth-logo img { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 10px; }
  .auth-logo h2 { font-size: 26px; font-weight: 800; }
  .auth-logo p { color: var(--text-muted); font-size: 14px; }
  .auth-divider { text-align: center; position: relative; margin: 20px 0; }
  .auth-divider::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--border); }
  .auth-divider span { position: relative; background: var(--bg-card); padding: 0 12px; color: var(--text-muted); font-size: 13px; }
  .auth-footer { text-align: center; margin-top: 20px; font-size: 14px; color: var(--text-muted); }

  /* ---- EMPTY STATES ---- */
  .empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
  .empty-state i { font-size: 56px; margin-bottom: 16px; opacity: 0.3; }
  .empty-state h3 { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
  .empty-state p { font-size: 15px; margin-bottom: 24px; }

  /* ---- WALLET PAGE ---- */
  .wallet-page { max-width: 800px; margin: 0 auto; padding: 24px 16px 100px; }
  .wallet-balance-card { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%); border: 1px solid rgba(59,130,246,0.3); border-radius: var(--radius); padding: 36px; margin-bottom: 24px; text-align: center; position: relative; overflow: hidden; }
  .wallet-balance-card::before { content: ''; position: absolute; top: -50%; right: -30%; width: 300px; height: 300px; background: radial-gradient(circle, rgba(254,44,85,0.2), transparent 60%); pointer-events: none; }
  .balance-label { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(255,255,255,0.6); margin-bottom: 8px; }
  .balance-amount { font-size: 48px; font-weight: 900; color: #fff; margin-bottom: 8px; }
  .balance-sub { font-size: 14px; color: rgba(255,255,255,0.5); }
  .wallet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
  .wallet-stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 20px; text-align: center; }
  .wallet-stat-num { font-size: 24px; font-weight: 800; color: var(--primary); }
  .wallet-stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

  /* ---- ADMIN ---- */
  .admin-page { max-width: 1400px; margin: 0 auto; padding: 24px 16px 40px; }
  .admin-grid { display: grid; grid-template-columns: 240px 1fr; gap: 24px; }
  .admin-sidebar { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; height: fit-content; position: sticky; top: 80px; }
  .admin-nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius-sm); color: var(--text-muted); font-size: 14px; font-weight: 600; transition: var(--transition); margin-bottom: 2px; }
  .admin-nav-item:hover, .admin-nav-item.active { background: var(--bg-hover); color: var(--text); opacity: 1; }
  .admin-nav-item.active { color: var(--primary); }
  .admin-nav-item i { width: 20px; }
  .admin-content { flex: 1; }
  .stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
  .stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 20px; display: flex; align-items: center; gap: 16px; transition: var(--transition); }
  .stat-card:hover { border-color: var(--border-light); box-shadow: var(--shadow-sm); }
  .stat-icon { width: 48px; height: 48px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
  .stat-icon.primary { background: rgba(254,44,85,0.15); color: var(--primary); }
  .stat-icon.success { background: rgba(0,198,126,0.15); color: var(--success); }
  .stat-icon.warning { background: rgba(255,184,0,0.15); color: var(--warning); }
  .stat-icon.info { background: rgba(59,130,246,0.15); color: var(--info); }
  .stat-icon.ride { background: rgba(245,158,11,0.15); color: var(--ride-color); }
  .stat-value { font-size: 26px; font-weight: 800; }
  .stat-name { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

  /* Data Table */
  .table-wrapper { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); }
  table { width: 100%; border-collapse: collapse; font-size: 14px; }
  thead { background: var(--bg-card2); }
  th { padding: 12px 16px; text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); border-bottom: 1px solid var(--border); }
  td { padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
  tr:last-child td { border-bottom: none; }
  tr:hover td { background: var(--bg-hover); }
  .table-actions { display: flex; gap: 6px; }

  /* ---- FOOTER ---- */
  .site-footer { background: var(--bg-card); border-top: 1px solid var(--border); padding: 36px 24px 90px; margin-top: 60px; }
  .footer-inner { max-width: 1000px; margin: 0 auto; text-align: center; }
  .footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; margin-bottom: 16px; }
  .footer-links a { color: var(--text-muted); font-size: 14px; transition: var(--transition); }
  .footer-links a:hover { color: var(--text); }
  .footer-ride-badge { display: inline-flex; align-items: center; gap: 8px; background: rgba(245,158,11,0.15); border: 1px solid rgba(245,158,11,0.3); border-radius: var(--radius-full); padding: 6px 16px; color: var(--ride-color); font-size: 13px; font-weight: 700; margin: 12px auto; }
  .site-footer p { color: var(--text-muted); font-size: 13px; }

  /* ---- RIDE SECTION PREVIEW ON MAIN ---- */
  .ride-promo-banner {
      background: linear-gradient(135deg, #1a1208, #2a1e08);
      border: 1px solid rgba(245,158,11,0.3);
      border-radius: var(--radius); padding: 28px;
      margin-bottom: 24px;
      display: flex; align-items: center; gap: 20px;
      position: relative; overflow: hidden;
  }
  .ride-promo-banner::before {
      content: '🚗'; position: absolute; right: 24px; top: 50%;
      transform: translateY(-50%); font-size: 80px; opacity: 0.15;
  }
  .ride-promo-content { flex: 1; }
  .ride-promo-badge { display: inline-flex; align-items: center; gap: 6px; background: rgba(245,158,11,0.2); border: 1px solid rgba(245,158,11,0.4); border-radius: var(--radius-full); padding: 4px 12px; font-size: 12px; font-weight: 700; color: var(--ride-color); margin-bottom: 10px; }
  .ride-promo-title { font-size: 22px; font-weight: 800; color: #fff; margin-bottom: 6px; }
  .ride-promo-text { font-size: 14px; color: rgba(255,255,255,0.65); margin-bottom: 16px; }

  /* ---- UPLOAD PAGE ---- */
  .upload-page { max-width: 700px; margin: 0 auto; padding: 24px 16px 100px; }
  .upload-zone { border: 2px dashed var(--border-light); border-radius: var(--radius); padding: 50px; text-align: center; cursor: pointer; transition: var(--transition); }
  .upload-zone:hover, .upload-zone.drag-over { border-color: var(--primary); background: var(--primary-glow); }
  .upload-zone i { font-size: 48px; color: var(--text-dim); margin-bottom: 16px; }
  .upload-preview-wrap { margin: 16px 0; border-radius: var(--radius-sm); overflow: hidden; max-height: 400px; text-align: center; }
  .upload-preview-wrap video, .upload-preview-wrap img { max-height: 400px; margin: 0 auto; border-radius: var(--radius-sm); }

  /* ---- LIVE ---- */
  .live-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 6px; text-transform: uppercase; letter-spacing: 0.05em; }
  .live-dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: livePulse 1s ease-in-out infinite; }
  @keyframes livePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

  /* ---- SHOP ---- */
  .products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
  .product-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: var(--transition); }
  .product-card:hover { border-color: var(--border-light); transform: translateY(-3px); box-shadow: var(--shadow-sm); }
  .product-img { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--bg-card2); }
  .product-info { padding: 16px; }
  .product-title { font-weight: 700; margin-bottom: 6px; }
  .product-price { font-size: 18px; font-weight: 800; color: var(--primary); }

  /* ---- MISC UTILITIES ---- */
  .page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
  .page-title { font-size: 24px; font-weight: 800; }
  .section-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
  .divider { height: 1px; background: var(--border); margin: 20px 0; }
  .text-center { text-align: center; }
  .text-muted { color: var(--text-muted); }
  .text-primary { color: var(--primary); }
  .text-success { color: var(--success); }
  .text-warning { color: var(--warning); }
  .text-danger { color: var(--danger); }
  .text-ride { color: var(--ride-color); }
  .fw-bold { font-weight: 700; }
  .fw-800 { font-weight: 800; }
  .d-flex { display: flex; }
  .align-center { align-items: center; }
  .gap-8 { gap: 8px; }
  .gap-12 { gap: 12px; }
  .gap-16 { gap: 16px; }
  .mt-8 { margin-top: 8px; }
  .mt-16 { margin-top: 16px; }
  .mt-24 { margin-top: 24px; }
  .mb-8 { margin-bottom: 8px; }
  .mb-16 { margin-bottom: 16px; }
  .mb-24 { margin-bottom: 24px; }
  .ms-auto { margin-left: auto; }
  .p-16 { padding: 16px; }
  .p-24 { padding: 24px; }
  .rounded { border-radius: var(--radius-sm); }
  .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* ---- RESPONSIVE ---- */
  @media (max-width: 768px) {
      .bottom-nav { display: flex; }
      .nav-search { display: none; }
      .nav-links { display: none; }
      .nav-actions .btn-upload { display: none; }
      .hamburger { display: block; }
      .page-wrapper { padding-bottom: var(--bottom-nav-h); }
      .site-footer { padding-bottom: calc(var(--bottom-nav-h) + 30px); }
      .admin-grid { grid-template-columns: 1fr; }
      .admin-sidebar { position: static; }
      .form-row { grid-template-columns: 1fr; }
      .wallet-grid { grid-template-columns: 1fr 1fr; }
      .profile-stats { gap: 18px; }
      .feed-layout { padding: 12px 8px 100px; }
  }
  @media (max-width: 480px) {
      .auth-box { padding: 28px 20px; }
      .stats-grid { grid-template-columns: 1fr 1fr; }
  }

  /* ---- STORY VIEWER ---- */
  .story-viewer-overlay {
      position: fixed; inset: 0; z-index: 9000;
      background: #000; display: flex; align-items: center; justify-content: center;
  }
  .story-viewer { width: 100%; max-width: 420px; height: 100vh; position: relative; }
  .story-media { width: 100%; height: 100%; object-fit: contain; }
  .story-progress-bar { position: absolute; top: 0; left: 0; right: 0; height: 3px; background: rgba(255,255,255,0.3); }
  .story-progress-fill { height: 100%; background: #fff; transition: width 0.1s linear; }
  .story-header { position: absolute; top: 12px; left: 0; right: 0; display: flex; align-items: center; gap: 10px; padding: 0 16px; }
  .story-user-info { display: flex; align-items: center; gap: 8px; flex: 1; }
  .story-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,0.8); }
  .story-username { color: #fff; font-weight: 700; font-size: 14px; }
  .story-time { color: rgba(255,255,255,0.6); font-size: 12px; }
  .story-close { background: rgba(0,0,0,0.5); border: none; color: #fff; border-radius: 50%; width: 32px; height: 32px; cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; }
  .story-caption { position: absolute; bottom: 40px; left: 16px; right: 16px; color: #fff; font-size: 16px; font-weight: 600; text-shadow: 0 2px 8px rgba(0,0,0,0.8); text-align: center; }
  .story-nav { position: absolute; top: 0; bottom: 0; width: 50%; }
  .story-nav-left { left: 0; }
  .story-nav-right { right: 0; }
  
/* ════════════════════════════════════════════════════
   FOLLOW SYSTEM — MikTok - 89 Upgraded UI
   ════════════════════════════════════════════════════ */

/* ── Feed inline follow button ── */
.follow-btn-inline {
    padding: 7px 16px;
    border-radius: 50px;
    border: none;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin-left: auto;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 0.02em;
    position: relative;
    overflow: hidden;
}
.follow-btn-inline:not(.following):not(.mutual) {
    background: linear-gradient(135deg, #fe2c55, #d4163c);
    color: #fff;
    box-shadow: 0 4px 15px rgba(254, 44, 85, 0.45);
}
.follow-btn-inline:not(.following):not(.mutual):hover {
    transform: scale(1.08);
    box-shadow: 0 6px 22px rgba(254, 44, 85, 0.6);
}
.follow-btn-inline.following {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: rgba(255, 255, 255, 0.85);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    box-shadow: none;
}
.follow-btn-inline.following:hover {
    background: rgba(254, 44, 85, 0.15);
    border-color: rgba(254, 44, 85, 0.5);
    color: #fe2c55;
    transform: scale(1.05);
}
.follow-btn-inline.mutual {
    background: linear-gradient(135deg, #25f4ee, #1bc8c3);
    color: #000;
    font-weight: 900;
    box-shadow: 0 4px 15px rgba(37, 244, 238, 0.35);
}
.follow-btn-inline.mutual:hover {
    transform: scale(1.06);
    box-shadow: 0 6px 22px rgba(37, 244, 238, 0.5);
}
.follow-btn-inline:disabled {
    cursor: not-allowed;
}

/* ── Profile follow button ── */
.btn-follow-off {
    background: linear-gradient(135deg, #fe2c55, #d4163c) !important;
    color: #fff !important;
    box-shadow: 0 6px 22px rgba(254, 44, 85, 0.4) !important;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}
.btn-follow-off:hover {
    transform: scale(1.04) translateY(-1px) !important;
    box-shadow: 0 10px 30px rgba(254, 44, 85, 0.55) !important;
}
.btn-follow-on {
    background: rgba(255, 255, 255, 0.08) !important;
    color: rgba(255, 255, 255, 0.8) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(10px) !important;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}
.btn-follow-on:hover {
    background: rgba(254, 44, 85, 0.12) !important;
    border-color: rgba(254, 44, 85, 0.4) !important;
    color: #fe2c55 !important;
    transform: scale(1.03) !important;
}
.btn-follow-mutual {
    background: linear-gradient(135deg, #25f4ee, #1bc8c3) !important;
    color: #000 !important;
    font-weight: 900 !important;
    box-shadow: 0 6px 22px rgba(37, 244, 238, 0.35) !important;
}

/* ── Follow animation keyframes ── */
@keyframes followPop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.18); }
    70%  { transform: scale(0.94); }
    100% { transform: scale(1); }
}
@keyframes unfollowFade {
    0%   { transform: scale(1); opacity: 1; }
    40%  { transform: scale(0.88); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* ── Follow toast styles ── */
.toast.follow-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

/* ── Friends page upgrade ── */
.friend-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-card);
    border-radius: 16px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}
.friend-card:hover {
    border-color: var(--border-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.friend-avatar {
    width: 52px; height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-light);
    flex-shrink: 0;
}
.friend-name {
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text);
}
.friend-user {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}
.fb {
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.fb-accept {
    background: linear-gradient(135deg, #fe2c55, #d4163c);
    color: #fff;
    box-shadow: 0 4px 14px rgba(254,44,85,0.4);
}
.fb-accept:hover { transform: scale(1.05); box-shadow: 0 6px 20px rgba(254,44,85,0.55); }
.fb-decline {
    background: var(--bg-card2);
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.fb-decline:hover { background: var(--bg-hover); color: var(--text); }
.fb-add {
    background: linear-gradient(135deg, #fe2c55, #d4163c);
    color: #fff;
    box-shadow: 0 4px 14px rgba(254,44,85,0.35);
}
.fb-add:hover { transform: scale(1.05); }
.fb-added {
    background: rgba(0,198,126,0.12);
    color: #00c67e;
    border: 1.5px solid rgba(0,198,126,0.3);
}
.fb-added:hover { background: rgba(0,198,126,0.2); }
.fb-unfriend {
    background: rgba(254,44,85,0.1);
    color: #fe2c55;
    border: 1px solid rgba(254,44,85,0.2);
}
.fb-unfriend:hover { background: rgba(254,44,85,0.18); }

/* ── Follow Back button style ── */
.follow-btn-inline.followback {
    background: linear-gradient(135deg, #ff9500, #e07b00);
    color: #fff;
    font-weight: 900;
    box-shadow: 0 4px 16px rgba(255, 149, 0, 0.45);
    border: none;
}
.follow-btn-inline.followback:hover {
    transform: scale(1.09);
    box-shadow: 0 7px 24px rgba(255, 149, 0, 0.62);
}

.btn-followback {
    background: linear-gradient(135deg, #ff9500, #e07b00) !important;
    color: #fff !important;
    font-weight: 900 !important;
    box-shadow: 0 6px 22px rgba(255, 149, 0, 0.4) !important;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}
.btn-followback:hover {
    transform: scale(1.04) translateY(-1px) !important;
    box-shadow: 0 10px 30px rgba(255, 149, 0, 0.55) !important;
}

/* ---- Compatibility fixes: light theme, short screens and iOS forms ---- */
/* The legacy following state uses !important; match it only in light mode.
   The more specific selector also wins over profile.php's local button skin. */
body.light-theme .btn-follow-on,
body.light-theme .follow-btn-inline.following {
    background: var(--bg-card2) !important;
    color: var(--text) !important;
    border: 1.5px solid var(--border) !important;
}
body.light-theme .btn-follow-on:hover,
body.light-theme .follow-btn-inline.following:hover {
    background: var(--primary-glow) !important;
    color: var(--primary-dark) !important;
    border-color: var(--primary) !important;
}

/* Video overlays remain dark even when the surrounding page is light. */
body.light-theme .video-overlay .follow-btn-inline.following {
    background: rgba(0, 0, 0, .45) !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, .65) !important;
}
body.light-theme .video-overlay .follow-btn-inline.following:hover {
    background: rgba(0, 0, 0, .65) !important;
    color: #fff !important;
    border-color: #fff !important;
}

/* Use the visible viewport when browser chrome changes height.
   The vh declaration above is retained for browsers without dvh support. */
@supports (height: 100dvh) {
    .modal-box {
        max-height: calc(100dvh - max(20px, env(safe-area-inset-top, 0px)) - max(20px, env(safe-area-inset-bottom, 0px)));
    }
}

@media (max-width: 768px) {
    /* Avoid Safari's focus zoom without disabling pinch-to-zoom.
       Exclude non-text controls so button/icon sizing stays unchanged. */
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
    textarea, select,
    .form-group textarea, .form-group select {
        font-size: 16px;
    }
}
