@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&display=swap');

/* ============================================================
   EMOTE ANARCHY — Dark Teal Theme
   ============================================================ */

:root {
  /* — Backgrounds — */
  --primaryBackgroundColor: #0b1120;
  --primaryBackgroundColorHigh: #060a14;
  --primaryBackgroundColorLow: #131d33;

  /* — Surface / Card — */
  --secondaryBackground: #111b2e;
  --secondaryBackgroundHigh: #1e2d4a;
  --secondaryBackgroundLow: #0b1120;

  /* — Typography — */
  --primaryFontColor: #d6e0f0;
  --primaryFontFamily: 'Outfit', system-ui, -apple-system, sans-serif;
  --secondaryFontColor: #e8edf5;
  --secondaryFontFamily: 'Outfit', system-ui, -apple-system, sans-serif;

  /* — Accent: Teal — */
  --accent: #14b8a6;
  --accentHover: #0d9488;
  --accentSubtle: #0f766e;
  --accentMuted: rgba(20, 184, 166, 0.12);
  --accentBright: #2dd4bf;
  --accentGlow: rgba(20, 184, 166, 0.25);

  /* — Muted text — */
  --mutedFontColor: #7a8ba8;

  /* — Semantic — */
  --success: #2dd4bf;
  --danger: #f87171;
  --dangerBorder: #dc2626;
  --dangerBg: rgba(248, 113, 113, 0.1);

  /* — Twitch brand — */
  --twitchPurple: #9146FF;
  --twitchPurpleDark: #7c3aed;
  --twitchPurpleBg: rgba(145, 70, 255, 0.15);
}


/* ============================================================
   RESET & BASE
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  background-color: var(--primaryBackgroundColor);
  color: var(--primaryFontColor);
  font-family: var(--primaryFontFamily);
  margin: 0;
  padding: 0;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* Subtle radial gradient on the body for depth */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(20, 184, 166, 0.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}


/* ============================================================
   LINKS
   ============================================================ */

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accentBright);
  text-decoration: underline;
}


/* ============================================================
   SITE TITLE
   ============================================================ */

.siteTitle {
  font-size: clamp(28px, 6vw, 44px);
  padding: 28px 16px 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accentBright);
  text-shadow: 0 0 40px rgba(45, 212, 191, 0.3);
  position: relative;
  z-index: 1;
}


/* ============================================================
   MENU CONTAINER (main card)
   ============================================================ */

.menuContainer {
  display: inline-block;
  border-radius: 16px;
  background-color: var(--secondaryBackground);
  color: var(--secondaryFontColor);
  font-family: var(--secondaryFontFamily);
  width: 90%;
  max-width: 480px;
  min-width: 0;
  border: 1px solid var(--secondaryBackgroundHigh);
  box-shadow:
    0 4px 32px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(20, 184, 166, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  margin-bottom: 32px;
  position: relative;
  z-index: 1;
  padding-bottom: 8px;
}


/* ============================================================
   LOADER
   ============================================================ */

#loader {
  padding: 12px;
}


/* ============================================================
   MENU CONTENT
   ============================================================ */

.menuContent {
  padding: 16px;
  display: none;
}


/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */

.menuToast {
  display: none;
  padding: 16px 20px;
  font-weight: 600;
  color: var(--accentBright);
  font-size: 14px;
}


/* ============================================================
   TITLES
   ============================================================ */

.menuTitle {
  font-size: clamp(22px, 5vw, 32px);
  padding: 16px 8px 4px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--secondaryFontColor);
}

.menuSubtitle {
  font-size: clamp(14px, 3vw, 18px);
  padding: 4px 8px 8px;
  color: var(--mutedFontColor);
  font-weight: 500;
}


/* ============================================================
   FORM ELEMENTS
   ============================================================ */

.menuInput {
  font-family: var(--primaryFontFamily);
}

.menuInputLabel {
  padding: 8px 4px 4px;
  letter-spacing: 0.12em;
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--mutedFontColor);
}

.menuInput[type="text"] {
  text-align: center;
  border-radius: 10px;
  padding: 10px 14px;
  background-color: var(--primaryBackgroundColor);
  border: 1px solid var(--secondaryBackgroundHigh);
  color: var(--primaryFontColor);
  font-family: var(--primaryFontFamily);
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
  max-width: 280px;
}

