/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Per-page title heading (see ApplicationHelper#page_title) -- matches legacy's #pageTitle exactly. */
#pageTitle {
  font-size: 18px;
  font-weight: bold;
  margin-top: 5px;
  margin-bottom: 10px;
  color: var(--ptfg-navy);
}

/* Bootstrap's default placeholder color (rgba(33, 37, 41, .75)) reads almost as dark as real input text --
   lighten it so placeholder hints are clearly distinguishable from what the user has actually typed. */
.form-control::placeholder {
  color: #999;
}

/* Site-wide flash banner (flash[:alert]/flash[:notice], layouts/application.html.erb) -- ported from legacy's
   errors_modern.css. Reuses the .calloutDanger/.calloutSuccess color treatment; only the dismiss button and
   icon+text layout are specific to this banner. */
#errorsContainer .alert {
  position: relative;
  padding: 12px 40px 12px 16px;
  margin-top: 4px;
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 1.6;
}

.flashCloseButton {
  position: absolute;
  top: 8px;
  right: 12px;
  border: none;
  background: none;
  padding: 4px 8px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: inherit;
  opacity: 0.5;
  cursor: pointer;
}

.flashCloseButton:hover,
.flashCloseButton:focus {
  opacity: 0.9;
}

/* vertical-align: middle aligns the icon to text metrics (x-height), not the full line box, so with this
   banner's generous line-height it can still read as sitting low next to the text. align-items: flex-start
   anchors the icon to the top alongside line one instead of the vertical middle of a wrapped multi-line
   message. */
.alertIconText {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.alertIconText img {
  flex-shrink: 0;
  margin-top: 0.35em;
}

.alertIconText > span {
  min-width: 0;
}

/* Above ~800px, cap the main content column at 90% width instead of stretching all the way to the viewport
   edge -- matches legacy's responsive_width_utility_modern.css. Bootstrap's .container-fluid centers itself
   via margin: auto on both sides by default; overriding margin-left to 0 keeps this left-anchored (flush with
   the nav/banner above it) rather than centering, since the page should stay left-justified either way. */
@media (min-width: 800px) {
  #mainContent {
    width: 90%;
    margin-left: 0;
  }
}

/* Generic "white text on a colored background" utilities -- ported from legacy's application.css. Used for
   section-divider rows on tables like League Settings. */
.ptfgWhiteOnBlue {
  color: white;
  background-color: var(--ptfg-navy);
}

.ptfgWhiteOnGreen {
  color: white;
  background-color: var(--ptfg-green);
}

.ptfgWhiteOnRed {
  color: white;
  background-color: var(--ptfg-red);
}

.ptfgBlackOnBabyBlue {
  color: black;
  background-color: #bbd9ee;
}

.ptfgBlackOnYellow {
  color: black;
  background-color: #ffdc00;
}

/* Generic table utilities -- ported from legacy's application.css. Used by Schedule and other tournament-table
   pages. */
.centerText {
  text-align: center;
}

.number {
  text-align: right;
}

.tableHeaderBackground {
  background-color: #eceeef;
}

/* Base table styling shared by tournament-table pages (Schedule, Commissioner's Cup Schedule) -- wraps
   .schedule around a <table> to get consistent borders/spacing. Page-specific stylesheets (e.g. schedule.css)
   layer their own colors/rounding on top of this. */
.schedule table {
  border-collapse: collapse;
  margin-top: 0;
  margin-bottom: 5px;
}

.schedule thead {
  font-weight: bold;
  text-align: center;
}

.schedule td {
  border: 1px solid #000;
  padding: 4px;
  white-space: nowrap;
  font-size: 11px;
}

/* Badges marking a tournament's special rules (No Cut, Cut After Round 3, non-Thursday start). */
.scheduleCallout {
  font-size: 10px;
  font-style: italic;
  font-weight: bold;
  color: white;
  padding-left: 2px;
  padding-right: 2px;
}

