/* TRENDS TODAY - Styles */

  /* ===== ZEBULON FONT ===== */
  @font-face {
    font-family: 'Zebulon Condensed';
    src: url('../fonts/Zebulon Condensed.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
  }
  @font-face {
    font-family: 'Zebulon Condensed';
    src: url('../fonts/Zebulon Condensed Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
  }

  /* ===== MANROPE FONT ===== */
  @font-face {
    font-family: 'Manrope';
    src: url('../fonts/Manrope-ExtraBold.ttf') format('truetype');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
  }
  @font-face {
    font-family: 'Manrope';
    src: url('../fonts/Manrope-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
  }

  * { margin: 0; padding: 0; box-sizing: border-box; }
  body { font-family: 'Josefin Sans', sans-serif; -webkit-font-smoothing: antialiased; background: #f8fafc; color: #1e293b; }
  .tracking-display { letter-spacing: -0.03em; }

  /* ===== DARK HEADER ===== */
  .site-header { background: #2a0a14; }


  /* ===== LOGO ===== */
  .logo-text {
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    color: #FFB6D9;
    letter-spacing: -0.02em;
    line-height: 1;
    user-select: none;
  }

  /* Desktop (D): centered, 80px edge-to-edge */
  .header-desktop {
    padding: 28px 24px 12px;
    text-align: center;
  }
  .header-desktop .logo-text {
    font-size: 80px;
  }
  .header-desktop-controls {
    max-width: 1280px;
    margin: 0 auto;
    padding: 8px 24px 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 24px;
  }
  .header-desktop-controls .live-label {
    font-size: 12px;
    color: rgba(255,182,217,0.45);
  }
  .header-desktop-controls .refresh-btn {
    padding: 8px 20px;
    border-radius: 999px;
    background: rgba(255,182,217,0.1);
    color: rgba(255,182,217,0.7);
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(255,182,217,0.15);
    cursor: pointer;
    transition: background 0.2s;
  }
  .header-desktop-controls .refresh-btn:hover { background: rgba(255,182,217,0.2); }

  /* Mobile (C): stacked two-line, 48px */
  .header-mobile {
    display: none;
  }

  @media (max-width: 768px) {
    .header-desktop,
    .header-desktop-controls {
      display: none;
    }
    .header-mobile {
      display: flex;
      max-width: 1280px;
      margin: 0 auto;
      padding: 24px 20px 8px;
      justify-content: space-between;
      align-items: flex-start;
    }
    .header-mobile .logo-text {
      font-size: 48px;
      line-height: 0.95;
    }
    .header-mobile .header-controls {
      padding-top: 8px;
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 10px;
    }
    .header-mobile .live-label {
      font-size: 12px;
      color: rgba(255,182,217,0.45);
    }
    .header-mobile .refresh-btn {
      padding: 8px 20px;
      border-radius: 999px;
      background: rgba(255,182,217,0.1);
      color: rgba(255,182,217,0.7);
      font-size: 12px;
      font-weight: 600;
      border: 1px solid rgba(255,182,217,0.15);
      cursor: pointer;
    }
  }

  @media (max-width: 480px) {
    .header-mobile .logo-text {
      font-size: 36px;
    }
    .header-mobile {
      padding: 20px 16px 6px;
    }
  }

  /* ===== FOLDER TABS ===== */
  .tab-bar { display: flex; flex-direction: column; gap: 0; padding: 0; position: relative; z-index: 10; }

  /* Main category tabs */
  .main-tabs { display: flex; flex-wrap: wrap; gap: 0; padding: 0 24px; background: #2a0a14; border-bottom: 1px solid rgba(203,213,225,0.1); }
  .main-tab {
    padding: 14px 24px 16px;
    font-family: 'Josefin Sans', sans-serif;
    font-size: 16px;
    font-weight: 300;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.25s ease;
    border: none;
    border-bottom: 3px solid transparent;
    color: rgba(255,182,217,0.5);
    background: transparent;
    white-space: nowrap;
  }
  .main-tab:hover:not(.active) { color: #FFB6D9; }
  .main-tab.active { color: #FFB6D9; font-weight: 500; border-bottom-color: #FFB6D9; }

  /* Subtab rows */
  .sub-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 24px; background: #2a0a14; }
  .sub-tabs.active { display: flex; }

  /* Folder tabs (subtabs) */
  .folder-tab {
    padding: 10px 20px 12px;
    border-radius: 12px 12px 0 0;
    font-family: 'Josefin Sans', sans-serif;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid transparent;
    border-bottom: none;
    position: relative;
    bottom: -1px;
    color: rgba(255,182,217,0.45);
    background: #3d1525;
    white-space: nowrap;
  }
  .folder-tab:hover:not(.active) { background: #4d1f30; color: rgba(255,182,217,0.7); }
  .folder-tab.active { font-weight: 700; }

  /* Tab colour themes — active states */


  .folder-tab[data-tab="social"].active        { background: #eef2ff; color: #4338ca; border-color: #c7d2fe; }
  .folder-tab[data-tab="entertainment"].active  { background: #f3e8ff; color: #7c3aed; border-color: #d8b4fe; }
  .folder-tab[data-tab="news"].active           { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
  .folder-tab[data-tab="fashion"].active        { background: #fce7f3; color: #9d174d; border-color: #f9a8d4; }
  .folder-tab[data-tab="beauty"].active         { background: #fdf2f8; color: #be185d; border-color: #f9a8d4; }
  .folder-tab[data-tab="sports"].active         { background: #eff6ff; color: #1e40af; border-color: #93c5fd; }
  .folder-tab[data-tab="food"].active           { background: #fff7ed; color: #9a3412; border-color: #fdba74; }
  .folder-tab[data-tab="furbabies"].active      { background: #fef2f2; color: #991b1b; border-color: #fca5a5; }
  .folder-tab[data-tab="travel"].active         { background: #ecfdf5; color: #065f46; border-color: #6ee7b7; }
  .folder-tab[data-tab="mumtok"].active         { background: #fdf4ff; color: #86198f; border-color: #e879f9; }
  .folder-tab[data-tab="news"].active             { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
  .folder-tab[data-tab="australia"].active       { background: #fffbeb; color: #92400e; border-color: #fbbf24; }
  .folder-tab[data-tab="drinks"].active          { background: #fdf2f8; color: #9d174d; border-color: #f472b6; }
  .folder-tab[data-tab="health"].active          { background: #f0fdf4; color: #166534; border-color: #86efac; }
  .folder-tab[data-tab="tech"].active            { background: #eff6ff; color: #1e3a8a; border-color: #93c5fd; }
  .folder-tab[data-tab="auto"].active            { background: #fef9c3; color: #854d0e; border-color: #fde047; }
  .folder-tab[data-tab="popculture"].active    { background: #fff1f2; color: #be123c; border-color: #fda4af; }
  .folder-tab[data-tab="uk"].active               { background: #eef2ff; color: #3730a3; border-color: #a5b4fc; }
  .folder-tab[data-tab="newsletter"]              { background: #3b3f6b; color: #b8bcf8; }
  .folder-tab[data-tab="newsletter"]:hover:not(.active) { background: #4d5290; color: #d0d3fc; }
  .folder-tab[data-tab="newsletter"].active       { background: #eef0ff; color: #4338ca; border-color: #818cf8; }

  /* Tab content panels */
  .tab-panel { display: none; }
  .tab-panel.active { display: block; }

  /* Panel top border + gradient matches active tab */
  .panel-wrapper { border-top: 1px solid rgba(0,0,0,0.06); min-height: 80vh; }
  .panel-wrapper[data-active="entertainment"] { border-color: #d8b4fe; background: linear-gradient(180deg, #f3e8ff 0%, #f8fafc 140px); }
  .panel-wrapper[data-active="news"]          { border-color: #fcd34d; background: linear-gradient(180deg, #fef3c7 0%, #f8fafc 140px); }
  .panel-wrapper[data-active="fashion"]       { border-color: #f9a8d4; background: linear-gradient(180deg, #fce7f3 0%, #f8fafc 140px); }
  .panel-wrapper[data-active="sports"]        { border-color: #93c5fd; background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 140px); }
  .panel-wrapper[data-active="food"]          { border-color: #fdba74; background: linear-gradient(180deg, #fff7ed 0%, #f8fafc 140px); }
  .panel-wrapper[data-active="furbabies"]    { border-color: #fca5a5; background: linear-gradient(180deg, #fef2f2 0%, #f8fafc 140px); }
  .panel-wrapper[data-active="travel"]       { border-color: #6ee7b7; background: linear-gradient(180deg, #ecfdf5 0%, #f8fafc 140px); }
  .panel-wrapper[data-active="mumtok"]      { border-color: #e879f9; background: linear-gradient(180deg, #fdf4ff 0%, #f8fafc 140px); }
  .panel-wrapper[data-active="australia"]   { border-color: #fbbf24; background: linear-gradient(180deg, #fffbeb 0%, #f8fafc 140px); }
  .panel-wrapper[data-active="drinks"]      { border-color: #f472b6; background: linear-gradient(180deg, #fdf2f8 0%, #f8fafc 140px); }
  .panel-wrapper[data-active="health"]     { border-color: #86efac; background: linear-gradient(180deg, #f0fdf4 0%, #f8fafc 140px); }
  .panel-wrapper[data-active="tech"]       { border-color: #93c5fd; background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 140px); }
  .panel-wrapper[data-active="auto"]       { border-color: #fde047; background: linear-gradient(180deg, #fef9c3 0%, #f8fafc 140px); }
  .panel-wrapper[data-active="popculture"] { border-color: #fda4af; background: linear-gradient(180deg, #fff1f2 0%, #f8fafc 140px); }
  .panel-wrapper[data-active="uk"]        { border-color: #a5b4fc; background: linear-gradient(180deg, #eef2ff 0%, #f8fafc 140px); }
  .panel-wrapper[data-active="beauty"]    { border-color: #f9a8d4; background: linear-gradient(180deg, #fdf2f8 0%, #f8fafc 140px); }
  .panel-wrapper[data-active="social"]    { border-color: #c7d2fe; background: linear-gradient(180deg, #eef2ff 0%, #f8fafc 140px); }
  .panel-wrapper[data-active="newsletter"] { border-color: #818cf8; background: linear-gradient(180deg, #eef0ff 0%, #f8fafc 140px); }

  /* ===== CARDS & ROWS ===== */
  .card { background: #ffffff; border: 1px solid rgba(0,0,0,0.07); border-radius: 16px; transition: all 0.3s ease; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
  .card:hover { border-color: rgba(0,0,0,0.12); box-shadow: 0 8px 40px rgba(0,0,0,0.08); }

  /* Equalize two-column grid heights */
  #viralGridL, #viralGridR,
  #celebNewsGrid1, #celebNewsGrid2,
  #popcultureCalendarGridL, #popcultureCalendarGridR { min-height: 100%; }

  /* Equal-height card grids */
  .grid { align-items: stretch; }
  .grid > .card { display: flex; flex-direction: column; height: 100%; }
  .grid > .card > .p-5, .grid > .card > div:last-child { flex: 1; }
  .grid > .space-y-0, .grid > .space-y-1 { display: flex; flex-direction: column; }
  .grid > a.card, .grid > div.card { display: flex; flex-direction: column; height: 100%; }
  .grid > a.card > .p-4, .grid > a.card > div:last-child { flex: 1; }
  .grid > .card .space-y-2 { flex: 1; display: flex; flex-direction: column; }
  .grid > .card .space-y-2 > a, .grid > .card .space-y-2 > div { flex-shrink: 0; }
  .badge { padding: 3px 10px; border-radius: 100px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; display: inline-flex; align-items: center; border: 1px solid rgba(0,0,0,0.1); }

  /* ===== BADGE COLOUR OVERRIDES — explicit CSS, no Tailwind dependency ===== */
  .badge.bg-pink-100    { background-color: #fce7f3 !important; border-color: #f9a8d4; }
  .badge.bg-violet-100  { background-color: #ede9fe !important; border-color: #c4b5fd; }
  .badge.bg-sky-100     { background-color: #e0f2fe !important; border-color: #7dd3fc; }
  .badge.bg-red-100     { background-color: #fee2e2 !important; border-color: #fca5a5; }
  .badge.bg-amber-100   { background-color: #fef3c7 !important; border-color: #fcd34d; }
  .badge.bg-orange-100  { background-color: #ffedd5 !important; border-color: #fdba74; }
  .badge.bg-emerald-100 { background-color: #d1fae5 !important; border-color: #6ee7b7; }
  .badge.bg-indigo-100  { background-color: #e0e7ff !important; border-color: #a5b4fc; }
  .badge.bg-purple-100  { background-color: #f3e8ff !important; border-color: #c084fc; }
  .badge.bg-blue-100    { background-color: #dbeafe !important; border-color: #93c5fd; }
  .badge.bg-cyan-100    { background-color: #cffafe !important; border-color: #67e8f9; }
  .badge.bg-green-100   { background-color: #dcfce7 !important; border-color: #86efac; }
  .badge.bg-slate-100   { background-color: #f1f5f9 !important; border-color: #cbd5e1; }
  .badge.bg-rose-100    { background-color: #ffe4e6 !important; border-color: #fda4af; }
  .badge.bg-yellow-100  { background-color: #fef9c3 !important; border-color: #fde047; }
  .badge.bg-teal-100    { background-color: #ccfbf1 !important; border-color: #5eead4; }
  .badge.bg-lime-100    { background-color: #ecfccb !important; border-color: #bef264; }
  .badge.bg-fuchsia-100 { background-color: #fae8ff !important; border-color: #e879f9; }

  .badge.text-pink-500    { color: #ec4899 !important; }
  .badge.text-violet-500  { color: #8b5cf6 !important; }
  .badge.text-sky-500     { color: #0ea5e9 !important; }
  .badge.text-red-500     { color: #ef4444 !important; }
  .badge.text-amber-600   { color: #d97706 !important; }
  .badge.text-orange-500  { color: #f97316 !important; }
  .badge.text-orange-600  { color: #ea580c !important; }
  .badge.text-emerald-500 { color: #10b981 !important; }
  .badge.text-emerald-600 { color: #059669 !important; }
  .badge.text-indigo-500  { color: #6366f1 !important; }
  .badge.text-indigo-600  { color: #4f46e5 !important; }
  .badge.text-purple-500  { color: #a855f7 !important; }
  .badge.text-blue-500    { color: #3b82f6 !important; }
  .badge.text-blue-600    { color: #2563eb !important; }
  .badge.text-cyan-600    { color: #0891b2 !important; }
  .badge.text-green-600   { color: #16a34a !important; }
  .badge.text-slate-500   { color: #64748b !important; }
  .badge.text-slate-600   { color: #475569 !important; }
  .badge.text-rose-500    { color: #f43f5e !important; }
  .pulse-dot { width: 8px; height: 8px; border-radius: 50%; animation: pulse 2s infinite; }
  .trend-row { background: #f8fafc; border-radius: 12px; transition: all 0.2s ease; }
  .trend-row:not(.flex) { display: flex; flex-direction: column; }
  .trend-row.flex { flex-direction: row; }
  .trend-row:hover { background: #f1f5f9; }

  /* Equal-height trend rows — JS (equalizeViralRows) sets min-height on each row.
     We use display:flex column here instead of CSS grid because grid-auto-rows: 1fr
     conflicts with the JS-set min-height and causes intermittent mis-alignment when
     web fonts finish loading after the initial measurement pass. */
  .equal-rows { display: flex !important; flex-direction: column !important; gap: 4px !important; }
  .equal-rows > .trend-row { flex: 0 0 auto; }

  /* === Viral Trends grid: equal-height boxes === */
  /* Sized in JS (loadViralTrends → equalizeViralRows) to match the tallest row
     so every grey box is the natural size of the longest caption — no more, no less. */
  #viralGridL > .trend-row,
  #viralGridR > .trend-row {
    box-sizing: border-box;
  }

  /* ===== ANIMATIONS ===== */
  @keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
  @keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
  .fade-in { animation: fadeIn 0.4s ease-out forwards; }
  .section-divider { height: 1px; background: linear-gradient(90deg, transparent, rgba(0,0,0,0.06), transparent); margin: 0.5rem 0; }

  /* ===== PANTONE SWATCH ===== */
  .pantone-swatch { border-radius: 12px; overflow: hidden; border: 1px solid rgba(0,0,0,0.08); transition: all 0.3s ease; }
  .pantone-swatch:hover { box-shadow: 0 8px 30px rgba(0,0,0,0.1); transform: translateY(-2px); }
  .pantone-swatch .swatch-color { height: 100px; }
  .pantone-swatch .swatch-info { background: #fff; padding: 12px 14px; }

  /* ===== IMAGE CARD ===== */
  .img-card { border-radius: 12px; overflow: hidden; border: 1px solid rgba(0,0,0,0.08); transition: all 0.3s ease; background: #fff; }
  .img-card:hover { box-shadow: 0 8px 30px rgba(0,0,0,0.1); transform: translateY(-2px); }
  .img-card img { width: 100%; height: 140px; object-fit: cover; }
  .img-card .img-info { padding: 12px 14px; }

  /* ===== SCROLLBAR ===== */
  ::-webkit-scrollbar { width: 6px; }
  ::-webkit-scrollbar-track { background: #f8fafc; }
  ::-webkit-scrollbar-thumb { background: #c4b5fd; border-radius: 3px; }

  .nav-pill { transition: all 0.2s; border-radius: 100px; }
  .helper-box { background: rgba(168,85,247,0.06); border: 1px solid rgba(168,85,247,0.12); border-radius: 8px; }
  .helper-box p { color: rgba(126,34,206,0.7); }

  /* ===== MOBILE (<=768px) ===== */
  @media (max-width: 768px) {
    /* Header row — force compact padding, prevent logo squash */
    .site-header > div:first-child {
      padding: 10px 14px !important;
      gap: 10px !important;
    }
    .site-header > div:first-child > div {
      flex-shrink: 0 !important;
    }
    .site-header img {
      height: 36px !important;
      width: auto !important;
      max-width: 180px !important;
      object-fit: contain !important;
    }
    .site-header > div:first-child > div:last-child {
      gap: 8px !important;
    }
    .site-header > div:first-child > div:last-child button {
      padding: 6px 10px !important;
      font-size: 11px !important;
    }
    #lastUpdated { display: none !important; }
    .site-header > div:first-child > div:last-child > div:first-child { display: none !important; } /* hide Live dot */

    /* Main tabs — horizontal scroll instead of wrap */
    .main-tabs {
      flex-wrap: nowrap !important;
      overflow-x: auto !important;
      overflow-y: hidden !important;
      -webkit-overflow-scrolling: touch;
      padding: 0 12px !important;
      scrollbar-width: none;
    }
    .main-tabs::-webkit-scrollbar { display: none; }
    .main-tab {
      padding: 12px 12px 14px !important;
      font-size: 13px !important;
      letter-spacing: 0.04em !important;
      flex-shrink: 0 !important;
      white-space: nowrap !important;
    }

    .sub-tabs {
      flex-wrap: nowrap !important;
      overflow-x: auto !important;
      overflow-y: hidden !important;
      -webkit-overflow-scrolling: touch;
      padding: 8px 12px !important;
      scrollbar-width: none;
    }
    .sub-tabs::-webkit-scrollbar { display: none; }
    .folder-tab {
      flex-shrink: 0 !important;
      font-size: 12px !important;
      padding: 6px 12px !important;
      white-space: nowrap !important;
    }

    main.max-w-7xl {
      padding-left: 14px !important;
      padding-right: 14px !important;
    }
  }
