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

@import "animations";

@layer components {
  input[type="date"].search-filter,
  input[type="time"].search-filter {
    @apply relative font-medium border rounded-[20px] min-w-20 pl-3 pr-2 py-1.5;
  }
  input[type="date"].search-filter::-webkit-calendar-picker-indicator,
  input[type="time"].search-filter::-webkit-calendar-picker-indicator {
    @apply absolute top-0 left-0 right-0 bottom-0 w-auto h-auto;

    background: transparent;
    z-index: 1;
  }
  input[type="date"].search-filter::after,
  input[type="time"].search-filter::after {
    @apply absolute right-1.5 top-[50%] transform translate-y-[-50%] w-4 h-4 bg-contain bg-no-repeat z-[2] cursor-pointer;

    content: "";
    background-image: url("/assets/x-3cbdd916.svg");
  }

  .gradient-radio {
    display: flex;
    align-items: center;
    column-gap: 4px;
    width: fit-content;
    line-height: 1;
    cursor: pointer;
  }
  .gradient-radio input[type="radio"] {
    appearance: none;
    position: relative;
    width: 20px;
    height: 20px;
    border: 1px solid transparent;
    background: linear-gradient(white, white) padding-box, linear-gradient(65deg, #37B6E9 47%, #4B4CED 97%) border-box;
    border-radius: 9999px;
    cursor: pointer;
   }
   .gradient-radio input[type="radio"]:checked::after {
    content: "";
    position: absolute;
    inset: 0;
    width: 12px;
    height: 12px;
    margin: auto;
    border-radius: 9999px;
    background-image: linear-gradient(65deg, #37B6E9 47%, #4B4CED 97%);
  }

  .gradient-checkbox {
    display: flex;
    align-items: center;
    column-gap: 4px;
    width: fit-content;
    line-height: 1;
    cursor: pointer;
  }

  .gradient-checkbox input[type="checkbox"] {
    appearance: none;
    position: relative;
    width: 18px;
    height: 18px;
    border: 2px solid #1D1B20;
    border-radius: 2px;
    cursor: pointer;
  }
  .gradient-checkbox input[type="checkbox"]:checked {
    background-image: linear-gradient(65deg, #37B6E9 47%, #4B4CED 97%);
    border: none;
  }
  .gradient-checkbox input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    top: 5px;
    left: 3px;
    width: 12px;
    height: 6px;
    border-bottom: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    transform: rotate(-45deg);
  }

  .slider-switch {
    position: relative;
    cursor: pointer;
  }
  .slider-switch input[type="checkbox"] {
    display: none;
  }
  .slider-switch input[type="checkbox"]:checked ~ .circle {
    background-color: white;
    transform: translateX(20px);
  }
  .slider-switch input[type="checkbox"]:checked ~ .base {
    background-color: #37B6E9;
    background-image: linear-gradient(65deg, #37B6E9 47%, #4B4CED 97%);
    border: none;
  }
  .slider-switch > .base {
    @apply w-[52px] h-8 rounded-full border-2 border-gray-300;
  }
  .slider-switch > .circle {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 24px;
    height: 24px;
    border-radius: 12px;
    background-color: rgba(29, 27, 32, 0.5);
    transition: transform 0.3s;
  }

  .dialog {
    border-radius: 1rem;
    outline: none;
  }
  .dialog[open] {
    animation: scaleIn 0.3s ease-in-out;
  }
  .dialog.closing {
    animation: scaleOut 0.3s ease forwards;
  }
  .dialog::backdrop {
    @apply bg-black bg-opacity-70;
    animation: fadeIn 0.3s ease forwards;
  }
  .dialog.closing::backdrop {
    animation: fadeOut 0.3s ease-in-out;
  }

  .accordion_open {
    animation: fadeIn 0.3s ease forwards;
  }

  .accordion_close {
    animation: fadeOut 0.3s ease-in-out;
  }
}

@layer utilities {
  .gradient-text {
    background-image: linear-gradient(40deg, #37B6E9 -16%, #4B4CED 54%);
    background-size: 100%;
    -webkit-background-clip: text;
    -moz-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent; 
    -moz-text-fill-color: transparent;
  }

  .gradient-background {
    background-color: #37B6E9;
    background-image: linear-gradient(65deg, #37B6E9 47%, #4B4CED 97%);
  }
}

.field_with_errors {
  display: contents;
}

@media print {
  .print-style {
    margin-left: 0 !important;
    padding: 0 !important;
  }

  .print-style-chart {
    overflow: visible !important;
    max-width: var(--plotly-print-max-width, 100%);
    width: 100%;
    margin: 0 auto;
  }
}

@keyframes animate-marquee {
  0%, 20%   { transform: translateX(0); }
  80%, 100%  { transform: translateX(var(--marquee-offset)); }
}

.marquee-track {
  width: max-content;
  animation: animate-marquee 10s linear infinite;
  animation-play-state: var(--marquee-play, paused); /* 初期は停止 */
}