.scheduleCalloutCut3rd {
  background: var(--ptfg-green);
}

.scheduleCalloutNoCut {
  background: var(--ptfg-red);
}

.scheduleCalloutNonThursStart {
  background: var(--ptfg-navy);
}

/* Hover tooltip showing lineup deadline time(s) for a tournament -- the anchor has no href (JS-free hover
   target only), so the deadline text sits in a child <span>, hidden until hover reveals it positioned next to
   the date range. */
a.scheduleTooltip {
  position: relative;
  color: inherit;
  text-decoration: none;
  cursor: default;
}

a.scheduleTooltip span {
  display: none;
}

a.scheduleTooltip:hover span {
  display: block;
  position: absolute;
  left: 100px;
  top: -8px;
  padding: 0.2em 0.6em;
  background-color: var(--ptfg-navy-tint);
  color: #333;
  font-size: 13px;
  white-space: nowrap;
  z-index: 1;
}

/* Marks a required field label, e.g. Field Name<span class="required">*</span> -- ported from legacy's
   application.css. */
.required {
  color: var(--ptfg-red);
}

/* Marks the "streak still alive" indicator on ITM Standings (print_streak_with_alive_indicator) -- ported
   from legacy's application.css. */
.asterisk {
  color: var(--ptfg-red);
}

/* Statistics' "will be available after week 1" message (StatisticsHelper#results_through_header). */
.importantNote {
  color: var(--ptfg-red);
}

/* Which league's banner artwork shows at the top of every page -- selected by BANNER_ID via a "banner-*"
   class on <body> (see layouts/application.html.erb and league_constants.rb). Bootstrap's own reset already
   zeroes body's margin, so this sits flush against the viewport edge with no margin math needed -- matching
   legacy, whose body was likewise margin: 0 under Bootstrap. No bottom margin -- the tab bar right below it
   (.modulesMenu) sits flush against it, matching legacy, and carries the breathing-room margin before the
   rest of the page instead. */
#bannerBackground {
  height: 70px;
}

/* Each banner image is narrower than most viewports (2000px for League X/PTFG, 1000px for RGFGC); the fill
   layered behind it covers the rest of the bar so there's never a gap on wider screens, unlike legacy (which
   left RGFGC's ungapped only up to 1000px). RGFGC's image already sits on a solid white background, so its
   fill is a plain white to stay seamless rather than a gradient. */
.banner-leaguex #bannerBackground {
  background: url("/assets/proTourBannerBlackAndWhite-ecb52156.gif") left top no-repeat,
              linear-gradient(to bottom, #d4d4d4 0, #d4d4d4 51px, #4f4f4f 51px, #4f4f4f 70px);
}

.banner-ptfg #bannerBackground {
  background: url("/assets/proTourBanner-738e0b01.gif") left top no-repeat,
              linear-gradient(to bottom, #bbd9ee 0, #bbd9ee 51px, #0b6726 51px, #0b6726 70px);
}

.banner-rgfgc #bannerBackground {
  background: url("/assets/rgfgcBanner-poweredBy-2-e73130be.png") left top no-repeat, #fff;
}

/* League name/ID overlaid on the banner for every league except RGFGC (see application.html.erb,
   ApplicationHelper#format_league_id/#league_id_x_position). No positioned ancestor, so this is placed
   relative to the viewport itself -- same coordinate space #bannerBackground's negative margins bleed it
   into -- rather than nested inside the banner div. White text sits on the darker lower half (51-70px) of
   both the League X and PTFG banner gradients. line-height is explicit (not "normal") to match legacy: its
   global Bootstrap body style sets line-height: 1.5, which this element inherited there and which pushes the
   text a few pixels lower within the fixed top: 51px box than a browser-default line-height would. */
#leagueId {
  position: absolute;
  top: 51px;
  line-height: 1.5;
  color: white;
  font-size: 13px;
  font-weight: bold;
}

