/* Global typography & color */
html {
  height: 100%;
}

body {
  font-family: "Trebuchet MS", Helvetica, sans-serif;
  color: #ddd;
  position: relative;
  background: #000 url('../images/bg3.svg') repeat fixed top left;
  min-height: 100%;
  margin: 0;
  padding: 0;
  padding-top: 4rem;
  padding-bottom: 4rem;
  display: flex;
  flex-direction: column;
}

body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  pointer-events: none;
  z-index: 0;
}

#main, header, #footer, .announce, .privacy, .games-list, #gameSearch, #reset-password {
  position: relative;
  z-index: 1;
}

.modal-content {
  background-color: #111 !important;
  border: 1px solid #aaa;
}

#main {
  flex: 1 0 auto;
}

#reset-password {
  width: 40%;
  background: #111;
  border: 1px solid #aaa;
  border-radius: 8px;
  padding: 1rem 1rem;
}

.navbar {
  width: 100%;
  position: fixed;
  margin-bottom: 3em;
  z-index: 2;
  left: 0;
  top: 0;
}

.announce {
  color: #ddd;
  width: 50%;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 3rem;
  background: #080808;
  border: 1px solid #aaa;
  border-radius: 8px;
  padding: 1rem 1rem;
  text-align: center;
}

.announce h3 {
  text-align: center;
}

.privacy {
  color: #ddd;
  width: 50%;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 3rem;
  background: #080808;
  border: 1px solid #aaa;
  border-radius: 8px;
  padding: 1rem 1rem;
}

.privacy h3, .privacy h6 {
  text-align: center;
}

#gameSearch {
  width: 100%;
  margin: 0;
}

.navbar .search-container {
  width: 25%;
  max-width: 400px;
}

/* Keep search input and icon on one line */
.navbar .search-container .input-group {
  flex-wrap: nowrap;
}

/* Merge search input and icon borders */
.navbar .input-group .form-control {
  border-right: 0;
}
.navbar .input-group .input-group-text {
  border-left: 0;
}

#gameSearch::placeholder {
  color:#aaa;
}

/* Game block */
.game-block {
  width: 75%;
  margin: 0.5rem auto;
  background: #111;
  border: 1px solid #aaa;
  border-radius: 8px;
  overflow: hidden;
  max-height: 105px; /* initial height for collapsed state */
  transition: max-height 0.3s ease;
}

/* Expand animation */
.game-block.expanded {
  max-height: 500px; /* enough to show details */
}

/* Google and Steam sign-in buttons */
#g_id_signin, #steam_signin {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Bottom-left toast container */
#alert-container {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 1055;
}

/* And remove default margin from the alert so it hugs the corner */
#alert-container .alert {
  margin: 0;
}

/* Allow reset-password alerts to flow in the layout */
#reset-password #alert-container {
  position: static;
  bottom: auto;
  left: auto;
  z-index: auto;
}

#reset-password #alert-container .alert {
  margin-bottom: 1rem;
}

#footer {
  width: 100%;
  background: #080808;
  text-align: center;
  border-top: 1px solid #666;
  margin-top: 3em;
  padding: 0.375rem;
  position: fixed;
  left: 0;
  bottom: 0;
}

#footer p {
  color: #ccc !important;
  font-size: x-small;
}

/* Header row (collapsed) */
.header-row {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  cursor: pointer;
}
.header-row .cover {
  width: 212px;
  height: 80px;
  object-fit: cover;
  margin-right: 1rem;
}
.header-row .title {
  flex: 1;
  font-size: 1.25rem;
  margin: 0;
}
.header-row .majority-icon {
  width: 50px;
  height: 50px;
  margin-right: 1rem;
}

/* Details container: static visibility, part of block height */
.details {
  padding: 0 1rem 1rem;
}

/* Game info lines */
.game-info p {
  margin: 0.25rem 0;
}
.platform-icons i {
  margin-right: 0.5rem;
}

/* Vote row inside details */
.vote-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 0.75rem;
}

.count-label {
  font-size: 0.85rem;
  color: #ddd;
  text-align: center;
  margin-bottom: 0.5rem;
  width: 100%;
}

/* Row of [icon][bar][icon] */
.vote-section {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 0.5rem;
}

/* Let the bar flex to fill the space between icons */
.vote-section .vote-bar {
  flex: 1;
}

/* Vote icons */
.vote-icon {
  width: 50px;
  height: 50px;
  background-position: center;
  background-repeat: no-repeat;
  cursor: pointer;
  transition: filter 0.2s;
}

.vote-icon.kbm-icon { background-image: url('../icons/kbm-drkong.svg'); }
.vote-icon.controller-icon { background-image: url('../icons/controller-lgtong.svg'); }
.vote-icon:hover { filter: brightness(1.2); }
.vote-icon.active.kbm-icon { filter: drop-shadow(0 0 5px #ba6c06); }
.vote-icon.active.controller-icon { filter: drop-shadow(0 0 5px #fcba03); }

/* Vote bar */
.vote-bar {
  position: relative;
  flex: 1;
  height: 12px;
  background: #eee;
  border-radius: 6px;
  overflow: hidden;
  transition: background-color 0.3s ease;
}
.bar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  transition: width 0.3s ease;
}

.kbm-bar {
  left: 0; background: #ba6c06;
}

.controller-bar {
  right: 0; background: #fcba03;
}

.tick {
  position: absolute;
  top: -4px;
  width: 2px;
  height: 20px;
  background: #fff;
  transition: left 0.3s ease;
}
