/*
 * Incentive Race Slider styles
 * These styles power the search bar, slider, cards, and editing interface.
 */

/* Base variables for colours; values are provided inline via wp_add_inline_style */
:root {
  --ir-bg: #0b0b12;
  --ir-text: #ffffff;
  --ir-primary: #b00f0f;
  --ir-accent: #4b0000;
  --ir-radius: 12px;
}

/* Wrapper around all plugin elements */
.ir-wrap {
  background: var(--ir-bg);
  color: var(--ir-text);
  font-family: inherit;
  padding: 20px;
  border-radius: var(--ir-radius);
  max-width: 100%;
  box-sizing: border-box;
}

/* Search bar container */
.ir-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.ir-search input[type="text"] {
  flex: 1 1 160px;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
  color: var(--ir-text);
}

.ir-search button {
  padding: 6px 12px;
  background: #ffffff;
  color: #000000;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

.ir-search button:hover {
  opacity: 0.85;
}

.ir-search-result {
  margin-left: auto;
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Slider container */
.ir-slider-wrapper {
  position: relative;
  margin-bottom: 16px;
}

/* Adjust Swiper navigation buttons colours */
.ir-slider-wrapper .swiper-button-prev,
.ir-slider-wrapper .swiper-button-next {
  color: var(--ir-primary);
}

/* Pagination dots style */
.ir-slider-wrapper .swiper-pagination-bullet {
  background: var(--ir-primary);
  opacity: 0.4;
}
.ir-slider-wrapper .swiper-pagination-bullet-active {
  opacity: 1;
}

/* Card styling */
.ir-card {
  background: rgba(255,255,255,0.05);
  border-radius: var(--ir-radius);
  padding: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 220px;
}

/* Thumbnail image */
.ir-thumb {
  width: 100px;
  height: 100px;
  overflow: hidden;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ir-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ir-placeholder {
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
}

/* Info section */
.ir-info {
  margin-bottom: 12px;
}
.ir-name {
  font-size: 1.1rem;
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}
.ir-earn-text {
  font-size: 0.85rem;
  opacity: 0.85;
}

/* Progress bar */
.ir-bar-wrap {
  width: 100%;
  margin-top: auto;
}
.ir-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
}
.ir-bar-fill {
  height: 100%;
  background-image: linear-gradient(90deg, var(--ir-primary), var(--ir-accent));
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* Edit button */
.ir-edit-btn {
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  background: #ffffff;
  color: #000000;
  border: none;
  display: inline-block;
  margin-bottom: 16px;
}
.ir-edit-btn:hover {
  opacity: 0.85;
}

/* Editor form */
.ir-editor {
  background: rgba(255,255,255,0.05);
  padding: 16px;
  border-radius: var(--ir-radius);
}
.ir-row {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
}
.ir-row label {
  margin-bottom: 4px;
}
.ir-row input[type="text"],
.ir-row input[type="number"],
.ir-row input[type="password"],
.ir-row select {
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  background: rgba(255,255,255,0.07);
  color: var(--ir-text);
}
.ir-row input[type="file"] {
  color: var(--ir-text);
}
.ir-row small {
  font-size: 0.75rem;
  opacity: 0.8;
  margin-top: 2px;
}
.ir-thumb-preview img {
  height: 56px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.2);
}

/* Buttons inside form */
.ir-btn {
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  margin-right: 8px;
}
.ir-save-btn {
  background-image: linear-gradient(90deg, var(--ir-primary), var(--ir-accent));
  color: #ffffff;
}
.ir-save-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.ir-delete-btn {
  background: transparent;
  border: 2px solid #ff4d4f;
  color: #ff4d4f;
}
.ir-delete-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Message area */
.ir-msg {
  margin-top: 8px;
  font-size: 0.85rem;
}

/* Highlight animation for found card */
.ir-highlight {
  animation: ir-flash 1.5s ease; /* highlight for 1.5 seconds */
}
@keyframes ir-flash {
  0% { box-shadow: 0 0 0 0 rgba(255,255,0,0.7); }
  50% { box-shadow: 0 0 0 6px rgba(255,255,0,0.0); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,0,0.0); }
}