/* ================================================================
   fop-layout.css — Shared base CSS for all FunOfficePools pages
   Version 1.0 (2026-05-29)

   Includes: CSS variables, reset, global header, top nav + dropdown,
             badges, buttons, footer, bottom-ad separator, table
             utilities, Type B layout (3-col asymmetric — most pages),
             and Type A layout (content-pair + right skyscraper).

   Per-page CSS (section wrappers, pool cards, forms, tables, etc.)
   stays in each page's own <style> block.

   HOW TO USE ON A PAGE
   --------------------
   1. In <head>, add before any page-specific <style>:
        <link rel="stylesheet" href="/CSS/fop-layout.css">
   2. Set $topnav_no_styles = true before including inc_topnav.php
      (inc_page_top.php does this automatically).
   3. Use #fop-layout / #fop-left / #fop-main / #fop-right  (Type B)
      or #fop-layout-a / #fop-a-content / .fop-a-col / #fop-a-right (Type A).
   ================================================================ */

/* ================================================================
   RESET & BASE
   ================================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 13px; line-height: 1.5;
  background: var(--bg); color: var(--text);
  transition: background .25s, color .25s;
}
a { text-decoration: none; color: var(--primary); }
a:hover { text-decoration: underline; }

/* ================================================================
   CSS CUSTOM PROPERTIES — Default theme: Teal
   JS in each page overrides these vars for live theme switching.
   ================================================================ */
:root {
  --primary:     #0F766E;
  --primary-dk:  #134E4A;
  --accent:      #F59E0B;
  --comm:        #C2410C;
  --success:     #065F46;
  --bg:          #F0FDFA;
  --bg-sidebar:  #CCFBF1;
  --card:        #FFFFFF;
  --border:      #E2E8F4;
  --text:        #1E293B;
  --text-muted:  #64748B;
  --nav-bg:      #134E4A;
  --nav-active:  #FCD34D;
  --nav-act-txt: #134E4A;
  --hdr-grad:    linear-gradient(135deg,#134E4A,#0F766E);
  --sec-hdr:     linear-gradient(90deg,#0F766E,#0D9488);
  --sec-txt:     #FFFFFF;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.06);
  --shadow-md:   0 4px 14px rgba(0,0,0,.12);
  --radius:      8px;
}

body.dark {
  --bg:         #0F172A;
  --bg-sidebar: #162032;
  --card:       #1E293B;
  --border:     #334155;
  --text:       #E2E8F0;
  --text-muted: #94A3B8;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.3);
  --shadow-md:  0 4px 14px rgba(0,0,0,.45);
}
body.dark .badge-red   { background: #7F1D1D; color: #FCA5A5; }
body.dark .badge-green { background: #064E3B; color: #6EE7B7; }
body.dark .badge-blue  { background: #1E3A5F; color: #93C5FD; }
body.dark .badge-gray  { background: #334155; color: #94A3B8; }
body.dark .badge-comm  { background: #9A3412; color: #FED7AA; }
body.dark #footer       { background: #0A0F1E; }
body.dark #nav-dropdown { background: #1E293B; }

/* ================================================================
   GLOBAL HEADER
   ================================================================ */
#global-header {
  background: var(--hdr-grad);
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px; gap: 12px;
}
#logo-wrap { display: flex; align-items: center; gap: 10px;
             text-decoration: none; cursor: pointer; }
#logo-icon { width: 44px; height: 44px; border-radius: 10px;
             background: rgba(255,255,255,.15);
             display: flex; align-items: center; justify-content: center;
             font-size: 24px; }
#logo-text { font-size: 22px; font-weight: 800; color: var(--accent); letter-spacing: -.4px; }
#logo-sub  { font-size: 10px; color: rgba(255,255,255,.6); font-weight: 500; }
#tch-ad    { font-size: 11px; text-align: right; flex-shrink: 0; }
#tch-ad a  { color: rgba(255,255,255,.65); font-weight: 500; }
#tch-ad a:hover { color: #fff; text-decoration: underline; }
#tch-ad small { display: block; font-size: 9px; color: rgba(255,255,255,.4); margin-top: 1px; }

/* ================================================================
   TOP NAV
   ================================================================ */
nav {
  display: flex; align-items: stretch;
  background: var(--nav-bg); border-bottom: 2px solid rgba(0,0,0,.2);
}
#topnav {
  flex: 1; min-width: 0; padding: 0 8px;
  display: flex; gap: 2px; white-space: nowrap; align-items: stretch;
  overflow-x: auto; scrollbar-width: none;
}
#topnav::-webkit-scrollbar { display: none; }
#topnav > a {
  display: inline-block; padding: 9px 14px; flex-shrink: 0;
  color: rgba(255,255,255,.7); font-size: 12px; font-weight: 500;
  border-radius: 4px 4px 0 0;
  transition: background .15s, color .15s; text-decoration: none;
}
#topnav > a:hover  { background: rgba(255,255,255,.09); color: #fff; text-decoration: none; }
#topnav > a.active { background: var(--nav-active); color: var(--nav-act-txt); font-weight: 700; }
#topnav > a.nav-disabled { opacity: .4; cursor: default; pointer-events: none; }

/* User avatar / dropdown */
#nav-user { position: relative; display: flex; align-items: stretch; flex-shrink: 0; }
#nav-user-btn {
  display: flex; align-items: center; gap: 7px; padding: 0 14px;
  cursor: pointer; color: rgba(255,255,255,.9); font-size: 12px; font-weight: 600;
  user-select: none; border-radius: 4px 4px 0 0; transition: background .15s;
}
#nav-user-btn:hover { background: rgba(255,255,255,.09); }
.nav-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #fff; flex-shrink: 0;
}
.nav-chevron { font-size: 10px; opacity: .6; transition: transform .2s; }
#nav-user.open .nav-chevron { transform: rotate(180deg); }

