/* These "info-" classes are for displaying an info icon that can be moused over
 * to pop up a div with information. info-icon-container should be the outermost
 * div, info-icon should hold the icon itself, and info-tooltip should be the
 * pop-up. Example:

   <div class="info-icon-container">
       <span class="info-icon">ⓘ</span>
       <div class="info-tooltip">
           <p>Here's the info that pops up!</p>
       </div>
   </div>

 */
.info-icon-container {
  position: relative;
  display: flex;
  align-items: center;
}

.info-icon {
  font-size: 1rem;
  color: #666;
  background: transparent;
  border: 0;
  border-radius: 50%;
  width: 1.2rem;
  height: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: bold;
  user-select: none;
}

.info-tooltip {
  visibility: hidden;
  width: 300px;
  background-color: #333;
  color: #fff;
  text-align: left;
  border-radius: 6px;
  padding: 1rem;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -150px; /* Use half of the width to center */
  opacity: 0;
  transition: opacity 0.3s, visibility 0s 0.3s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  font-size: 80%;
}

.info-icon-container:hover .info-tooltip,
.info-icon-container:focus-within .info-tooltip {
  visibility: visible;
  opacity: 1;
  transition-delay: 0s;
}

/* These "antenna-card-" classes are for displaying objects in a grid of cards,
 * which can be a nicer interface than a table if each object has a lot of fields
 * and/or nested fields. The "antenna-" prefix is just to avoid clobbering other
 * imported styles, where "card" might be a common name. antenna-card-container
 * goes on the outside, and each object goes in a card div. antenna-card-header is
 * for styling the title of each card. Example:

   <div class="antenna-card-container">
       {% for ticket in tickets %}
       <div class="antenna-card">
           <div class="antenna-card-header">
               <b>{{ ticket.title }}</b>
           </div>
           <p>{{ ticket.description }}</p>
       </div>
       {% endfor %}
   </div>

 */

.antenna-card-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0.5rem;
}

.antenna-card {
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 0.6rem;
  background-color: #fafafa;
}

.antenna-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 0.5rem;
}

.antenna-card.deal-previous, .antenna-card.deal-disabled {
    background-color: #e9ecef; /* light grey */
}

/* Delete confirmations use the native Popover API so they work without
 * JavaScript and are not clipped by their surrounding layout.
 */
.delete-confirmation {
    width: min(30rem, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    padding: 0;
    overflow: auto;
    color: #212529;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 0.3rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.5);
}

.delete-confirmation::backdrop {
    background: rgba(0, 0, 0, 0.35);
}

.delete-confirmation__header,
.delete-confirmation__body,
.delete-confirmation__actions {
    padding: 1rem;
}

.delete-confirmation__header {
    border-bottom: 1px solid #dee2e6;
}

.delete-confirmation__actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    border-top: 1px solid #dee2e6;
}

.delete-confirmation__actions form {
    margin: 0;
}

/* These "search-select" classes are for styling a select box that uses ajax to
 * populate options. See search-select.js
 */
.search-select {
    position: relative;
    width: 17rem;
}

.search-select__input {
    width: 100%;
}

.search-select__results {
    position: absolute;
    z-index: 1000;
    top: calc(100% + 0.125rem);
    left: 0;
    width: 100%;
    max-height: 15rem;
    overflow-y: auto;
    padding: 0.5rem 0;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0.25rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.175);
}

.search-select__option {
    display: block;
    width: 100%;
    padding: 0.25rem 0.75rem;
    color: #212529;
    text-align: left;
    white-space: normal;
    background: transparent;
    border: 0;
}

.search-select__message {
    padding: 0.25rem 0.75rem;
    color: #6c757d;
}

.search-select__option:hover,
.search-select__option:focus,
.search-select__option[aria-selected="true"] {
    color: #16181b;
    background: #f8f9fa;
    outline: 0;
}
