:root {
  --href-color: #bbc;
  --href-color-visited: #98b;
  --href-color-hover: #98f;

  --href-color-secondary: #99a;
  --href-color-secondary-visited: #99a;

  --text-body-color: #aaa;
  --text-body-color-secondary: #666;
  --text-header-color: #888;

  --warning-color: #aa6;
  --error-color: #a66;

  --button-color: #aaa;
  --button-color-background: #444;
  --button-color-background-hover: #666;

  --color-border: #444;
  /* --background-color: #282828; */
  --background-color: #282828;
  --background-secondary: #181818;

  --font-body: 'Verdana', 'Geneva', 'Tahoma', sans-serif;
  --font-header: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
}

body {
  font-family: var(--font-body);
  background: var(--background-color);
  color: var(--text-body-color);
  margin: 0;
  padding: 0;
  word-break: break-word;
}

#app {
  min-height: calc(100vh - 40px);
}

a[href] {
  color: var(--href-color);
}

a[href]:visited {
  color: var(--href-color-visited);
}

a[href]:hover {
  text-decoration: underline;
}

.size-bubble-list-container {
  display: flex;
  flex-direction: column;
  row-gap: 4px;
}

.size-bubble-container {
  line-height: 1.4em;
}

.size-bubble-item {
  margin-right: 8px;
  display: inline-block;
}

.size-bubble-item a {
  text-decoration: none;
}

.size-bubble-key {
  font-size: medium;
}

.size-bubble-value {
  color: var(--text-body-color-secondary);
  font-size: small;
}

#header {
  background: #333;
  padding: 3px 5px; 
  margin-bottom: 30px;
  /* position: sticky; */
  /* top: 0; */
}

.header {
  overflow: hidden;
  display: flex;
  word-break: keep-all;
  white-space: nowrap;
}

.header-left {
  -ms-overflow-style: none;  /* Internet Explorer 10+ */
  scrollbar-width: none;  /* Firefox */
  overflow: auto;
  overflow: -moz-scrollbars-none;

  display: flex;
  align-items: center;
}

.header .logo {
  width: 16px;
  height: 16px;
  margin-right: 4px;
}
.header a.site-name {
  text-decoration: none;
  color: #ccc;
  display: flex;
  flex-direction: row;
  align-items: center;
}

.header .current-sub-name {
  color: #ccc;
}

.header a.header-snapshot-time {
  margin-left: 4px;
  font-size: x-small;
  color: var(--text-body-color-secondary);
  text-decoration: none;
}

.header .header-other-subs {
  margin-left: 12px;
}

.header .header-other-subs a,
.header .header-other-subs a:visited {
  font-size: x-small;
  text-decoration: none;
  color: var(--href-color-secondary);
}
.header .header-other-subs a:hover {
  text-decoration: underline;
}

.header .header-other-subs > * ~ * {
  margin-left: 8px;
}

.header .open-in-reddit {
  text-decoration: none;
  text-transform: uppercase;
  align-self: center;
  border-radius: 4px;
  margin-left: auto;
  padding: 0 4px 0 12px;
  font-size: small;
}
.header a.open-in-reddit {
  color: var(--text-body-color);
}

#subreddit-input {
  margin: 0;
  display: flex;
  justify-content: left;
  position: relative;
}

#subreddit-input #subreddit {
  min-width: 200px;
  width: 80%;
  background: #282828;
  color: white;
  border: 1px solid var(--color-border);
  padding: 10px 20px;
  height: 20px;
  font-size: large;
  border-radius: 10px;
}

#subreddit-input #subreddit:focus {
  outline: none;
  border-color: 1px solid vaR(--href-color);
}

.submit-button {
  border-radius: 10px;
  margin-left: 4px;
  font-size: large;
  background: var(--button-color-background);
  padding: 0 12px;
  color: var(--text-body-color);
  /* border: none; */
}

.subreddit-input-error {
  color: var(--error-color);
}