/* Logged-in user's name/Logout (or a Login link for guests), top-right corner of every page. No positioned
   ancestor, so -- same as #leagueId above -- this sits relative to the viewport itself rather than inside
   body's own margin box, matching legacy's plain float: right (legacy's body has no margin of its own, so
   floating right there landed in the same spot this lands via absolute positioning here). The Logout button
   is styled to read as a plain link, matching Login/the user's name beside it -- legacy's own logout was a
   plain GET link; this app's is a real DELETE, which needs a form/button, not an <a>. */
#userNameHeader {
  position: absolute;
  top: 2px;
  right: 8px;
  text-align: right;
  font-size: 14px;
}

#userNameHeader a,
#userNameHeader button {
  text-decoration: none;
}

#userNameHeader a:hover,
#userNameHeader button:hover {
  text-decoration: underline;
}

#userNameHeader button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: #0000ee;
  cursor: pointer;
}

/* Top nav tab bar (see ApplicationHelper#render_top_nav_tabs/#module_item). Each tab is a two-part CSS
   sprite -- an <a> with the left-edge background image and an inner <span> with the right-edge image --
   giving the pill/tab look without a single wide image per tab. Hovering (or #selectedModule, the active
   tab) shifts both halves down 42px to reveal a different vertical slice of the same sprite sheet. Full
   viewport width like #bannerBackground above it (body has no margin of its own, same as legacy, so no
   bleed math is needed), and carries the breathing-room margin before the rest of the page -- on a page
   with a submenu row (.submenu, see ApplicationHelper#render_submenu), that row pulls itself flush against
   the tab bar with a negative top margin instead of this margin being removed here, so pages without a
   submenu (most of the app, for now) keep their normal spacing. */
/* font-family/font-size pinned explicitly (not inherited from body) to match legacy's actual rendered tab
   text -- legacy's own body font stack/size differ from this app's, and legacy's own "93%" rule was relative
   to ITS 12px body, not a meaningful ratio to replicate structurally. */
.modulesMenu {
  font-family: verdana, arial, helvetica, sans-serif;
  font-size: 11.16px;
  font-weight: bold;
  line-height: normal;
  margin: 0 0 2rem;
  height: 22px;
}

.modulesMenu ul {
  list-style-type: none;
  margin: 0;
  padding: 0 10px 0 15px;
}

.modulesMenu li {
  display: inline;
  line-height: 13px;
}

.modulesMenu a {
  float: left;
  padding-left: 4px;
  text-decoration: none;
  background: url("/assets/tabLeftGray-777a8188.gif") no-repeat left top;
}

.modulesMenu a span {
  float: left;
  display: block;
  padding: 5px 9px 4px 4px;
  color: #666;
  background: url("/assets/tabRightGray-5c31d129.gif") no-repeat right top;
}

.modulesMenu a:hover,
#selectedModule a {
  background-position: 0 -42px;
}

.modulesMenu a:hover span,
#selectedModule a span {
  background-position: 100% -42px;
}

#selectedModule a,
#selectedModule a span {
  color: #0b1a67;
}

.banner-leaguex .modulesMenu {
  background: #4f4f4f;
}

.banner-ptfg .modulesMenu {
  background: #0b6726;
}

/* RGFGC's tab bar is taller (32px vs 22px), nudged down 3px, and uses a blue sprite instead of the
   League X/PTFG default gray -- matches rgfgcNav.css exactly. */
.banner-rgfgc .modulesMenu {
  background: #bbd9ee;
  height: 32px;
  margin-top: 3px;
}

.banner-rgfgc .modulesMenu ul {
  padding: 10px 10px 0 15px;
}

.banner-rgfgc .modulesMenu a {
  background-image: url("/assets/tabLeftBlue-795b5eca.gif");
}

.banner-rgfgc .modulesMenu a span {
  background-image: url("/assets/tabRightBlue-7a67e196.gif");
}

