@tailwind base;
@tailwind components;
@tailwind utilities;

@keyframes heart-pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.4); }
  60% { transform: scale(0.9); }
  100% { transform: scale(1); }
}
.heart-pop {
  animation: heart-pop 0.35s ease;
}

.card-perspective {
  perspective: 1600px;
}
.card-inner {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.7s;
}
.card-inner.flipped {
  transform: rotateY(180deg);
}
.card-face {
  backface-visibility: hidden;
  width: 100%;
}
.card-face.card-back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
}

@keyframes card-wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-3deg); }
  75% { transform: rotate(3deg); }
}
.card-wiggle {
  animation: card-wiggle 0.6s ease;
}

@keyframes flash-enter {
  0% { opacity: 0; transform: translateY(-12px); }
  100% { opacity: 1; transform: translateY(0); }
}
.flash-enter {
  animation: flash-enter 0.25s ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .flash-enter { animation: none; }
}

@keyframes card-pop-shake {
  0% { transform: scale(1) rotate(0deg); }
  20% { transform: scale(1.05) rotate(-4deg); }
  40% { transform: scale(1.05) rotate(4deg); }
  60% { transform: scale(1.05) rotate(-3deg); }
  80% { transform: scale(1.05) rotate(3deg); }
  100% { transform: scale(1.05) rotate(0deg); }
}
.hover-shake:hover {
  animation: card-pop-shake 0.4s ease forwards;
}
@media (prefers-reduced-motion: reduce) {
  .hover-shake:hover { animation: none; }
}

/*

@layer components {
  .btn-primary {
    @apply py-2 px-4 bg-blue-200;
  }
}

*/
/*!
 * Cropper.js v1.6.2
 * https://fengyuanchen.github.io/cropperjs
 *
 * Copyright 2015-present Chen Fengyuan
 * Released under the MIT license
 *
 * Date: 2024-04-21T07:43:02.731Z
 */

.cropper-container {
  direction: ltr;
  font-size: 0;
  line-height: 0;
  position: relative;
  -ms-touch-action: none;
      touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
}

.cropper-container img {
    backface-visibility: hidden;
    display: block;
    height: 100%;
    image-orientation: 0deg;
    max-height: none !important;
    max-width: none !important;
    min-height: 0 !important;
    min-width: 0 !important;
    width: 100%;
  }