.nsfw-wrapper {
  margin-top: 4px;
  display: flex;
  align-items: center;
}

.autocomplete-wrap {
  position: absolute;
  top: 44px;
  left: 0;
  background: var(--button-color-background);
  width: 95%;
  border-radius: 8px;
  /* IF_CHANGE (autocomplete item height) */
  max-height: calc(48px * 12);
  /* END_IF_CHANGE  */
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1;
}

.autocomplete-match-item {
  /* IF_CHANGE (autocomplete item height) */
  height: 48px;
  /* END_IF_CHANGE  */
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-decoration: none;
}

.autocomplete-match-item:hover,
.autocomplete-match-item.highlight {
  background-color: var(--button-color-background-hover);
}

.autocomplete-match-item-non-match {
  color: var(--text-body-color);
}

.autocomplete-match-item-match {
  color: #fff;
}

.autocomplete-match-item-row1 {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.autocomplete-match-item-row2 {
  overflow: hidden;
  font-size: small;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--text-body-color);
}

.autocomplete-match-item-title {
  color: var(--text-body-color);
  font-style: italic;
  opacity: 0.7;
  font-size: small;
}

.autocomplete-match-item-subscribers,
.autocomplete-match-item-age {
  opacity: 0.7;
}

.autocomplete-match-item-missing-data {
  color: var(--warning-color);
  margin-right: 8px;
}

.autocomplete-match-item-nsfw {
  color: #c88;
  margin-right: 8px;
}

.nsfw-select-label {
  font-size: small;
  color: var(--text-body-color);
  margin-right: 4px;
}

.nsfw-select {
  font-size: medium;
}

.click-to-fetch-data-wrapper,
.fetch-status-wrapper {
  display: flex;
  flex-direction: column;
}

.click-to-fetch-data-wrapper-small {
  margin-top: 8px;
}

.click-to-fetch-button {
  width: 200px;
  height: 48px;
  font-size: large;
  color: var(--button-color);
  background: var(--button-color-background);
  border-radius: 10px;
}

.loading-image {
  height: 200px;
  width: 200px;
  object-fit: contain;
}
.loading-image-subtext {
  font-size: x-small;
}

.queue-item {
  display: flex;
}

/* chatgpt wrote this*/
.loading-spinner {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 4px solid #ccc;
  border-top-color: #333;
  animation: spin 1s linear infinite;
  
  margin-right: 8px;
}

.click-to-fetch-button-small {
  color: var(--button-color);
  background: var(--button-color-background);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: large;
}

.request-error {
  color: var(--error-color);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

#main {
  display: flex;
  flex-direction: row;
  /* flex-direction: row-reverse; */
  justify-content: center;
}

/* home page */
.home-page-section {
  flex: 1 1 0;
  margin: 0 80px;
  min-width: 0;
  max-width: 1024px;
}

.home-page-welcome {
  font-size: xx-large;
}

.notable-subreddits-header {
  font-size: large;
  color: var(--text-header-color);
  font-family: var(--font-header);
  margin-bottom: 4px;
}


/* end home page */

.post-group-section {
  flex: 1.5 1 0;
  margin: 0 40px 0 0px;
  min-width: 0;
  max-width: 1024px;
}

.analytics-section {
  flex: 1 1 0;
  margin: 0 40px;
  min-width: 0;
  max-width: 800px;
}

.section-item {
  margin-bottom: 24px;
}

.section-item-key {
  font-size: x-large;
  color: var(--text-header-color);
  font-family: var(--font-header);
  margin-bottom: 4px;
}
.section-item-subtitle {
  font-family: var(--font-body);
  color: var(--text-body-color-secondary);
  font-size: small;
  margin-bottom: 4px;
}

.title-with-tooltip {
  display: inline-block;
  position: relative;
}
.title-help-tooltip-wrap {
  display: none;
  position: absolute;
  pointer-events: none;

  width: 320px;
  padding: 8px;
  background-color: var(--button-color-background);
  border-radius: 8px;

  top: 32px;
  left: 0;
  z-index: 1;
}