/* Second nav row below the main tab bar (see ApplicationHelper#render_submenu) -- pulls itself up flush
   against .modulesMenu's own bottom margin via a matching negative top margin. No bottom margin here -- the
   .horizontalLine right after it carries the breathing room before the rest of the page instead, matching
   legacy's div order (submenu, then a separate underline div). font-family/line-height pinned explicitly for
   the same reason as .modulesMenu and #leagueId above: this app's inherited body font/line-height differ
   from legacy's, so without an explicit match here the items render at a different width and don't line up
   the way they do on the legacy app. */
.submenu {
  color: #666;
  font-family: verdana, arial, helvetica, sans-serif;
  font-size: 12px;
  line-height: 18px;
  padding: 4px 2px 4px 2px;
  margin: -2rem 0 0;
  clear: both;
}

.submenu a {
  text-decoration: none;
  color: #666;
}

.submenu a:hover {
  color: black;
  text-decoration: underline;
}

.selectedSubmenu {
  color: #0b6726;
  font-weight: bold;
}

.submenuLeftMargin {
  margin-left: 15px;
}

.horizontalLine {
  height: 1px;
  display: block;
  background-color: black;
  margin: 0 0 0.75rem;
}

table {
  border-collapse: collapse;
  margin-top: 1rem;
}

th, td {
  border: 1px solid #ccc;
  padding: 0.4rem 0.7rem;
  text-align: left;
}

th {
  background: #f0f0f0;
}

.badge {
  background: #eee;
  border-radius: 3px;
  font-size: 0.75rem;
  margin-left: 0.3rem;
  padding: 0.1rem 0.4rem;
}

.flash {
  border-radius: 4px;
  margin: 0 0 1rem;
  padding: 0.6rem 1rem;
}

.flash-notice {
  background: #dff0d8;
}

.flash-alert {
  background: #f2dede;
}

.ptfgRed {
  color: #c30900;
}

.ptfgGreen {
  color: #0b6726;
}

.ptfgDarkOrange {
  color: #fd6b00;
}

/* Team/Owner name cells that also show trophy or status icons (Standings, Statistics). "vertical-align"
   positions inline content using each browser's own font x-height calculation, and Chrome/Firefox/Safari
   don't agree on that calculation, so icons placed next to text end up vertically off-center in some browsers
   no matter what vertical-align value is used. Flexbox centers by box height instead of font metrics, so it
   renders the same everywhere. */