.cropper-wrap-box,
.cropper-canvas,
.cropper-drag-box,
.cropper-crop-box,
.cropper-modal {
  bottom: 0;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.cropper-wrap-box,
.cropper-canvas {
  overflow: hidden;
}

.cropper-drag-box {
  background-color: #fff;
  opacity: 0;
}

.cropper-modal {
  background-color: #000;
  opacity: 0.5;
}

.cropper-view-box {
  display: block;
  height: 100%;
  outline: 1px solid #39f;
  outline-color: rgba(51, 153, 255, 0.75);
  overflow: hidden;
  width: 100%;
}

.cropper-dashed {
  border: 0 dashed #eee;
  display: block;
  opacity: 0.5;
  position: absolute;
}

.cropper-dashed.dashed-h {
    border-bottom-width: 1px;
    border-top-width: 1px;
    height: calc(100% / 3);
    left: 0;
    top: calc(100% / 3);
    width: 100%;
  }

.cropper-dashed.dashed-v {
    border-left-width: 1px;
    border-right-width: 1px;
    height: 100%;
    left: calc(100% / 3);
    top: 0;
    width: calc(100% / 3);
  }

.cropper-center {
  display: block;
  height: 0;
  left: 50%;
  opacity: 0.75;
  position: absolute;
  top: 50%;
  width: 0;
}

.cropper-center::before,
  .cropper-center::after {
    background-color: #eee;
    content: ' ';
    display: block;
    position: absolute;
  }

.cropper-center::before {
    height: 1px;
    left: -3px;
    top: 0;
    width: 7px;
  }

.cropper-center::after {
    height: 7px;
    left: 0;
    top: -3px;
    width: 1px;
  }

.cropper-face,
.cropper-line,
.cropper-point {
  display: block;
  height: 100%;
  opacity: 0.1;
  position: absolute;
  width: 100%;
}

.cropper-face {
  background-color: #fff;
  left: 0;
  top: 0;
}

.cropper-line {
  background-color: #39f;
}

.cropper-line.line-e {
    cursor: ew-resize;
    right: -3px;
    top: 0;
    width: 5px;
  }

.cropper-line.line-n {
    cursor: ns-resize;
    height: 5px;
    left: 0;
    top: -3px;
  }

.cropper-line.line-w {
    cursor: ew-resize;
    left: -3px;
    top: 0;
    width: 5px;
  }

.cropper-line.line-s {
    bottom: -3px;
    cursor: ns-resize;
    height: 5px;
    left: 0;
  }

.cropper-point {
  background-color: #39f;
  height: 5px;
  opacity: 0.75;
  width: 5px;
}

.cropper-point.point-e {
    cursor: ew-resize;
    margin-top: -3px;
    right: -3px;
    top: 50%;
  }

.cropper-point.point-n {
    cursor: ns-resize;
    left: 50%;
    margin-left: -3px;
    top: -3px;
  }

.cropper-point.point-w {
    cursor: ew-resize;
    left: -3px;
    margin-top: -3px;
    top: 50%;
  }

.cropper-point.point-s {
    bottom: -3px;
    cursor: s-resize;
    left: 50%;
    margin-left: -3px;
  }

.cropper-point.point-ne {
    cursor: nesw-resize;
    right: -3px;
    top: -3px;
  }

.cropper-point.point-nw {
    cursor: nwse-resize;
    left: -3px;
    top: -3px;
  }

.cropper-point.point-sw {
    bottom: -3px;
    cursor: nesw-resize;
    left: -3px;
  }

.cropper-point.point-se {
    bottom: -3px;
    cursor: nwse-resize;
    height: 20px;
    opacity: 1;
    right: -3px;
    width: 20px;
  }

@media (min-width: 768px) {

.cropper-point.point-se {
      height: 15px;
      width: 15px;
  }
    }

@media (min-width: 992px) {

.cropper-point.point-se {
      height: 10px;
      width: 10px;
  }
    }

@media (min-width: 1200px) {

.cropper-point.point-se {
      height: 5px;
      opacity: 0.75;
      width: 5px;
  }
    }

.cropper-point.point-se::before {
    background-color: #39f;
    bottom: -50%;
    content: ' ';
    display: block;
    height: 200%;
    opacity: 0;
    position: absolute;
    right: -50%;
    width: 200%;
  }

.cropper-invisible {
  opacity: 0;
}

.cropper-bg {
  background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC');
}

.cropper-hide {
  display: block;
  height: 0;
  position: absolute;
  width: 0;
}

.cropper-hidden {
  display: none !important;
}

.cropper-move {
  cursor: move;
}

.cropper-crop {
  cursor: crosshair;
}

.cropper-disabled .cropper-drag-box,
.cropper-disabled .cropper-face,
.cropper-disabled .cropper-line,
.cropper-disabled .cropper-point {
  cursor: not-allowed;
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

/* === BODY === */ 

.navbar, .btm-nav {
    min-height: 3.5rem !important;
    max-height: 3.5rem !important;
}

.table-row-section-title {
    text-align: center;
    text-transform: uppercase;
}

thead.table-row-header {
    font-size: medium;
}

/* Make autofill text on input fields transparent instead of mustard-yellow */
input:-webkit-autofill,
input:-webkit-autofill:focus {
    transition: background-color 600000s 0s, color 600000s 0s;
}
input[data-autocompleted] {
    background-color: transparent !important;
}

#total-points-stat {
    --tw-border-opacity: 0 !important;
    border-right-width: 0px !important;
}

.p-b-4rem {
    padding-bottom: 4rem;
}

#todays-habits-sticky-point-bar {
    --tw-bg-opacity: 1;
    background-color: var(--fallback-b1,oklch(var(--b1)/var(--tw-bg-opacity)));
    position: sticky;
    padding-top: 0.5rem;
    top: 0;
    width: 100%;
    z-index: 1;
}

#dashboard-todays-statistics-point-bar {
    --tw-bg-opacity: 1;
    background-color: var(--fallback-b1,oklch(var(--b1)/var(--tw-bg-opacity)));
    text-align: center;
    width: 100%;
}

.text-right {
    text-align: right;
}

.pr-4 {
    padding-right: 1rem;
}

.prose {
    max-width: 100%;
}

.prose p {
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
}

.prose p.m-0 {
    margin-top: 0;
    margin-bottom: 0;
    margin-right: 0;
    margin-left: 0;
}

.mt-minus-2 {
    margin-top: -0.5rem;
}

.h-full {
    height: 100%;
}

td.no-padding {
    padding: 0 !important;
    a {
        padding: 0.5rem 1rem;
    }
}

/* Study accordion More / Less (Preview / Full) button styles */
.summary-preview {
    height: 1.5rem;
    overflow: hidden;
  }
.summary-full {
    padding-top: 10px;
}

.tabs-boxed {
    border-radius: 0;
}
.to-bg-primary {
    --tw-bg-opacity: 1;
    --tw-gradient-to: oklch(var(--b1));
}

/* Horizontally scrolling list of books */
.carousel {
    overflow-x: auto;
    padding: 20px;
  }
  