.menuInput[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accentMuted), 0 0 16px rgba(20, 184, 166, 0.1);
}

.menuInput[type="text"]::placeholder {
  color: var(--mutedFontColor);
  opacity: 0.6;
}

.menuInput[type="text"][readonly] {
  opacity: 0.5;
  cursor: not-allowed;
}


/* ============================================================
   BUTTONS
   ============================================================ */

.menuButton {
  border-radius: 10px;
  padding: 10px 20px;
  cursor: pointer;
  background-color: var(--accent);
  color: #fff;
  border: none;
  font-family: var(--primaryFontFamily);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
  transition: background-color 0.15s, transform 0.1s, box-shadow 0.15s;
  max-width: 280px;
  width: 100%;
}

.menuButton:hover {
  background-color: var(--accentHover);
  box-shadow: 0 4px 20px rgba(20, 184, 166, 0.25);
}

.menuButton:active {
  transform: scale(0.97);
  box-shadow: none;
}

.menuButton:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Wide button variant (replaces inline width: 250px) */
.menuButton--wide {
  width: 100%;
  max-width: 250px;
  margin: 5px auto;
  display: block;
}

/* Danger variant for destructive actions */
.menuButton--danger {
  background-color: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

.menuButton--danger:hover {
  background-color: var(--dangerBg);
  box-shadow: 0 4px 20px rgba(248, 113, 113, 0.15);
}


/* ============================================================
   EMOTE ENTRIES
   ============================================================ */

.emoteValue {
  font-weight: 700;
  padding: 10px 12px;
  padding-bottom: 2px;
  display: inline-block;
  font-size: 14px;
}

.yourEmotesEntry {
  border: 1px solid var(--secondaryBackgroundHigh);
  border-radius: 10px;
  margin: 6px 4px;
  background-size: cover;
  background-position: center;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  overflow: hidden;
}

.yourEmotesEntry:hover {
  border-color: var(--accentSubtle);
  box-shadow: 0 2px 16px var(--accentGlow);
  transform: translateY(-1px);
}

.yourEmotesEntryButtons {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.yourEmotesEntry:hover .yourEmotesEntryButtons {
  visibility: visible;
  pointer-events: auto;
  opacity: 1;
}

/* Emote action buttons (ADD, REMOVE, PREVIEW, etc.) */
.addButton,
.removeButton,
.playButton,
.editButton,
.resyncButton {
  cursor: pointer;
  border-radius: 6px;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.05em;
  padding: 5px 10px;
  border: 1px solid var(--secondaryBackgroundHigh);
  background-color: var(--secondaryBackground);
  color: var(--primaryFontColor);
  font-family: var(--primaryFontFamily);
  transition: background-color 0.15s, border-color 0.15s;
}

.addButton:hover {
  background-color: var(--accentMuted);
  border-color: var(--accent);
  color: var(--accentBright);
}

.removeButton:hover {
  background-color: var(--dangerBg);
  border-color: var(--danger);
  color: var(--danger);
}

.playButton:hover,
.editButton:hover,
.resyncButton:hover {
  background-color: var(--accentMuted);
  border-color: var(--accent);
  color: var(--accentBright);
}


/* ============================================================
   SUBSCRIPTION CHECK
   ============================================================ */

.subscriptionCheck {
  visibility: hidden;
}

.subscribedEmote .subscriptionCheck::after {
  content: '\2714';
  color: var(--success);
  font-size: 16px;
  font-weight: bold;
  visibility: visible;
}

.channelView .subscriptionCheck,
.emoteNumber {
  display: none;
}

.subscribedEmote .addButtonContainer, .notLoggedInEmote .addButtonContainer {
  display: none !important;
}

.notSubscribedEmote .removeButtonContainer, .notLoggedInEmote .removeButtonContainer {
  display: none !important;
}


/* ============================================================
   COPY TOAST
   ============================================================ */

.copyToast {
  position: fixed;
  top: 20px;
  left: 20px;
  background-color: var(--secondaryBackground);
  color: var(--accentBright);
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.3s, transform 0.3s;
  border: 1px solid var(--accentSubtle);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  transform: translateY(0);
}

.copyToast.fadeOut {
  opacity: 0;
  transform: translateY(-8px);
}


/* ============================================================
   DEAD EMOTES
   ============================================================ */

.deadEmote {
  border-color: var(--dangerBorder);
  opacity: 0.5;
}

.deadEmote .emoteValue[field="name"]::after {
  content: ' [DEAD]';
  color: var(--danger);
  font-size: 10px;
  font-weight: 900;
}

.unapprovedEmote {
  opacity: 0.5;
  border-color: #886600;
}

.unapprovedEmote .emoteValue[field="name"]::after {
  content: ' [PENDING]';
  color: #cc9900;
  font-size: 10px;
  font-weight: 900;
}

.approveButtonContainer {
  display: none !important;
}

.adminView .approveButtonContainer {
  display: inline-block !important;
}


/* ============================================================
   OVERLAY VISUALS (emote playback animations)
   ============================================================ */

.visual {
  position: fixed;
  bottom: 0;
  right: 0;
  pointer-events: none;
}

.visualOn {
  animation-timing-function: cubic-bezier(0, 1, 1, 0);
  animation: visualOnMotion 0.6s infinite;
  animation-fill-mode: forwards;
  animation-iteration-count: 1;
}

.visualOff {
  animation-timing-function: cubic-bezier(0, 1, 1, 0);
  animation: visualOffMotion 0.6s infinite;
  animation-fill-mode: forwards;
  animation-iteration-count: 1;
}

@keyframes visualOnMotion {
  0% {
    opacity: 0;
    transform: translateX(100%);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes visualOffMotion {
  0% {
    opacity: 1;
    transform: translateX(0);
  }
  100% {
    opacity: 0;
    transform: translateX(100%);
  }
}


/* ============================================================
   FIREBASE UI (dark mode overrides)
   ============================================================ */

.firebaseui-container {
  border-radius: 12px;
  background-color: transparent !important;
  color: var(--primaryFontColor) !important;
  font-family: var(--primaryFontFamily) !important;
}

.firebaseui-container.mdl-card {
  border-radius: 12px !important;
  box-shadow: none !important;
  background-color: transparent !important;
}

.mdl-card {
  background-color: transparent !important;
  box-shadow: none !important;
}

.mdl-shadow--2dp,
.mdl-shadow--3dp,
.mdl-shadow--4dp {
  box-shadow: none !important;
}

.firebaseui-card-content,
.firebaseui-card-header,
.firebaseui-card-actions {
  background-color: transparent !important;
}

.mdl-button--raised.mdl-button--colored {
  background-color: var(--accent) !important;
  color: #fff !important;
  font-family: var(--primaryFontFamily) !important;
  font-weight: 600 !important;
  border-radius: 10px !important;
  text-transform: none !important;
  letter-spacing: 0.02em !important;
}

.mdl-button--raised.mdl-button--colored:hover,
.mdl-button--raised.mdl-button--colored:focus {
  background-color: var(--accentHover) !important;
}

.mdl-textfield__input {
  color: var(--primaryFontColor) !important;
  border-bottom-color: var(--secondaryBackgroundHigh) !important;
  font-family: var(--primaryFontFamily) !important;
}

.mdl-textfield__input:focus {
  border-bottom-color: var(--accent) !important;
}

.mdl-textfield__label {
  color: var(--mutedFontColor) !important;
  font-family: var(--primaryFontFamily) !important;
}

.mdl-textfield__label::after {
  background-color: var(--accent) !important;
}

.firebaseui-link,
.firebaseui-id-secondary-link {
  color: var(--accent) !important;
  font-family: var(--primaryFontFamily) !important;
}

.firebaseui-id-secondary-link:hover,
.firebaseui-link:hover {
  color: var(--accentBright) !important;
}

.firebaseui-tos {
  color: var(--mutedFontColor) !important;
}

.firebaseui-tos a {
  color: var(--accent) !important;
}

.firebaseui-title {
  color: var(--secondaryFontColor) !important;
  font-family: var(--primaryFontFamily) !important;
}

.firebaseui-subtitle {
  color: var(--mutedFontColor) !important;
  font-family: var(--primaryFontFamily) !important;
}

.firebaseui-text {
  color: var(--primaryFontColor) !important;
}

.firebaseui-error {
  color: var(--danger) !important;
}

label.mdl-textfield__label.firebaseui-label[for="name"] {
  /* no overrides needed */
}

label.mdl-textfield__label.firebaseui-label[for="name"]::before {
  content: "Display Name\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0\00a0";
}


/* ============================================================
   LOADING SPINNER (lds-ellipsis)
   ============================================================ */

/* from https://loading.io/css/ */
.lds-ellipsis {
  display: inline-block;
  position: relative;
  width: 80px;
  height: 80px;
}
.lds-ellipsis div {
  position: absolute;
  top: 33px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  animation-timing-function: cubic-bezier(0, 1, 1, 0);
}
.lds-ellipsis div:nth-child(1) {
  left: 8px;
  animation: lds-ellipsis1 0.6s infinite;
}
.lds-ellipsis div:nth-child(2) {
  left: 8px;
  animation: lds-ellipsis2 0.6s infinite;
}
.lds-ellipsis div:nth-child(3) {
  left: 32px;
  animation: lds-ellipsis2 0.6s infinite;
}
.lds-ellipsis div:nth-child(4) {
  left: 56px;
  animation: lds-ellipsis3 0.6s infinite;
}
@keyframes lds-ellipsis1 {
  0% {
    transform: scale(0);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes lds-ellipsis3 {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(0);
  }
}
@keyframes lds-ellipsis2 {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(24px, 0);
  }
}
/* end from https://loading.io/css/ */


/* ============================================================
   USER PANEL (dynamically created by JS)
   ============================================================ */

.userPanel {
  position: fixed;
  top: 0;
  right: 0;
  text-align: center;
  border: 1px solid var(--secondaryBackgroundHigh);
  background-color: var(--secondaryBackground);
  border-radius: 0 0 0 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  padding: 4px;
}

.userPanel .userImage {
  max-width: 80px;
  max-height: 80px;
  border-radius: 50%;
  border: 2px solid var(--secondaryBackgroundHigh);
}

.userPanel .userName {
  color: var(--mutedFontColor);
  font-size: 12px;
  padding: 4px 8px;
}

.userPanel .menuButton {
  margin: 4px 8px;
  width: 100px;
}


/* ============================================================
   TWITCH SECTION (replaces inline purple styles)
   ============================================================ */

.twitchSection {
  border: 1px solid var(--twitchPurpleDark);
  background-color: var(--twitchPurpleBg);
  border-radius: 12px;
  padding: 12px;
  margin: 16px 8px;
}

.twitchSection .lds-ellipsis div {
  background: var(--twitchPurple);
}

.twitchIcon {
  width: 28px;
  margin: 12px;
  filter: brightness(1.1);
}


/* ============================================================
   CONTENT BLOCK (about, privacy, tos)
   ============================================================ */

.contentBlock {
  max-width: 400px;
  text-align: left;
  margin: 8px auto;
  font-size: 14px;
  line-height: 1.8;
  color: var(--primaryFontColor);
}

.contentBlock b {
  color: var(--secondaryFontColor);
}

.contentBlock iframe {
  width: 100%;
  max-width: 400px;
  aspect-ratio: 16 / 9;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--secondaryBackgroundHigh);
}


/* ============================================================
   FOOTER LINKS
   ============================================================ */

.footerLinks {
  padding: 20px 16px 8px;
  font-size: 13px;
  line-height: 2;
  color: var(--mutedFontColor);
}


/* ============================================================
   VOLUME CONTROLS
   ============================================================ */

.volLabel {
  font-weight: 800;
  font-family: var(--primaryFontFamily);
  display: inline;
  color: var(--mutedFontColor);
  font-size: 11px;
  letter-spacing: 0.08em;
}

input[type="range"] {
  accent-color: var(--accent);
}

.subscribeButtonOff:not(.subscribeButtonActive),
.subscribeButtonOn:not(.subscribeButtonActive) {
  display: none;
}


/* ============================================================
   ADMIN AUDIT STYLES
   ============================================================ */

.auditResult {
  padding: 4px 8px;
  font-size: 12px;
  text-align: left;
  display: inline-block;
  width: 300px;
  max-width: 100%;
}

.auditResult.auditPass {
  color: var(--success);
}

.auditResult.auditFail {
  color: var(--danger);
}

.auditDetail {
  font-size: 10px;
  color: var(--danger);
  padding-left: 16px;
  opacity: 0.8;
}


/* ============================================================
   BULK ACTIONS
   ============================================================ */

#bulkActions input[type="button"] {
  cursor: pointer;
  border-radius: 8px;
  font-weight: 600;
  font-size: 12px;
  padding: 6px 14px;
  margin: 4px;
  border: 1px solid var(--secondaryBackgroundHigh);
  background-color: var(--secondaryBackground);
  color: var(--primaryFontColor);
  font-family: var(--primaryFontFamily);
  transition: background-color 0.15s, border-color 0.15s;
}

#bulkActions input[type="button"]:hover {
  background-color: var(--accentMuted);
  border-color: var(--accent);
  color: var(--accentBright);
}


/* ============================================================
   FORM RESET
   ============================================================ */

form {
  padding: 0;
  margin: 0;
}


/* ============================================================
   SMALL TEXT HELPERS
   ============================================================ */

.textMuted {
  color: var(--mutedFontColor);
  font-size: 11px;
}


/* ============================================================
   FILE UPLOAD ZONES
   ============================================================ */

.fileUploadZone {
  border: 2px dashed var(--secondaryBackgroundHigh);
  border-radius: 10px;
  padding: 20px 14px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
  background-color: var(--primaryBackgroundColor);
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  position: relative;
}

.fileUploadZone:hover {
  border-color: var(--accentSubtle);
  background-color: var(--primaryBackgroundColorLow);
}

.fileUploadZone.dragover {
  border-color: var(--accent);
  background-color: var(--accentMuted);
  box-shadow: 0 0 0 3px var(--accentMuted), 0 0 16px rgba(20, 184, 166, 0.1);
}

.fileUploadZone.hasFile {
  border-color: var(--accentSubtle);
  border-style: solid;
}

.fileUploadZone.uploadError {
  border-color: var(--danger);
}

.fileUploadZoneLabel {
  color: var(--mutedFontColor);
  font-size: 13px;
  font-family: var(--primaryFontFamily);
  pointer-events: none;
}

.fileUploadZoneLabel .fileName {
  color: var(--accentBright);
  font-weight: 600;
  font-size: 14px;
  word-break: break-all;
}

.fileUploadZoneLabel .fileError {
  color: var(--danger);
  font-weight: 600;
  font-size: 12px;
}

.fileUploadZone input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.uploadProgressContainer {
  width: 100%;
  max-width: 240px;
  height: 6px;
  background-color: var(--secondaryBackgroundHigh);
  border-radius: 3px;
  margin: 10px auto 0;
  overflow: hidden;
  display: none;
}

.uploadProgressBar {
  height: 100%;
  width: 0%;
  background-color: var(--accent);
  border-radius: 3px;
  transition: width 0.2s;
}

.uploadProgressText {
  font-size: 11px;
  color: var(--mutedFontColor);
  margin-top: 4px;
  display: none;
  pointer-events: none;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 520px) {
  .siteTitle {
    padding: 20px 12px 8px;
  }

  .menuContainer {
    width: 95%;
    border-radius: 12px;
  }

  .fileUploadZone {
    max-width: 100%;
    padding: 16px 10px;
  }

  .menuContent {
    padding: 12px 8px;
  }

  /* On mobile, always show emote entry buttons (no hover) */
  .yourEmotesEntryButtons {
    visibility: visible !important;
    pointer-events: auto !important;
    opacity: 1 !important;
  }

  .yourEmotesEntry {
    margin: 6px 0;
  }

  /* Stack action button cells vertically */
  .yourEmotesEntryButtons table td {
    display: block;
    text-align: center !important;
  }

  .auditResult {
    width: 100%;
  }

  .contentBlock iframe {
    max-width: 100%;
  }

  .userPanel {
    padding: 2px;
    border-radius: 0 0 0 10px;
  }

  .userPanel .userImage {
    max-width: 40px !important;
    max-height: 40px !important;
  }

  .userPanel .menuButton {
    font-size: 11px;
    padding: 5px 8px;
    max-width: 80px;
    width: auto;
  }
}

@media (max-width: 360px) {
  .menuTitle {
    font-size: 20px;
  }

  .menuButton {
    font-size: 13px;
    padding: 9px 14px;
  }
}