.title-with-tooltip:hover {
  text-decoration: underline;
}

.title-with-tooltip:hover .title-help-tooltip-wrap {
  display: block;
  animation: fadeIn 0.5s;
}

@keyframes fadeIn {
  0% { opacity: 0; }
  70% { opacity: 0; }
  100% { opacity: 1; }
}

.title-help-tooltip {
  display: inline;
  font: var(--font-body);
  color: var(--button-color);
  font-size: medium;
  white-space: pre-wrap;
}

.about-value {
  font-size: medium;
}

.timezone-picker {
  font-size: small;
  opacity: 1;
}

.show-more-button {
  cursor: pointer;
}
.show-more-button:hover {
  text-decoration: underline;
}

.subs-list-item {
  display: inline-block;
  margin-right: 16px;
}

.sub-link-wrapper {
  position: relative;
  display: inline-block;
}

.sub-link {
  font-size: medium;
  text-decoration: none;
}

@keyframes fadeIn {
  0% { opacity: 0; }
  50% { opacity: 0; }
  100% { opacity: 1; }
}

.sub-link-hover-text-wrapper {
  animation: fadeIn 0.4s;
  position: absolute;
  color: var(--text-body-color);
  font-size: small;
  left: 0;
  top: 28px;
  width: 300px;
  z-index: 1;
  background: var(--button-color-background);
  padding: 8px;
}

.sub-link-wrapper .sub-link-hover-title {
  margin-bottom: 4px;
  font-style: italic;
}

.sub-link-wrapper .sub-link-hover-secondary {
  color: var(--text-body-color);
}

.sub-link-wrapper .nsfw {
  color: #c88;
  margin-right: 8px;
}

.snapshot-timestamp {
  margin-left: 8px;
  font-size: small;
  color: var(--text-body-color-secondary);
}

select {
  background: var(--button-color-background);
  color: var(--button-color);
  border: 1px solid var(--color-border);
}

/* posts section */
.post-group-header {
  font-size: x-large;
  font-weight: lighter;
  color: var(--text-header-color);
  margin-bottom: 8px;
  margin-top: 40px;
  font-family:'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
}

.post-group-header[year-only] {
  font-size: xxx-large;
  margin-top: 60px;
}

.post-group-header[index="0"] {
  margin-top: 0px !important;
}

.posts {
  position: relative;
}

.post-sort-buttom {
  position: absolute;
  top: 0;
  right: 0;
  cursor: pointer;
  color: var(--href-color);
  font-size: small;
  padding: 4px;
  margin: 0px;
  background: var(--button-color-background);
  border-radius: 4px;
  display: flex;
  align-items: center;
}

.post-sort-buttom:hover {
  background: var(--button-color-background-hover);
}

.sort-icon {
  display: inline-block;
  margin: 0 5px;
}
.sort-icon-line {
  display: block;
  height: 2px;
  background-color: var(--href-color);
  margin: 3px 0;
}
.sort-icon .short {
  width: 8px;
}
.sort-icon .medium {
  width: 12px;
}
.sort-icon .long {
  width: 16px;
}

.posts .post {
  margin-bottom: 16px;
}

.post .post-top {
  position: relative;
  display: flex;
  align-items: start;
}

.post .post-left {
  flex: 0 0 70px;
  margin-right: 12px;
}

.post .post-thumb {
  display: block;
  margin-top: 4px;
  height: auto;
  width: 100%;
}

.posts .posts-title {
  display: inline;
}

.posts .title {
  font-size: large;
  font-weight: normal;
}

.posts .posts-bottom {
  margin-top: 4px;
  display: flex;
  align-items: center;
  
  color: var(--text-body-color-secondary);
}

.posts .posts-bottom a[href] {
  color: var(--href-color-secondary);
}
.posts .posts-bottom a[href]:visited {
  color: var(--href-color-secondary-visited);
}

