/* ================================
   GLOBAL STYLE VARIABLES
   ================================ */
:root {

  /* ---------- Global fonts ---------- */
  --font-body: "Rosarivo", serif;        /* default body text font */
  --font-body-color: #d4ac8e;
  --font-body-size: 18px;

  /* ---------- Links ---------- */
  --link-color: #b2b1b8;                 /* normal link color */
  --link-color-hover: #756059;           /* hover link color */
  --link-decoration: none;          /* normal text decoration */
  --link-decoration-hover: none;         /* hover text decoration */

  /* ---------- Forms - Labels ---------- */
  --label-text-color: #756059;
  --label-text-size: 18px;
  --label-text-font: "Rosarivo", serif;

  /* ---------- Forms - Fields ---------- */
  --form-bg: rgba(255,255,255,0.4); /* can also use rgba(255,255,255,0.9)  */
  --form-border: 1px solid #756059;
  --form-text-color: #756059;
  --form-text-size: 18px;
  --form-text-font: "Rosarivo", serif;
  --form-focus-border: 1px solid #000;

  /* ---------- Forms - Buttons ---------- */
  --button-bg: rgba(255,255,255,0.4);
  --button-border: 1px solid #756059;
  --button-text-color: #756059;
  --button-text-size: 18px;
  --button-text-font: "Rosarivo", serif;
  --button-bg-hover: #f0f0f0;
  --button-text-color-hover: #000; 

  /* ---------- Form Layout Widths ---------- */
  --form-container-max-width: 650px; /* full form container width */
  --form-label-width: 180px; /* left column width */
  --form-field-max-width: 300px; /* right column and fields widths */
  --form-password-width: 140px; /* doesn't seem to work but it's half of form-field-max-width, minus 10 for gap*/

  /* ---------- Code Images ---------- */
  --code-bg: #f0e6e8;
  --code-border: 0px solid #b2b1b8;

  /* ---------- Affiliate Images ---------- */
  --affiliate-bg: #f0e6e8;
  --affiliate-border: 1px solid #b2b1b8;

  /* ---------- To use gradient, transparency, or image ---------- */
  /* --button-bg-gradient: linear-gradient(rgba(255,200,150,0.3), rgba(200,100,50,0.3)); */
  /* --form-bg: rgba(255,255,255,0.9); */
  /* --form-bg-image: url('form-bg.png'); */
}


/* =========================================================================
   Forms CSS
   ========================================================================= */


.signup-form {
  max-width: var(--form-container-max-width);
  font-family: var(--font-body);
  font-size: var(--font-body-size);
  color: var(--font-body-color);
  margin: 0 auto;
}

.signup-form .form-row {
  display: flex;
  align-items: flex-start;
  margin-bottom: 12px;
}

.signup-form .form-row label {
  width: var(--form-label-width);
  font-size: var(--label-text-size);
  color: var(--label-text-color);
  padding-top: 4px;
  padding-right: 10px;
  text-align: right;
}

.signup-form .right-column {
  max-width: var(--form-field-max-width);
  display: flex;
  flex-direction: column;
  width: 100%;
}

.signup-form .input-label {
  font-family: var(--label-text-font);
  font-size: var(--label-text-size);
  color: var(--label-text-color);
  display: flex;
  align-items: center;
  text-align: left;
  width: 100%;
}

.signup-form .checkbox-left {
  justify-content: flex-start;
  gap: 6px;
}

.signup-form .password-group {
  display: flex;
  gap: 10px;
}

.signup-form .password-group input {
  width: var(--form-password-width);
}

.signup-form input[type="text"],
.signup-form input[type="email"],
.signup-form input[type="password"],
.signup-form input[type="url"],
.signup-form select,
.signup-form textarea {
  max-width: var(--form-field-max-width);
  background: var(--form-bg);
  border: var(--form-border);
  color: var(--form-text-color);
  font-size: var(--form-text-size);
  font-family: var(--form-text-font);
  box-sizing: border-box;
  padding: 6px;
  width: 100%;
  font-style: italic;
}

.signup-form input:focus,
.signup-form select:focus,
.signup-form textarea:focus {
  outline: none;
  border: var(--form-focus-border);
}

.signup-form .radio-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.signup-form .checkbox-left.full-width {
  max-width:  var(--form-field-max-width); 
  text-align: left;
  justify-content: flex-start;
  gap: 6px;
  width: 100%;
}

.signup-form .buttons .right-column {
  flex-direction: row;
  gap: 10px;
}

.signup-form .buttons .right-column input {
  background: var(--button-bg);
  border: var(--button-border);
  color: var(--button-text-color);
  font-size: var(--button-text-size);
  font-family: var(--button-text-font);
  flex: 1; 
  padding: 8px;
  cursor: pointer;
}

.signup-form .buttons .right-column input:hover {
  background: var(--button-bg-hover);
  color: var(--button-text-color-hover, var(--button-text-color));
}


/* =========================================================================
   Codes & Sort List
   ========================================================================= */

.codesort p {
  width: 550px;
  margin: 0 auto;
}

.show_sort_list,
.codesort a {
  color: var(--link-color);
}

.show_sort_list:hover,
.codesort a:hover {
  color: var(--link-color-hover);
}

#codes ul {
  display: flex;
  justify-content: center;
  gap: 1em;
  list-style: none;
  margin: 0;
  padding: 0;
}

#codes li {
  display: inline;
}

#codes p {
  text-align: center;
}

#codes p img {
  margin: 0 auto;
}

.show_sort_list {
  margin-left: 100px;
  padding: 0;
  font-weight: normal;
  color: var(--link-color);
  font-family: var(--font-body);
  list-style: none;
}

