/* ==========================================================================
   PickerWheel CSS - Sidebar, Modals & Controls (Nubel Huxley Theme)
   ========================================================================== */

.sidebar-section {
  background: var(--bg-card);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  height: 100%;
  max-height: 720px;
}

/* Sidebar Navigation Tabs */
.sidebar-tabs {
  display: flex;
  background: rgba(11, 15, 25, 0.7);
  border-bottom: 1px solid var(--border-color);
}

.tab-btn {
  flex: 1;
  padding: 0.9rem 0.5rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: var(--transition-smooth);
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
  color: #818cf8;
  border-bottom-color: var(--primary);
  background: rgba(79, 70, 229, 0.12);
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* Inputs Form */
.input-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.input-group {
  display: flex;
  gap: 0.5rem;
}

.input-group input[type="text"] {
  flex: 1;
  padding: 0.7rem 0.95rem;
  background: rgba(11, 15, 25, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition-smooth);
}

.input-group input[type="text"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.25);
}

.quick-tools {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* Items List */
.items-list-container {
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}

.items-list-container::-webkit-scrollbar {
  width: 6px;
}
.items-list-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.items-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.8rem;
  background: rgba(11, 15, 25, 0.5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: var(--transition-smooth);
}

.item-row:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(79, 70, 229, 0.3);
}

.item-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1;
  overflow: hidden;
}

.item-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.item-text {
  font-size: 0.9rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  outline: none;
}

.item-text[contenteditable="true"]:focus {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 4px;
  border-radius: 4px;
}

.item-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.item-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
}

.item-btn:hover {
  color: var(--danger-color);
  background: rgba(239, 68, 68, 0.1);
}

/* Settings Tab */
.settings-group {
  margin-bottom: 1.5rem;
}

.settings-group h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.85rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border-color);
}

.setting-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.setting-item label {
  font-size: 0.85rem;
  color: var(--text-primary);
}

.setting-item input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

.checkbox-item {
  flex-direction: row;
  align-items: center;
  gap: 0.6rem;
}

.checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Palette Options */
.palette-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}

.palette-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.6rem;
  background: rgba(11, 15, 25, 0.6);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.palette-card:hover, .palette-card.active {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.15);
}

.palette-name {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.palette-swatches {
  display: flex;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
}

.swatch {
  flex: 1;
  height: 100%;
}

.color-picker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.color-picker-row input[type="color"] {
  border: none;
  background: none;
  width: 32px;
  height: 32px;
  cursor: pointer;
}

/* History Tab */
.history-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.history-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  background: rgba(11, 15, 25, 0.5);
  border-left: 3px solid var(--secondary);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.history-item .timestamp {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.empty-history {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 2rem 0;
}

/* Modal Overlays */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #111525;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  width: 90%;
  max-width: 480px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  transform: scale(0.9);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-card.modal-lg {
  max-width: 720px;
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text-primary);
}

/* Winner Card Styling (Nubel Huxley Theme) */
.winner-card {
  text-align: center;
  background: linear-gradient(180deg, #181d33 0%, #0b0f19 100%);
  border: 1px solid rgba(79, 70, 229, 0.3);
}

.winner-trophy {
  font-size: 3.5rem;
  color: #f59e0b;
  margin-bottom: 0.5rem;
  animation: bounceTrophy 1s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes bounceTrophy {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-10px) scale(1.1); }
}

.winner-subtitle {
  font-size: 0.75rem;
  letter-spacing: 2px;
  color: var(--secondary);
  font-weight: 700;
  font-family: var(--font-display);
}

.winner-name {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0.6rem 0 1.5rem 0;
  word-break: break-word;
  background: linear-gradient(135deg, #ffffff 0%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

/* Bulk Modal & Embed Modal */
.modal-body textarea {
  width: 100%;
  background: rgba(11, 15, 25, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.75rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  resize: vertical;
  margin-top: 0.5rem;
  outline: none;
}

.modal-body textarea:focus {
  border-color: var(--primary);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

/* Embed Modal Specifics */
.embed-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.embed-tab-btn {
  padding: 0.6rem 1rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

.embed-tab-btn.active {
  color: var(--secondary);
  border-bottom-color: var(--secondary);
}

.embed-tab-content {
  display: none;
}

.embed-tab-content.active {
  display: block;
}

.embed-intro {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.embed-options-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  background: rgba(11, 15, 25, 0.5);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  align-items: center;
}

.opt-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.opt-group label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.opt-group input[type="text"], .opt-group input[type="number"] {
  padding: 0.4rem 0.6rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: #fff;
  width: 90px;
}

.checkbox-opt {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
}

.code-box-wrapper {
  position: relative;
  margin-bottom: 1rem;
}

.code-box-wrapper textarea, .code-box-wrapper input {
  width: 100%;
  background: rgba(11, 15, 25, 0.9);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #38bdf8;
  font-family: monospace;
  font-size: 0.82rem;
  padding: 0.75rem 6.5rem 0.75rem 0.75rem;
}

.btn-copy {
  position: absolute;
  right: 8px;
  top: 8px;
  font-size: 0.8rem;
  padding: 0.4rem 0.8rem;
}

.preview-box-container h4 {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.iframe-preview-wrapper {
  width: 100%;
  height: 250px;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #0b0f19;
}

.iframe-preview-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* File Drop Zone (CSV / Spreadsheet Import) */
.file-drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1rem;
  border: 2px dashed rgba(79, 70, 229, 0.4);
  background: rgba(11, 15, 25, 0.4);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: center;
  transition: var(--transition-smooth);
  margin-bottom: 0.85rem;
}

.file-drop-zone:hover, .file-drop-zone.drag-over {
  border-color: var(--secondary);
  background: rgba(16, 185, 129, 0.08);
}

.drop-zone-icon {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 0.4rem;
}

.drop-zone-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.drop-zone-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.drop-zone-sub strong {
  color: var(--secondary);
}

.file-badge {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.25rem 0.65rem;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--secondary);
  color: var(--secondary);
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 20px;
}

.divider-or {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  margin: 0.85rem 0;
}

.divider-or::before, .divider-or::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.divider-or span {
  padding: 0 0.5rem;
  letter-spacing: 0.08em;
}