.post .expand {
  position: relative;
  overflow: hidden;
  user-select: none;
  background-color: var(--button-color-background);
  border-radius: 4px;
  height: 28px;
  width: 28px;
  cursor: pointer;
  margin-right: 8px;
}

.post .expand.triangle .expand-div1 {
  width: 0;
  height: 0;
  border-left: 16px solid var(--text-body-color);
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  position: absolute;
  left: 8px;
  top: 6px;
}

.post .expand.minus .expand-div1 {
  width: 16px;
  height: 4px;
  background-color: var(--text-body-color);
  position: absolute;
  left: 6px;
  top: 12px;
}

.post .expand.plus div {
  background-color: var(--text-body-color);
  position: absolute;
  left: 6px;
  top: 6px;
}
.post .expand.plus .expand-div1 {
  width: 16px;
  height: 4px;
  top: 12px;
}  
.post .expand.plus .expand-div2 {
  width: 4px;
  height: 16px;
  left: 12px;
}

.post .expand:hover {
  background-color: var(--button-color-background-hover);
}

.posts .posts-bottom-right {
  font-size: small;
}

.posts .posts-bottom-right > * {
  margin-right: 8px;
  display: inline-block;
}
.posts .posts-bottom-right > *:last-child {
  margin-right: 0px;
}


.post .invisible-click-target {
  display: none;
}

.posts a {
  text-decoration: none;
}

.post .flair {
  font-size: small;
  border-radius: 2px;
  padding: 2px;
  display: inline-block;
}

.post .nsfw {
  color: #c88;
}

.post .self-post-content {
  font-size: medium;
  outline: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 4px;
  margin: 8px 0;
  overflow: auto;
  white-space: pre-wrap;
  /* max-height: 100px; */
  /* display: inline-block; */
}

.post .post-gallery-image-index {
  margin-bottom: 8px;
}

.post .post-gallery-image-index a,
.post .post-gallery-image-index span {
  margin-right: 12px;
}

.post .post-gallery-image-index span {
  background: var(--text-body-color);
  color: var(--background-color);
}

.post-image,
.post-gallery-wrap,
.post-video {
  margin-top: 8px;
}

.post .post-image,
.post .post-video,
.post .post-gallery-image {
  max-width: 100%;
}

.post .post-gallery-image,
.post .post-video {
  max-height: 90vh;
}

.post .selftext-heading,
.post .comments-heading {
  font-size: x-large;
  margin-top: 8px;
  padding: 0 0px;
  color: var(--href-color-secondary);
  font-family: var(--font-header);
}

.post .post-comments {
  /* outline: 1px solid var(--color-border); */
  border-radius: 4px;
  /* padding: 0 4px 4px 4px; */
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
}

.post .post-comments,
.post .self-post-content {
  background: var(--background-secondary);
}

.post .post-expandable {
  margin-bottom: 48px;
}

.post-comment ~ .post-comment {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed var(--color-border);
}

.post-comment-top {
  font-size: small;
  color: var(--text-body-color-secondary);
}
.post-comment-top > * {
  margin-right: 8px;
}
.post-comment-top > *:last-child {
  margin-right: 0;
}

.post-comment-top a[href] {
  color: var(--href-color-secondary);
}
.post-comment-top a[href]:visited {
  color: var(--href-color-secondary-visited);
}
.post-comment-bottom {
  white-space: pre-wrap;
  overflow: auto;
  color: var(--text-body-color);
}

/* heat map*/
.heat-map-row {
  display: flex;
}

.heat-map-hour-of-day,
.heat-map-day-of-week {
  color: var(--font-body);
  display: inline-block;
  font-size: x-small;
}

.heat-map-day-of-week {
  width: 30px;
  vertical-align: top;
}

.heat-map-box {
  width: 3.5%;
}
.heat-map-hour-of-day {
  width: 7%;
}

.heat-map-box {
  display: inline-block;
  aspect-ratio: 1/1;
  position: relative;
}
.heat-map-box-tooltip {
  display: none;
  position: absolute;
  pointer-events: none;
}

