/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

 /* elements */

 html {
  --background-color: #f2f1f2;
  --background-color-header-footer: #fff;
  --line-color: #ebeaeb;
  --primary-font-color: #171614;
  --primary-font-color-tint: #5c5b5a;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  width: 100%;
  min-height: 100vh;
  font-size: 1.125rem;
  color: var(--primary-font-color);
  background-color: var(--background-color);
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: start;
  justify-content: start;
}

header {
  width: 100%;
  min-height: 4rem;
  padding: 0;
  background-color: var(--background-color-header-footer);
  z-index: 50;
  position: sticky;
  top: 0;
  font-size: 1.3rem;
  font-weight: 200;
  align-content: center;

  .settings a {
    font-size: 1.1rem;
    text-decoration: none;
    font-weight: 500;
  }
}

header > div {
  max-width: 80rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  margin: auto;
  padding: 0 1.5rem;
}

main {
  width: 100%;
  min-height: calc(100vh - 17rem);
  margin: 3rem 0;
}

main > div {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

footer {
  display: flex;
  background-color: var(--background-color-header-footer);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 2rem 3rem;
  box-sizing: border-box;
  gap: 1rem;

  .terms {
    display: flex;
    flex-direction: row;
    gap: 1rem;
  }

}

/* form {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
} */

input[type=email] {
  font-size: 1rem;
  padding: 0.8rem 1rem;
  width: 100%;
  border-radius: 0.3rem;
  border: 0.1rem solid var(--line-color);
  box-sizing: border-box;
}

input[type=url] {
  font-size: 1rem;
  padding: 0.8rem 1rem;
  width: 100%;
  border-radius: 0.3rem;
  border: 0.1rem solid var(--line-color);
  margin: auto;
  box-sizing: border-box;
}

input[type=number] {
  font-size: 1rem;
  padding: 0.8rem 1rem;
  width: 100%;
  border-radius: 0.3rem;
  border: 0.1rem solid var(--line-color);
  margin: auto;
  box-sizing: border-box;
}

input[type=submit] {
  font-size: 1rem;
  border: 0.1rem solid black;
  color: #fff;
  padding: 0.8rem 3rem;
  background-color: #171614;
  border-radius: 0.3rem;
  cursor: pointer;
}

input[type=range] {
	-webkit-appearance: none;
	border-radius: 0.1rem;
	box-shadow: none;
	background-color: var(--line-color);
	height: 0.3rem;
  align-self: center;
  cursor: pointer;
}

input[type=range]::-webkit-slider-thumb {
	-webkit-appearance: none !important;
	border-radius: 0.1rem;
	background-color: #000;
	border: none;
	height: 1rem;
	width: 1rem;
}

input[type='range']::-moz-range-thumb {
	-moz-appearance: none;
	border-radius: 0.1rem;
	background-color: #000;
	border: none;
	height: 1rem;
	width: 1rem;
}

input::placeholder {
  opacity: 0.5;
}

/* text */

h1 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  margin-top: 1rem;
}

h2 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  margin-top: 1rem;
}

a {
  color: var(--primary-font-color);
}

a:hover {
  color: var(--primary-font-color-tint);
}

blockquote {
  background-color: var(--background-color);
  border-left: 0.25rem solid var(--line-color);
  margin: 1rem 0;
  padding: 1rem 1.5rem;
  border-radius: 0.3rem;
  font-style: italic;
  color: var(--primary-font-color-tint);

  p {
    margin: 0;
  }
}

/* classes */

.header-logo {
  display: flex;
  text-decoration: none;
  align-items: center;
  gap: 15px;
}

.logo {
  width: 40px;
}

.line-bottom {
  border-bottom: 0.1rem solid var(--line-color);
}

.line-top {
  border-top: 0.1rem solid var(--line-color);
}

.container {
  background-color: #fff;
  border-radius: 0.5rem;
  padding: 2rem;
  margin-bottom: 3rem;
}

form.generate-chapters {
  display: flex;
  flex-direction: column;
  justify-content: start;
  gap: 1rem;
  margin-bottom: 1.5rem;

  div {
    display: flex;
    flex-direction: row;
    justify-content: start;
    gap: 0.5rem;
    flex-basis: 100%;

    div {
      display: flex;
      flex-direction: column;
      justify-content: start;
      gap: 1rem;
    }

    div:first-child {
      flex-basis: 100%;
    }

    div:nth-child(2) {
      flex-basis: 20rem;
    }
  }

  input[type=submit] {
    width: 23.5rem;
  }
}