#nav-dropdown {
  display: none; position: absolute; right: 0; top: 100%;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  min-width: 220px; box-shadow: var(--shadow-md); z-index: 500;
}
#nav-user.open #nav-dropdown { display: block; }

.dd-section { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.dd-section:last-child { border-bottom: none; }
.dd-label { font-size: 10px; font-weight: 700; text-transform: uppercase;
            letter-spacing: .6px; color: var(--text-muted); margin-bottom: 8px; }
.dd-swatches { display: flex; gap: 7px; flex-wrap: wrap; }
.swatch {
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; transition: transform .15s; position: relative;
}
.swatch:hover { transform: scale(1.15); }
.swatch.active { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--text); }
.swatch[title]:hover::after {
  content: attr(title); position: absolute; bottom: 28px; left: 50%;
  transform: translateX(-50%); background: #1E293B; color: #fff;
  font-size: 10px; font-weight: 600; padding: 3px 7px; border-radius: 4px;
  white-space: nowrap; pointer-events: none;
}
.swatch-locked { opacity: .4; cursor: not-allowed; position: relative; }
.swatch-locked:hover { transform: none !important; }
.swatch-locked::after {
  content: '★'; position: absolute; top: -5px; right: -5px;
  font-size: 7px; background: #F59E0B; color: #fff; border-radius: 50%;
  width: 12px; height: 12px; line-height: 12px; text-align: center; pointer-events: none;
}
.dd-mode { display: flex; gap: 6px; }
.dd-mode-btn {
  flex: 1; padding: 5px 0; border-radius: 5px; font-family: inherit;
  font-size: 11px; font-weight: 700; cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--bg-sidebar); color: var(--text-muted); transition: all .15s;
}
.dd-mode-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.dd-mode-btn-locked { opacity: .4 !important; cursor: not-allowed !important; }
.dd-link {
  display: block; padding: 9px 12px; font-size: 12px;
  color: var(--text); transition: background .15s; text-decoration: none;
}
.dd-link:hover  { background: var(--bg-sidebar); text-decoration: none; }
.dd-link.signout { color: #DC2626; font-weight: 600; }

#nav-guest { display: flex; align-items: center; gap: 8px; padding: 0 8px; }
.nav-guest-link {
  display: inline-block; padding: 5px 12px; border-radius: 5px;
  font-size: 11px; font-weight: 700; text-decoration: none; transition: filter .15s;
}
.nav-guest-link:hover { filter: brightness(1.1); text-decoration: none; }
.nav-guest-login  { background: rgba(255,255,255,.15); color: #fff; }
.nav-guest-create { background: var(--accent); color: #fff; }

#nav-premium-flash {
  display: none; font-size: 11px; color: #92400E;
  background: #FEF3C7; border: 1px solid #FCD34D; border-radius: 4px;
  padding: 5px 8px; margin-top: 6px; line-height: 1.5;
}
#nav-premium-flash a { color: #92400E; font-weight: 700; }

/* Hide legacy navmenu elements — alerts still render through navmenu.php */
#outer2, #outer3, #mobile-home-btn { display: none !important; }

/* ================================================================
   BADGES
   ================================================================ */
.badge       { display: inline-block; padding: 2px 7px; border-radius: 10px;
               font-size: 10px; font-weight: 700; white-space: nowrap; }
.badge-gold  { background: var(--accent);  color: #fff; }
.badge-red   { background: #FEE2E2;         color: #B91C1C; }
.badge-green { background: #D1FAE5;         color: #065F46; }
.badge-blue  { background: #DBEAFE;         color: #1D4ED8; }
.badge-live  { background: #EF4444;         color: #fff; }
.badge-gray  { background: #E2E8F0;         color: #64748B; }
.badge-amber { background: #FEF3C7;         color: #92400E; }
.badge-comm  { background: var(--comm);     color: #fff; }

/* ================================================================
   BUTTONS
   ================================================================ */
.btn { display: inline-block; padding: 4px 10px; border-radius: 4px; font-size: 11px;
       font-weight: bold; text-decoration: none; white-space: nowrap;
       cursor: pointer; border: none; transition: filter .15s; }
.btn:hover  { filter: brightness(1.1); text-decoration: none; }
.btn-blue,
.btn-navy   { background: var(--primary);    color: #fff; }
.btn-red    { background: #c0392b;           color: #fff; }
.btn-orange { background: var(--comm);       color: #fff; }
.btn-green  { background: #27ae60;           color: #fff; }
.btn-gray   { background: var(--text-muted); color: #fff; }
.btn-gold   { background: var(--accent);     color: #fff; }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }

/* ================================================================
   FOOTER
   ================================================================ */
#footer { background: var(--primary-dk, #134E4A); color: rgba(255,255,255,.5);
          text-align: center; padding: 16px 20px; font-size: 11px; }
#footer a { color: rgba(255,255,255,.7); }
#footer a:hover { color: #fff; }

/* ================================================================
   TABLE UTILITY
   Wrap wide tables in <div class="table-scroll-wrapper"> so they
   scroll horizontally on mobile instead of breaking the layout.
   ================================================================ */
.table-scroll-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ================================================================
   BOTTOM AD SEPARATOR
   Thick border visually separates ads from page content.
   Place inside #fop-main (Type B) or #fop-a-content (Type A),
   after all content, before closing the content div.
   ================================================================ */
#fop-bottomad { border-top: 16px solid var(--primary); text-align: center;
                padding: 12px 0 8px; margin-top: 10px; clear: both; }

/* ================================================================
   TYPE B LAYOUT — slim | wide content | slim
   Used by: yourpools.php and most pool pages (picks, standings, etc.)

   Structure:
     <div id="fop-layout">
       <div id="fop-left">   165px — donation + left skyscraper ad
       <div id="fop-main">   flex:1 — all page content + #fop-bottomad
       <div id="fop-right">  175px — available pools + right skyscraper ad

   Premium (level > 2): omit #fop-right from PHP output entirely;
   render available pools inside #fop-left below donation instead.
   ================================================================ */
#fop-layout { display: flex; flex-direction: row; align-items: flex-start;
              border-top: 1px solid var(--border); }
#fop-left   { width: 165px; flex-shrink: 0; padding: 0 3px;
              background: var(--bg-sidebar); font-size: 12px; }
#fop-main   { flex: 1; min-width: 0; padding: 0 6px; }
#fop-right  { width: 175px; flex-shrink: 0; padding: 0 3px;
              background: var(--bg-sidebar); }

/* Landscape 640–959px: right col hides */
@media (max-width: 959px) {
    #fop-layout { flex-wrap: wrap; }
    #fop-right  { display: none; }
}
/* Portrait ≤639px: left col also hides */
@media (max-width: 639px) {
    #fop-layout { flex-direction: column; align-items: stretch; }
    #fop-left   { display: none; }
    #fop-right  { display: none; }
    #fop-main   { width: 100%; box-sizing: border-box; padding: 0 4px; }
    body         { overflow-x: hidden; }
}

/* Left column nav links */
.fop-left-title { background: var(--primary); color: #fff; padding: 5px 8px;
                  font-weight: bold; font-size: 11px; margin: 6px 0 2px; border-radius: 3px; }
#fop-left a { display: block; padding: 4px 8px; color: var(--text);
              text-decoration: none; font-size: 11px; }
#fop-left a:hover { background: var(--border); border-radius: 3px; }

/* Donation box — used in left/right columns on all new-design pages */
.donation-box { background: var(--card); border: 1px solid var(--border);
                border-radius: 6px; padding: 10px; font-size: 11px;
                text-align: center; color: var(--text-muted); margin-bottom: 12px; }
.donate-headline { font-weight: 700; color: #E8500A; font-size: 12px; margin-bottom: 5px; }
.donate-note { font-size: 10px; color: var(--text-muted); margin-top: 6px; line-height: 1.4; }
.sidebar-label { font-size: 10px; font-weight: 700; color: var(--text-muted);
                 text-transform: uppercase; letter-spacing: .6px;
                 padding: 4px 0; border-bottom: 1px solid var(--border); margin-bottom: 8px; }

/* Available Pools box — used in both #fop-left (premium) and #fop-right (non-premium) */
.prevpools { margin-top: 8px; }
.prevpools-box { border: 1px solid var(--primary); border-radius: 5px; overflow: hidden; }
.prevpools-hdr { background: var(--primary); color: #fff; padding: 5px 8px;
                 font-weight: bold; font-size: 11px; }
.prevpools-list { margin: 6px 4px 8px 20px; padding: 0; list-style: disc; }
.prevpools-list li { padding: 2px 0; font-size: 11px; color: var(--text); }

/* ================================================================
   TYPE A LAYOUT — content pair + slim right skyscraper
   Used by: index.php (home page)

   Structure:
     <div id="fop-layout-a">
       <div id="fop-a-content">       flex:1 — padding wrapper, block container
         <div id="fop-a-pair">        flex row — the two side-by-side panels only
           <div class="fop-a-col">   left content panel (e.g. Your Pools)
           <div class="fop-a-col">   right content panel (e.g. Games/Coming Soon)
         </div><!-- /fop-a-pair -->
         <!-- news + #fop-bottomad go here, spanning full content width -->
       </div><!-- /fop-a-content -->
       <div id="fop-a-right">         190px — right skyscraper ad

   Desktop ≥960px:     fop-a-pair columns side by side; fop-a-right visible
   Landscape 640–959px: fop-a-right stays; fop-a-pair stacks to single column
   Portrait ≤639px:    fop-a-right hides; single stacked column
   ================================================================ */
#fop-layout-a  { display: flex; flex-direction: row; align-items: flex-start; }
#fop-a-content { flex: 1; min-width: 0; padding: 12px 16px; }
#fop-a-pair    { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.fop-a-col     { flex: 1; min-width: 0; }
#fop-a-right   { width: 190px; flex-shrink: 0; padding: 10px 8px;
                 background: var(--bg-sidebar); border-left: 1px solid var(--border); }

/* Landscape 640–959px: keep right skyscraper; collapse content pair to single column */
@media (max-width: 959px) {
    #fop-a-pair { flex-direction: column; }
    .fop-a-col  { width: 100% !important; flex: none; }
}
/* Portrait ≤639px: right skyscraper hides */
@media (max-width: 639px) {
    #fop-a-right   { display: none; }
    #fop-a-content { padding: 8px 6px; }
    body            { overflow-x: hidden; }
}