.heat-map-box:hover {
  outline: 2px solid var(--href-color-hover);
  z-index: 1;
}

.heat-map-box:hover .heat-map-box-tooltip{
  display: flex;
  align-items: center;
  justify-content: start;
  width: 240px;
  height: 28px;
  padding: 8px;
  border-radius: 8px;
  font: var(--font-body);
  color: var(--button-color);
  font-size: medium;

  left: -120px;
  bottom: 24px;
  background-color: var(--button-color-background);
  z-index: 1;
}

/* footer */

.footer {
  border-top: 1px solid var(--color-border);
  font-size: x-small;
  margin-top: 20px;
  height: 18px;
}
/* 
#time-info {
  margin-top: 3px;
}

#time-info a,
#time-info span {
  margin-right: 5px;
  color: #000;
  font-size: 14px;
} */

.floaty-wrapper {
  display: none;
}

@media (max-width:896px)  {
  #main {
    flex-direction: column;
  }

  .home-page-section,
  .analytics-section,
  .post-group-section {
    flex: 0;
    margin: 0;
  }

  .posts .post {
    margin: 0px 4px;
    border-bottom: 1px solid var(--color-border);
  }

  .posts .post-top {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .post-group-header[year-only],
  .post-group-header {
    margin-top: 16px;
    margin-bottom: 0;
    padding: 0 4px;
  }
  
  .post .invisible-click-target {
    display: block;
    z-index: 0;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    position: absolute;
  }

  .post .invisible-click-target:active {
    background-color: #888;
    opacity: 0.05;
  }

  .post a[href] {
    z-index: 1;
    position: relative;
  }

  .posts .posts-bottom {
    display: block;
  }
  .post .posts-bottom-left,
  .post .posts-bottom-right {
    display: inline;
  }

  .post .posts-bottom-left {
    position: relative;
    top: 3px;
  }

  .post .expand {
    display: inline-block;
    background-color: var(--color-border);
    border-radius: 2px;
    height: 14px;
    width: 14px;
    cursor: pointer;
    margin-right: 4px;
  }

  .post .post-expandable {
    margin-bottom: 0;
  }
  
  .post .expand.triangle .expand-div1 {
    width: 0;
    height: 0;
    border-left: 8px solid var(--text-body-color);
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    position: absolute;
    left: 4px;
    top: 3px;
  }
  
  .post .expand.minus .expand-div1 {
    width: 8px;
    height: 2px;
    background-color: var(--text-body-color);
    position: absolute;
    left: 3px;
    top: 6px;
  }
  
  .post .expand.plus div {
    background-color: var(--text-body-color);
    position: absolute;
    left: 3px;
    top: 6px;
  }
  .post .expand.plus .expand-div1 {
    width: 8px;
    height: 2px;
    top: 6px;
  }  
  .post .expand.plus .expand-div2 {
    width: 2px;
    height: 8px;
    left: 6px;
    top: 3px;
  }

  .floaty-wrapper {
    display: flex;
    flex-direction: column;
    z-index: 1;
    opacity: 0.5;
    display: block;
    position: fixed;
    bottom: 8px;
    left: 8px;
  }

  .floaty-button {
    width: 64px;
    height: 64px;
    border-radius: 25%;
    position: relative;
    /* outline: 2px solid var(--color-border); */
    background: var(--button-color-background);

    /*remove blue highlight on mobile */
    user-select: none;
    /* outline: none !important; */
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0) !important;
    -webkit-focus-ring-color: rgba(255, 255, 255, 0) !important;
  }

  .floaty-button.touchdown {
    background: var(--button-color-background-hover);
    opacity: 0.8;
    cursor: pointer;
  }

  .triangle-down {
    width: 0;
    height: 0;
    position: absolute;
    left: 50%;
    transform: translate(-50%, -50%); 
  }

  .triangle-down {
    top: 55%;
    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    border-top: 18px solid var(--button-color);
  }
}