/*!
 * Copyright (c) 2021-2022 Martin Denham, Tuomas Airaksinen and the AndBible contributors.
 *
 * This file is part of AndBible: Bible Study (http://github.com/AndBible/and-bible).
 *
 * AndBible is free software: you can redistribute it and/or modify it under the
 * terms of the GNU General Public License as published by the Free Software Foundation,
 * either version 3 of the License, or (at your option) any later version.
 *
 * AndBible is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with AndBible.
 * If not, see http://www.gnu.org/licenses/.
 */
.paragraphBreak {
  display: block;
  height: 0.5em;
}

.menu {
  position: absolute;
  [dir=ltr] & {
    right: 0;
  }
  [dir=rtl] & {
    left: 0;
  }

  top: -3px;
  &.isText {
    top: -15px;
  }
  z-index: 1;
}

.journal-button {
  cursor: pointer;
  z-index: 1;
  color: rgba(0, 0, 0, 0.5);
  .night & {
    color: rgba(255, 255, 255, 0.6);
  }
  margin: 2pt;
  padding: 7pt;
  &.toggled {
    color: #474747;
    &.light {
      color: #d5d5d5;
    }
  }
}

.note-container {
  min-height: 2em;
  position: relative;
  margin: 4pt 2pt 2pt;
  border-style: dashed;
  border-color: rgba(0, 0, 0, 0.15);
  .night & {
    border-color: rgba(255, 255, 255, 0.3);
  }
  border-width: 1pt 0 0 0;
  padding: 5pt 0 0 1pt;
}

.superscript {
  position: relative;
  vertical-align: top;
  font-size: 70%;
  top: -0.3em;
}

.visible-scrollbar {
  &::-webkit-scrollbar {
    height: 20%;
    width: 5px;
  }
  &::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, .3);
    .night & {
      background-color: rgba(255, 255, 255, .3);
    }
  };
  &::-webkit-scrollbar-track {
    background-color: rgba(0, 0, 0, 0.1);
    .night & {
      background-color: rgba(255, 255, 255, .1);
    }
  }
}

$button-border-radius: 8px;
$button-padding: 6px;
$button-grey: var(--modal-grey);

:root {
  --primary-color: #bdbdbd;
}

.button {
  font-size: 90%;
  background-color: $button-grey;
  border: none;
  color: white;
  padding: $button-padding;
  border-radius: $button-border-radius;
  margin: 2pt 2pt;
  min-width: 120px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  
  &.toggled {
    background-color: #474747;
    &.light {
      background-color: #d5d5d5;
    }
  }
  &.disabled {
    background-color: #bdbdbd;
    color: #616161;
  }
  &.light {
    background-color: #bdbdbd;
    color: black;
    .night & {
      background-color: #616161;
      color: #bdbdbd;
    }
    .night.monochrome & {
      color: white;
    }
  }
  &.warning {
    background: rgba(255, 0, 0, 0.5);
    color: black;
  }
  &.right {
    align-self: end;
  }
  &.small {
    min-width: unset;
  }
}

.separator {
  border-width: 1pt 0 0 0;
  border-style: dashed;

  height: 1pt;
  width: calc(100% - 10pt);
  margin: 10pt 5pt 5pt;
  border-color: rgba(0, 0, 0, 0.15);
  .night & {
    border-color: rgba(255, 255, 255, 0.3);
  }
}

.note-separator {
  @extend .separator;
  border-width: 0.5pt 0 0 0;
}

.modal-footer-buttons {
  display: flex;
  width: 100%;
  flex-wrap: wrap;
  justify-content: space-evenly;
}

.bookmark-buttons {
  display: flex;
  justify-content: flex-start;
}

:root {
  --modal-grey:  rgb(172,172,172);
  .monochrome {
    --modal-grey: rgb(76, 76, 76);
  }
}

$modal-header-background-color: var(--modal-grey);
$night-modal-header-background-color: rgba(69,69,69,1);

$modal-content-background-color: #fefefe;
$modal-content-background-color-night: rgb(33, 33, 33);