.show_sort_list li {
  margin: 5px 0;
}

.show_sort_list a {
  color: var(--link-color);
  text-decoration: none;
}

.show_sort_list a:hover {
  color: var(--link-color-hover);
  text-decoration: var(--link-decoration-hover);
}

#codes img {
  margin: 3px !important;
  padding: 3px;
  background: var(--code-bg);
  border: var(--code-border);
}


/* =========================================================================
   Affiliates
   ========================================================================= */

#affiliates img {
  margin: 3px !important;
  padding: 3px;
  background: var(--affiliate-bg);
  border: var(--affiliate-border);
}


/* =========================================================================
   Copy Box
   (by default, these mirror my form styles)
   ========================================================================= */

.samplelink {
    max-width: 400px;
    margin: 20px auto;
    padding: 10px;
    box-sizing: border-box;
    text-align: center;
    word-break: break-word;
    background: var(--form-bg);
    border: var(--form-border);
    color: var(--form-text-color);
    font-size: var(--form-text-size);
    font-family: var(--form-text-font);
  }

.copy-button {
    display: block;
    margin: 8px auto 0 auto;
    padding: 6px 12px;
    max-width: 150px;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    background: var(--button-bg);
    border: var(--button-border);
    color: var(--button-text-color);
    font-size: var(--button-text-size);
    font-family: var(--button-text-font);
  }

.copy-button:hover {
  background: var(--button-bg-hover);
  color: var(--button-text-color-hover, var(--button-text-color));
}

/* =========================================================================
   Tooltips
   ========================================================================= */

/* usage: <span class="tooltip" data-tip="HELLO"></span> */
.tooltip {
  position: relative;
  display: inline-block;
  cursor: auto;
  border-bottom: 1px dotted #333; /* the dotted underline */
  text-decoration: none;          /* remove default underlines if any */
}

.tooltip::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  top: 100%;
  margin-top: 6px;
  transform: translateX(-50%) scale(.9);
  background: #444;
  color: #fff;
  padding: 6px 12px;
  font-size: 0.85em;
  border-radius: 20px;
  white-space: nowrap;
  opacity: 0;
  transition:
    opacity 0.5s ease,
    transform 0.3s ease;
  z-index: 10;
}

.tooltip::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  margin-top: 0;
  transform: translateX(-50%) scale(.9);
  border: 6px solid transparent;
  border-bottom-color: #444;
  opacity: 0;
  transition:
    opacity 0.5s ease,
    transform 0.3s ease;
  z-index: 10;
}

.tooltip:hover::after,
.tooltip:hover::before {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.tooltip::after,
.tooltip::before {
  pointer-events: none;
}


/* ======================================================
   HIDE EMPTY OPTIONAL FIELDS
====================================================== */
/* usage (can be repeated):
<span class="opt">
Favorite Song(s): <span class="value">$$fan_favorite_song$$</span>
</span>
*/

.opt:has(.value:empty) {
  display: none;
}

.value:empty {
  display: none;
}

.opt {
  display: block;
}


/* =========================================================================
   Utilities
   ========================================================================= */

/* Prevent images from breaking layouts on mobile */
img {
  max-width: 100%;
  height: auto;
}

/* usage: <span class="inline-flex"> */
.inline-flex {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* usage: <div class="center"> */
.center {
  max-width: 900px;
  margin: auto;
  padding: 20px;
}

/* usage: <div class="text-center"> */
/* usage: <div class="text-right"> */
  .text-center { text-align: center; }
  .text-right  { text-align: right; }

/* usage: <div class="center-both"> */
.center-both {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* usage: <div class="divider"></div> */
.divider {
  height: 16px;
  width: 100%;
}

/* usage: <span class="truncate"></span> */
.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* usage: <div class="columns" style="--cols: 2;"> */
/* usage: <div class="columns" style="--cols: 3;"> */
/* usage: <div class="columns" style="--cols: 4;"> */
.columns {
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), 1fr);
  gap: 20px;
}

.columns > * {
  min-width: 0;
}

/* usage: <div class="grid-auto"> */
.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 20px;
}

/* usage: 
<ul class="zebra">
  <li>Item</li>
</ul>
*/
.zebra > *:nth-child(even) {
  background: #f5f5f5;
}

/* usage: <body class="debug"> */
.debug * {
  outline: 1px dashed red;
}




/* =========================================================================
   Responsive
   ========================================================================= */

  /* Breakpoints
  --------------------------------
  900px  tablet
  700px  small tablet
  600px  mobile
  400px  small phone
  -------------------------------- */

/* Forms Responsive */
@media (max-width: 600px) {
  .signup-form .form-row {
    flex-direction: column;  
    align-items: stretch;    
    margin-bottom: 16px;
  }

  .signup-form .form-row label {
    width: 100%;
    text-align: left;  
    padding-right: 0;
    margin-bottom: 6px;
  }

  .signup-form .right-column {
    width: 100%;
    max-width: 100%;  
    flex-direction: column;
  }

  .signup-form .buttons .right-column {
    flex-direction: column; 
    gap: 10px;
  }

  .signup-form .password-group {
    flex-direction: column; 
  }

  .signup-form .password-group input {
    width: 100%;
  }
}

/* Copy Box Responsive */
@media (max-width: 500px) {
  .samplelink {
    max-width: 90%;
    font-size: 13px;
    padding: 8px;
  }

  .copy-button {
    max-width: 90%;
    font-size: 13px;
    padding: 6px 8px;
  }
}

@media (max-width: 800px) {
  .columns { --cols: 2; }
}

@media (max-width: 500px) {
  .columns { --cols: 1; }
}