@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');

:root {
  --primary-color: #391247;
  --secondary-color: #9747FF;
  --bg-accent-color: #747371;
  --bg-color: #fbf8f5;
}

body {
  background: var(--bg-color);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  padding: 10px;
  margin: 0;
  min-height: calc(100vh - 20px);
  display: grid;
  grid-template-rows: auto 1fr auto;
}

header {
  display: flex;
  flex-direction: column;
  align-items: center;
}

main {
  display: flex;
  flex-direction: column;
  align-items: center;
}

footer {
  color: var(--bg-accent-color);
  text-align: center;
}

footer a {
  color: var(--secondary-color);
}

body h1 {
  font-family: "Montserrat", sans-serif;
  font-weight: normal;
  text-align: center;
  letter-spacing: 3px;
}

body h1 strong {
  font-weight: 500;
}

body h2 {
  font-family: "Montserrat", sans-serif;
  margin-top: -10px;
  font-weight: 300;
  text-align: center;
}

.search-container {
  background-color: white;
  max-width: 400px;
  height: 30px;
  padding: 2px;
  border-radius: 10px;
  border: 2px solid lightgrey;
  cursor: text;
  display: flex;
  transition: all 0.2s ease;
}

.search-container:focus-within {
  border: 2px solid var(--secondary-color);
}

input {
  color: rgba(0, 0, 0, .87);
  outline-color: none;
  background-color: transparent;
  border: none;
  height: 100%;
  flex-grow: 1;
  font-size: 16px;
  padding: 10px;
}

input:focus {
  outline: none;
}

#loading {
  display: flex;
  align-items: center;
}

.search-icon {
  max-width: 15px;
  margin: 0px 15px;
}

.spinner {
  max-width: 15px;
  margin: 0px 15px;
}

.htmx-indicator {
  display: none;
}

.search-icon.htmx-indicator {
  display: inline;
  opacity: 1;
}

.htmx-request .search-icon {
  display: none;
  opacity: 0;
}

.htmx-request .spinner {
  display: inline;
}

.results-fail,
.search-error {
  color: grey;
  margin-top: 5px;
}

a {
  text-decoration: none;
  color: black;
}

#results-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 10px;
  padding: 0 10px;
}

ul {
  list-style: none;
  padding: 0;
}

ul li {
  margin-top: 15px;
}

#quick-start {
  border: 3px solid #e7e4e2;
  border-radius: 10px;
  padding: 2rem 5rem;
  text-align: center;
}

#quick-start li:first-child {
  margin-top: 0;
}

#quick-start .description {
  color: var(--bg-accent-color);
  font-weight: 600;
}

#quick-start .example {
  font-size: 0.9rem;
  color: var(--primary-color);
}

.result-container {
  display: grid;
  grid-template-columns: 2fr 10fr;
  background: white;
  border-radius: 7px;
  max-width: 800px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  position: relative;
  top: 0;
  transition: all 0.1s ease-in;
}

.result-container:hover {
  top: -2px;
  box-shadow: 0 4px 5px rgba(0, 0, 0, 0.3);
}

.image-container {
  grid-column: 1;
  grid-row: 1 / 3;
  max-width: 200px;
  min-width: 100px;
  flex: none;
  padding: 3px;
  align-self: start;
}

.intrinsic {
  display: block;
  position: relative;
  height: 0;
  width: 100%;
  /* aspect ratio (height / width) for youtube thumbnail */
  padding-top: 75%;
  background: #f0f0f0;
  border-radius: 9px;
}

.intrinsic-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 9px;
}

.title {
  grid-column: 2;
  color: var(--primary-color);
  font-size: 0.9rem;
  font-weight: 600;
  margin: 5px;
}

.video-details {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  overflow: hidden;
}

.snippet {
  font-size: 0.85rem;
  margin: 5px;
  margin-top: -2px;
  flex-grow: 1;
  overflow: scroll;
}

.matches-count {
  display: flex;
  justify-content: end;
  font-size: 0.8rem;
  color: grey;
  margin-right: 5px;
}

mark {
  background: #CBBDDC;
}


@media only screen and (max-width: 600px) {
  .title {
    grid-column: 1 / 3;
    grid-row: 1;
  }
  .image-container {
    grid-column: 1;
    grid-row: 2;
  }
  .video-details {
    grid-column: 2;
    grid-row: 2;
  }
}

.pagination {
  display: inline-block;
}

.pagination a {
  background-color: white;
  color: black;
  float: left;
  padding: 8px 16px;
  text-decoration: none;
  border: 1px solid #ddd;
  transition: all 0.2s ease-out;
}

.pagination .disabled {
  opacity: 0.6;
  background-color: #e0e0e0;
  color: #a0a0a0;
  cursor: default;
}

.pagination a.active {
  background-color: var(--secondary-color);
  color: white;
  border: 1px solid var(--secondary-color);
  cursor: default;
}

.pagination a:hover:not(.active):not(.disabled) {
  background: #CBBDDC;
  border-color: #CBBDDC;
  cursor: pointer;
}

.pagination a:first-child {
  border-top-left-radius: 5px;
  border-bottom-left-radius: 5px;
}

.pagination a:last-child {
  border-top-right-radius: 5px;
  border-bottom-right-radius: 5px;
}