.highlight-transition {
  transition: background-color 0.5s ease;
  .noAnimation & {
    transition: none;
  }
}

.isHighlighted {
  background-color: rgba(0, 0, 0, 0.1);
  .monochrome & {
    background-color: rgba(0, 0, 0, 0.2);
  }
  .night & {
    background-color: rgba(255, 255, 255, 0.3);
  }
}

.one-liner {
  white-space: nowrap;
  text-overflow: ellipsis;
  width: 100%;
  overflow: hidden;
}
body {
  --label-text-white: white;
  --label-text-black: #353535;
  overflow-wrap: break-word;
}

.bookmarked {
  padding-bottom: 0.5em;
}

img {
  max-width: 100%;
}

pre {
  max-width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  table-layout: fixed;
}

.modal-backdrop {
  display: block;
  position: fixed;
  z-index: 10;
  padding-top: 10px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  .monochrome & {
    background-color: unset;
  }
  &.no-background {
    background-color: unset;
  }
}

// Memorize component shared styles
.memorize-controls {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  justify-content: flex-end;
  flex-wrap: wrap;
  
  @media (max-width: 400px) {
    justify-content: center;
  }
}

.memorize-text {
  line-height: 1.8;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  min-height: 3rem;
  transition: background-color 0.3s ease;
  
  .night & {
    background-color: rgba(255, 255, 255, 0.05);
  }
  
  .noAnimation & {
    transition: none;
  }
}

.memorize-word {
  position: relative;
  display: inline-block;
  margin-right: 0.25em;
  
  &.blurred {
    color: transparent;
    background-color: rgba(0, 0, 0, 0.2);
    .night & {
      background-color: rgba(255, 255, 255, 0.2);
    }
    border-radius: 3px;
    padding: 0 2px;
    cursor: pointer;
    user-select: none;
  }
  
  &.revealed {
    color: var(--text-color, inherit);
  }
}

// Prevent text selection on interactive elements
.button, 
.memorize-button, 
[role="button"],
.journal-button {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  
  &:active {
    user-select: none;
    -webkit-user-select: none;
  }
}


.large-action {
  cursor: pointer;
  min-width: 40px; // Ensures dynamic plus icon has sufficient space to be appended
  display: flex;
  flex-direction: row;

  .horizontal & {
    flex-direction: column;
    font-size: 60%;
    margin: 0 auto 0 auto;
  }

  .vertical & {
    @extend .light;
    @extend .button;
  }

  .fa-layers, .svg-inline--fa {
    //    padding-inline-end: 14px;  // Causes non-alignment of the icons in the verse action dialog.
    .horizontal & {
      color: $button-grey;
      .monochrome.night & {
        color: white;
      }
      margin: 0 auto 0 auto;
      padding-bottom: 5px;
      $size: 20px;
      width: $size;
      height: $size;
    }
  }

  .title {
    margin: 0 auto 0 auto;
    .monochrome.night & {
      color: white;
    }
  }

  padding-bottom: 0.5em;

  .horizontal & {
    .hasActions & {
      padding-bottom: 5px;
    }
  }
}

// Experimental Features Notice Styles
.experimental-notice {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 4px;
  padding: 12px;

  .night & {
    background: #2d2416;
    border-color: #4a3d1b;
  }
}

.experimental-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.experimental-icon {
  color: #856404;
  font-size: 16px;

  .night & {
    color: #ffeaa7;
  }
}

.experimental-title {
  font-weight: 600;
  color: #856404;

  .night & {
    color: #ffeaa7;
  }
}

.help-button {
  margin-left: auto;
  padding: 4px 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #6c757d;
  font-size: 14px;
  border-radius: 2px;
  transition: all 0.2s ease;

  .night & {
    color: #adb5bd;
  }

  &:hover {
    background: rgba(108, 117, 125, 0.1);
    color: #495057;

    .night & {
      background: rgba(173, 181, 189, 0.1);
      color: #ced4da;
    }
  }
}

.experimental-description {
  margin: 0;
  font-size: 13px;
  color: #6c4a00;
  line-height: 1.4;

  .night & {
    color: #d1b656;
  }
}