@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700;800;900&family=Poppins:wght@400;500;600&display=swap');

/* ============================================
   Random Picker - by Yaseen
   ============================================ */

.rp-wrapper {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px;
  font-family: 'Poppins', sans-serif;
  background: #ffffff;
  box-sizing: border-box;
  position: relative;
}

/* Card */
.rp-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: 0 2px 20px rgba(14,165,233,0.07);
  box-sizing: border-box;
}

/* Quick Examples */
.rp-quick-section {
  border: 1.5px dashed #cbd5e1;
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 24px;
  background: #fafcff;
}

.rp-quick-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #0EA5E9;
  margin: 0 0 14px 0 !important;
  font-family: 'Poppins', sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.rp-quick-btns { display: flex; flex-wrap: wrap; gap: 10px; }

.rp-quick-btn {
  padding: 9px 20px;
  border-radius: 8px;
  border: 1.5px solid #0EA5E9;
  background: #0EA5E9;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Poppins', sans-serif;
}

.rp-quick-btn:hover { background: #0284c7; border-color: #0284c7; transform: translateY(-1px); }

/* Fields */
.rp-field { margin-bottom: 20px; }

.rp-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 8px !important;
  font-family: 'Poppins', sans-serif;
}

.rp-label-hint {
  font-weight: 400;
  color: #94a3b8;
  font-size: 0.75rem;
  margin-left: 6px;
}

/* Textarea */
.rp-textarea {
  width: 100%;
  min-height: 180px;
  padding: 14px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
  color: #334155;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #f8fafc;
  box-sizing: border-box;
  line-height: 1.8;
}

.rp-textarea:focus {
  border-color: #0EA5E9;
  box-shadow: 0 0 0 4px rgba(14,165,233,0.1);
  background: #fff;
}

.rp-item-count {
  text-align: right;
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 6px;
  font-family: 'Poppins', sans-serif;
}

.rp-item-count span { font-weight: 700; color: #0EA5E9; }

/* Options Row */
.rp-options-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 20px;
  margin-bottom: 20px;
  align-items: end;
}

.rp-field-sm { margin-bottom: 0; }

/* Select */
.rp-select {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: #334155;
  background: #f8fafc;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  box-sizing: border-box;
}

.rp-select:focus { border-color: #0EA5E9; box-shadow: 0 0 0 4px rgba(14,165,233,0.1); }

/* File Upload */
.rp-file-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  border: 1.5px dashed #cbd5e1;
  border-radius: 12px;
  padding: 11px 14px;
}

.rp-file-btn {
  padding: 8px 18px;
  background: #0EA5E9;
  color: #ffffff;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  white-space: nowrap;
  transition: background 0.2s;
}

.rp-file-btn:hover { background: #0284c7; }
#rp-file { display: none; }

.rp-file-name {
  font-size: 0.78rem;
  color: #94a3b8;
  font-family: 'Poppins', sans-serif;
}

/* Toggle Row */
.rp-toggles-row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 22px;
  align-items: center;
}

.rp-toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.85rem;
  color: #334155;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
}

.rp-toggle-label input[type="checkbox"] { display: none; }

.rp-toggle-switch {
  width: 44px;
  height: 24px;
  background: #e2e8f0;
  border-radius: 12px;
  position: relative;
  flex-shrink: 0;
  transition: background 0.25s;
}

.rp-toggle-switch::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: #ffffff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: left 0.25s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.rp-toggle-label input:checked + .rp-toggle-switch { background: #0EA5E9; }
.rp-toggle-label input:checked + .rp-toggle-switch::after { left: 23px; }