.settings-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.setting {
  display: flex;
  align-content: center;
  gap: 1rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 16rem;
}

.login-form > div {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.login-form input[type=submit] {
  width: 100%;
}

.login-form label {
  font-size: 1rem;
  font-weight: 600;
}

.flash-container {
  position: fixed;
  display: flex;
  top: 0;
  inset-inline: 0;
  z-index: 50
}

.flash-container > div {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  padding: 1.3rem 1rem;
  width: 100%;
}

.flash-notice {
  background-color: #9DDBAD;
}

.flash-alert {
  background-color: #F7AF9D;
}

.flash-notice > div {
  width: 95%;
  text-align: center;
}

.chapters-container {
  .loading-container {
    display: none;
  }
}

.chapters-container:has(#chapters-list:empty) .loading-container {
  display: flex;
  flex-direction: column;
  justify-content: start;
  align-items: start;
  gap: 2rem;
  width: 40rem;
}

ul.chapter-list {
  margin-top: 0;
}

.video-title-container {
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
  max-width: 45rem;
  width: 100%;
  justify-content: center;
  align-items: center;

  > a {
    flex: 0 0 14rem;
    height: 7.875rem;
  }

  img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.4rem;
  }

  h3 {
    margin: 0;
    margin-bottom: 0.4rem;
  }

  div {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
  }

  a {
    text-decoration: none;
  }
}

.chapter-list {
  padding: 0;

  > li {
    list-style: none;
    font-size: 1.2rem;

    turbo-frame {
      display: flex;
      flex-direction: row;
      justify-content: start;
      align-items: center;
      gap: 1rem;

      .chapter-list__chapter-start {
        width: 6.5rem;
        font-family: 'Anonymous Pro';
      }
    }

    a {
      font-size: 1rem;
    }
  }

  > li + li {
    margin-top: 1rem;
  }
}

.chapter-edit-form, .chapter-new-form {
  display: flex;
  flex-direction: row;
  justify-content: start;
  align-items: center;
  margin-left: -0.7rem;
  margin-bottom: -0.46rem;
  margin-top: -0.46rem;

  input[type=text] {
    font-size: 1.2rem;
    height: 2.4rem;
    padding: 0 0.6rem;
    border-radius: 0.3rem;
    border: 0.1rem solid var(--line-color);
    box-sizing: border-box;
  }

  input[id="chapter_start_time"] {
    text-indent: 0.5px;
    width: 6.7rem;
    font-family: 'Anonymous Pro';
    margin-right: 0.8rem;
  }

  input[id="chapter_title"] {
    flex: 0 0 30rem;
  }

  input[type=submit] {
    font-size: 1rem;
    border: 0.1rem solid black;
    color: #fff;
    padding: 0rem 3rem;
    height: 2.3rem;
    background-color: #171614;
    border-radius: 0.3rem;
    cursor: pointer;
    margin-left: 1rem;
    margin-right: 0.8rem;
  }
}

.chapter-new-form {
  margin-left: -0.7rem;
  margin-bottom: -0.46rem;
  margin-top: 0.46rem;

}

.chapters-title-container {
  display: flex;
  flex-direction: row;
  justify-content: start;
  align-items: center;
  gap: 0.7rem;

  margin-bottom: 0.75rem;
  margin-top: 1rem;


  h1 {
    margin: 0;
  }

  button {
    /* remove default button styling */
    background: none;
    color: inherit;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
    outline: inherit;
    text-decoration: underline;
  }

  button:hover {
    color: var(--primary-font-color-tint);
  }
}

turbo-frame#contents_history {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.contents-history-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;

  a {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    text-decoration: none;

    div {
      display: flex;
      flex-direction: column;
      gap: 0.5rem;

    :first-child {
      font-weight: 500;
    }
    }
  }

  img {
    flex: 0 0 14rem;
    height: 7.875rem;
    object-fit: cover;
    border-radius: 0.4rem;
  }
}

.page-header {
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: end;
}

/* utlity classes */

.loader {
  width: 48px;
  height: 48px;
  border: 5px solid var(--primary-font-color);
  border-bottom-color: transparent;
  border-radius: 50%;
  display: inline-block;
  box-sizing: border-box;
  animation: rotation 1s linear infinite;
  margin-right: auto;
  margin-left: auto;
}

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

/* fonts */
/* anonymous-pro-regular - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Anonymous Pro';
  font-style: normal;
  font-weight: 400;
  src: url("/assets/anonymous-pro-v21-latin-regular-904c8d86.woff2") format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}