.carousel-item {
    margin-right: 20px;
}
  
.carousel-item:last-child {
    margin-right: 0;
}

.carousel.pl-0 {
    padding-left: 0;
}
  
.bottom-spacer {
    margin-bottom: 4rem;
}
    
.carousel {
    justify-content: start;
}
  
.tooltip-pointer {
    position: relative;
}

.tooltip-pointer::after {
    content: "";
    position: absolute;
    bottom: -20px;
    right: 36px;
    border-width: 10px;
    border-style: solid;
    border-color: rgb(38 38 38/var(--tw-bg-opacity)) transparent transparent transparent; 
}

.shake {
    animation: shake 0.5s;
}

@keyframes shake {
    0% {
        transform: translateX(0);
    }
    20% {
        transform: translateX(-4px);
    }
    40% {
        transform: translateX(4px);
    }
    60% {
        transform: translateX(-4px);
    }
    80% {
        transform: translateX(4px);
    }
    100% {
        transform: translateX(0);
    }
}

.diff-resizer {
    width: 144px;
}

.highlighted {
    background-color: oklch(0.76172 0.089459 200.027); /* highlight color for Quotes of Studies */
    border-radius: 0.5rem;
    .bg-gradient-to-b {
        background: none;
    }
}

.dot {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin: 0 2px;
}

.dot__sm {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin: 0 1px;
}
  
.green-dot {
    background-color: #34C759;
}
  
.grey-dot {
    background-color: #ccc;
}
  
/* Monthly statistics calendar */
.monthly-calendar {
    width: 100%;
    text-align: center;
  }
  
  .monthly-calendar table {
    border-collapse: collapse;
    width: 100%;
  }
  
  .monthly-calendar th,.monthly-calendar td {
    border: 1px solid #ddd;
    padding: 0;
  }
  
  .monthly-calendar table td {
    justify-content: center;
  }
  
  .day-container {
    position: relative;
    display: flex;
    justify-content: center;
  }
  
  .day-box {
    width: 40px;
    height: 40px;
    border-radius: 5px;
    /* border-radius: 50%; */ /* Do we like circles or rounded squares? */
    margin: 5px;
    display: flex;
    justify-content: center;
  }
  
  .day-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: bold;
  }  
  
  .points_200 {
    background-color: oklch(0.87497 0.24613 297.068);
  }
  
  .points_180 {
    background-color: oklch(0.85135 0.20755 275.936);
  }
  
  .points_160 {
    background-color: oklch(0.82757 0.16831 255.132);
  }
  
  .points_140 {
    background-color: oklch(0.80364 0.12843 235.131);
  }
  
  .points_120 {
    background-color: oklch(0.77953 0.08834 216.508);
  }
  
  .points_100 {
    background-color: oklch(0.76172 0.089459 200.027);
  }
  
  .points_80 {
    background-color: oklch(0.76172 0.089459 200.027);
    opacity: 0.8;
  }
  
  .points_60 {
    background-color: oklch(0.76172 0.089459 200.027);
    opacity: 0.6;
  }
  
  .points_40 {
    background-color: oklch(0.76172 0.089459 200.027);
    opacity: 0.4;
  }
  
  .points_low {
    background-color: oklch(0.76172 0.089459 200.027);
    opacity: 0.2;
  }
  
  .points_0 {
    background-color: #fff;
  }

  h1 {
    align-items: center;
    font-size: 1.25rem;
    font-weight: 600;
    gap: .5rem;
    line-height: 1.75rem;
  }
  @media (min-width: 1024px) {
    h1 {
      font-size: 1.875rem;
      line-height: 2.25rem;
      margin-bottom: 1rem;
    }
  }

/* Guest nav: horizontally scrollable category tabs with no visible scrollbar
   (touch/swipe scrolling still works — only the scrollbar itself is hidden).
   Reset to overflow: visible at md+: setting overflow-x alone implicitly makes
   overflow-y clip too, which would cut off the desktop dropdown drawer (an
   absolutely-positioned descendant) even though it's positioned relative to
   <nav>, not this container. Desktop has no need to scroll here anyway. */
.guest-nav-scroll {
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
}
.guest-nav-scroll::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
}
@media (min-width: 768px) {
    .guest-nav-scroll {
        overflow: visible;
    }
}

/* Guest nav desktop dropdown: recolor a link's label on hover. Plain CSS
   descendant-of-:hover rather than Tailwind's group-hover, since the dropdown
   link already sits inside the trigger's own `group` wrapper and an unnamed
   nested group would cross-talk with it. */
.guest-nav-dropdown-link:hover .guest-nav-dropdown-label {
    color: oklch(var(--p) / 1);
}