.iconTextCell {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* Wraps every trophy icon from print_trophy_images (application_helper.rb). As a plain inline span, this
   would inherit the surrounding text's line-height as its own internal line box, leaving icons vertically
   misplaced within that taller box -- the same font-metric problem as above, one level deeper. Flexing this
   span too makes it shrink to the icons' actual height and keeps multiple icons aligned to each other. */
.trophyImagesGroup {
  display: inline-flex;
  align-items: center;
  gap: 1px;
}

/* When the trophy icons are the ONLY content of their cell (Hall of Fame, Prizes' Trophy Case columns) --
   as opposed to sitting inline next to a name inside .iconTextCell (Standings/Statistics), where this group
   is nested one level deeper and so doesn't match this selector -- switching to a block-level flex box lets
   the cell's own default vertical-align: middle center it by actual box height instead of inline
   text-baseline font metrics, which line up more reliably for a tall icon with no text baseline of its own
   to sit next to. */
td > .trophyImagesGroup:only-child {
  display: flex;
}

/* Golfers Used Compare: highlights the current user's row(s) -- highlightRow marks a whole <tr> (by-team
   view, and the by-golfer skeleton before any place columns exist); highlightCell marks just the leading
   place columns on the by-golfer view, so the golfer's own added comparison columns aren't tinted. */
.highlightRow td {
  background-color: var(--ptfg-highlight);
}

.highlightCell {
  background-color: var(--ptfg-highlight);
}

/* One color per usage count (1 through 11 -- 10 usages plus a possible mulligan), so repeat usage stands out
   at a glance in the comparison table. */
.golferUsage1 { background: #bbd9ee; color: black; }
.golferUsage2 { background: #0b6726; color: white; }
.golferUsage3 { background: #c30900; color: white; }
.golferUsage4 { background: #0b1a67; color: white; }
.golferUsage5 { background: #fe9f2e; color: black; }
.golferUsage6 { background: #8c15d6; color: black; }
.golferUsage7 { background: #18eaec; color: black; }
.golferUsage8 { background: #81e30e; color: black; }
.golferUsage9 { background: #fbec9a; color: black; }
.golferUsage10 { background: #f78da9; color: black; }
.golferUsage11 { background: #bbbbbb; color: white; }

/* Common footer (see layouts/_footer.html.erb), rendered at the bottom of every page. Adapted from legacy's
   #footer rule -- legacy's float: left/width: 70%/margin-left: 50px were tuned to its own body box model
   (no framework, body margin 0 with a hand-placed #content column); centered text within this app's
   Bootstrap .container-fluid gives the same look without depending on that layout. */
#footer {
  margin-top: 40px;
  padding-bottom: 20px;
  text-align: center;
}

#footer hr {
  margin-top: 10px;
}

#footerLinks {
  display: block;
  font-size: 14px;
}

#customFooterLinks {
  display: block;
  font-size: 11px;
  margin-top: 3px;
}

#copyright {
  margin-top: 5px;
}

.copyrightText {
  color: gray;
  font-size: 12px;
}

/* Weekly results golfer styles -- ported from legacy's application.css. Named exactly after the GolferUsage
   STI subclass they style (GolferUsage#own_team_usage_style_for_golfer_name/#other_team_usage_style_for_
   golfer_name return "#{self.class.name}#{'Dropped' if dropped}"), plus the "Dropped" suffix variant --
   these live globally (not scoped to Weekly Results' own stylesheet) since Scorecard/Alternate Picks/
   Projected Results all render the same shared _golfer_name partial. */
.dropped {
  text-decoration: line-through;
  font-style: italic;
}

.FirstRoundStart {
  color: black;
}

.FirstRoundStartDropped {
  color: black;
  text-decoration: line-through;
  font-style: italic;
}

.FirstRoundMulliganStart {
  color: var(--ptfg-red);
  font-weight: 700;
}

.FirstRoundMulliganStartDropped {
  color: var(--ptfg-red);
  text-decoration: line-through;
  font-style: italic;
}

.ThirdRoundSub {
  color: black;
}

.ThirdRoundSubDropped {
  color: black;
  text-decoration: line-through;
  font-style: italic;
}

.ThirdRoundMulliganSub {
  color: var(--ptfg-red);
  font-weight: 700;
}

.ThirdRoundMulliganSubDropped {
  color: var(--ptfg-red);
  text-decoration: line-through;
  font-style: italic;
}

.FourthRoundSub {
  color: var(--ptfg-red);
  font-weight: 700;
}

/* Overridden by .highlightRow's own background when this is the current viewer's own row. */
.FourthRoundMulliganSub {
  color: white;
  background: var(--ptfg-red);
  font-weight: 700;
}

.weeklyResultsWinningGolfer {
  font-weight: 700;
  background-color: #ff0;
}

/* Black text since white-on-yellow is hard to read. */
.weeklyResultsWinningGolferDoubleMulligan {
  font-weight: 700;
  background-color: #ff0;
  color: black;
}

/* Every sortable-table header (the sortable-table Stimulus controller's click target) underlines on hover,
   matching legacy's old sortheader link convention -- a single global rule since every page's header <td>
   carries this same data-action attribute, rather than repeating a per-page hover rule. */
[data-action="click->sortable-table#sort"]:hover {
  text-decoration: underline;
}

/* The hover underline above is a text-decoration line drawn the full width of the header, which would also
   run under the ▲/▼ sort-direction glyph (each page's own [data-sort-direction]::after rule) -- turned off
   here so only the column name underlines, not the arrow. */
[data-sort-direction]::after {
  text-decoration: none;
}