.rp-toggle-text small { color: #94a3b8; font-size: 0.75rem; margin-left: 4px; }

/* Pick Button */
.rp-pick-btn {
  width: 100%;
  padding: 17px;
  border-radius: 14px;
  border: none;
  background: #0EA5E9;
  color: #ffffff;
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 6px 22px rgba(14,165,233,0.35);
  box-sizing: border-box;
}

.rp-pick-btn:hover { background: #0284c7; transform: translateY(-2px); box-shadow: 0 10px 30px rgba(14,165,233,0.4); }
.rp-pick-btn:active { transform: translateY(0); }
.rp-pick-btn:disabled { background: #94a3b8; cursor: not-allowed; box-shadow: none; transform: none; }

/* Spin Overlay */
.rp-spin-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.7);
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.rp-spin-card {
  background: #0f172a;
  border: 2px solid #0EA5E9;
  border-radius: 24px;
  padding: 48px 60px;
  text-align: center;
  min-width: 320px;
  box-shadow: 0 0 60px rgba(14,165,233,0.3);
}

.rp-spin-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-family: 'Poppins', sans-serif;
  margin-bottom: 18px;
}

.rp-spin-text {
  font-family: 'Montserrat', sans-serif;
  font-size: 2.2rem;
  font-weight: 900;
  color: #ffffff;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: rpFlicker 0.1s infinite;
  margin-bottom: 24px;
  word-break: break-word;
}

.rp-spin-bar {
  width: 100%;
  height: 6px;
  background: #1e293b;
  border-radius: 3px;
  overflow: hidden;
}

.rp-spin-progress {
  height: 100%;
  background: linear-gradient(90deg, #0EA5E9, #38bdf8);
  border-radius: 3px;
  width: 0%;
  transition: width 0.05s linear;
}

/* Results */
.rp-results { box-sizing: border-box; }

.rp-results-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.rp-results-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, #e2e8f0);
}
.rp-results-line:last-child { background: linear-gradient(90deg, #e2e8f0, transparent); }

.rp-results-title {
  font-family: 'Montserrat', sans-serif !important;
  font-size: 0.82rem !important;
  font-weight: 800 !important;
  color: #0EA5E9 !important;
  margin: 0 !important;
  padding: 0 !important;
  white-space: nowrap;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Winner Cards */
.rp-winners {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 28px;
}

.rp-winner-card {
  background: #334155;
  border-radius: 18px;
  padding: 24px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  animation: rpPop 0.5s cubic-bezier(0.34,1.56,0.64,1) forwards;
  opacity: 0;
  transform: scale(0.85);
}

.rp-winner-trophy {
  font-size: 2.2rem;
  flex-shrink: 0;
  line-height: 1;
}

.rp-winner-info { flex: 1; }

.rp-winner-rank {
  font-size: 0.65rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  font-family: 'Poppins', sans-serif;
  margin-bottom: 6px;
}

.rp-winner-name {
  font-family: 'Montserrat', sans-serif;
  font-size: 2rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.1;
  word-break: break-word;
}

.rp-winner-num {
  font-family: 'Montserrat', sans-serif;
  font-size: 2rem;
  font-weight: 900;
  color: #0EA5E9;
  flex-shrink: 0;
}

/* All Items Grid */
.rp-all-section { margin-bottom: 24px; }

.rp-all-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  color: #0EA5E9;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.rp-all-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rp-item-pill {
  padding: 8px 16px;
  border-radius: 100px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 500;
  font-family: 'Poppins', sans-serif;
  transition: all 0.2s;
}

.rp-item-pill.rp-item-winner {
  background: #0EA5E9;
  border-color: #0EA5E9;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(14,165,233,0.3);
}

/* History */
.rp-history-section { margin-bottom: 24px; }

.rp-history-list { display: flex; flex-direction: column; gap: 8px; }

.rp-history-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-family: 'Poppins', sans-serif;
  color: #64748b;
}

.rp-history-item strong { color: #334155; font-weight: 600; }
.rp-history-time { font-size: 0.72rem; color: #94a3b8; }

/* Action Buttons */
.rp-result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.rp-pick-again-btn {
  padding: 12px 32px;
  border-radius: 10px;
  border: none;
  background: #0EA5E9;
  color: #ffffff;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(14,165,233,0.3);
}

.rp-pick-again-btn:hover { background: #0284c7; transform: translateY(-1px); }

.rp-reset-btn {
  padding: 12px 32px;
  border-radius: 10px;
  border: 2px solid #e2e8f0;
  background: transparent;
  color: #64748b;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}

.rp-reset-btn:hover { border-color: #334155; color: #334155; }

/* Animations */
@keyframes rpPop     { to   { opacity:1; transform:scale(1); } }
@keyframes rpFlicker { 0%,100% { opacity:1; } 50% { opacity:0.6; } }

/* Responsive */
@media (max-width: 600px) {
  .rp-options-row  { grid-template-columns: 1fr; }
  .rp-toggles-row  { flex-direction: column; align-items: flex-start; gap: 14px; }
  .rp-winner-name  { font-size: 1.5rem; }
  .rp-spin-card    { padding: 32px 24px; min-width: 280px; }
  .rp-spin-text    { font-size: 1.6rem; }
  .rp-card         { padding: 18px; }
}
