/* ═══════════════════════════════════════════════════════════════════════
   COLOR PICKER MODAL - Premium Discord Style
   Sélecteur de couleur avancé avec gradient HSL, palette et historique
   ═══════════════════════════════════════════════════════════════════════ */

/* Overlay */
.color-picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

/* Modal */
.color-picker-modal {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(145deg, #2b2d31 0%, #1e1f22 100%);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  overflow: hidden;
  animation: modal-appear 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modal-appear {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Animation de transition */
.modal-fade-enter-active,
.modal-fade-leave-active {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-fade-enter-from,
.modal-fade-leave-to {
  opacity: 0;
}

.modal-fade-enter-from .color-picker-modal,
.modal-fade-leave-to .color-picker-modal {
  transform: scale(0.9) translateY(20px);
}

/* ═══════════════════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════════════════ */

.picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.2);
}

.picker-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.title-icon {
  font-size: 1.3rem;
}

.picker-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  border-radius: 8px;
  color: #b5bac1;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.picker-close:hover {
  background: rgba(237, 66, 69, 0.2);
  color: #ED4245;
}

/* ═══════════════════════════════════════════════════════════════════════
   TABS
   ═══════════════════════════════════════════════════════════════════════ */

.picker-tabs {
  display: flex;
  padding: 12px 16px;
  gap: 8px;
  background: rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.picker-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: #b5bac1;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.picker-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.picker-tab.active {
  background: linear-gradient(135deg, #5865F2 0%, #4752C4 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(88, 101, 242, 0.4);
}

.tab-icon {
  font-size: 1.1rem;
}

.tab-label {
  display: none;
}

@media (min-width: 380px) {
  .tab-label {
    display: inline;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   CONTENT AREA
   ═══════════════════════════════════════════════════════════════════════ */

.picker-content {
  padding: 20px;
  min-height: 220px;
}

.picker-tab-content {
  animation: tab-fade 0.25s ease;
}

@keyframes tab-fade {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════════════
   GRADIENT PICKER
   ═══════════════════════════════════════════════════════════════════════ */

.gradient-area {
  position: relative;
  width: 100%;
  height: 180px;
  border-radius: 12px;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    0 4px 20px rgba(0, 0, 0, 0.3);
}

.gradient-cursor {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.3),
    0 2px 8px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: box-shadow 0.15s ease;
}

.gradient-area:active .gradient-cursor {
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.3),
    0 4px 16px rgba(0, 0, 0, 0.6),
    0 0 0 4px rgba(255, 255, 255, 0.2);
}

/* Hue Slider */
.hue-slider {
  position: relative;
  width: 100%;
  height: 20px;
  margin-top: 16px;
  border-radius: 10px;
  background: linear-gradient(to right,
    hsl(0, 100%, 50%),
    hsl(60, 100%, 50%),
    hsl(120, 100%, 50%),
    hsl(180, 100%, 50%),
    hsl(240, 100%, 50%),
    hsl(300, 100%, 50%),
    hsl(360, 100%, 50%)
  );
  cursor: pointer;
  touch-action: none;
  user-select: none;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    0 2px 8px rgba(0, 0, 0, 0.2);
}

.hue-cursor {
  position: absolute;
  top: 50%;
  width: 24px;
  height: 24px;
  background: #fff;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.2),
    0 2px 8px rgba(0, 0, 0, 0.4);
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: transform 0.1s ease;
}

.hue-slider:active .hue-cursor {
  transform: translate(-50%, -50%) scale(1.15);
}

/* ═══════════════════════════════════════════════════════════════════════
   PALETTE TAB
   ═══════════════════════════════════════════════════════════════════════ */

.palette-content {
  max-height: 280px;
  overflow-y: auto;
  padding-right: 8px;
}

.palette-content::-webkit-scrollbar {
  width: 6px;
}

.palette-content::-webkit-scrollbar-track {
  background: transparent;
}

.palette-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.palette-category {
  margin-bottom: 16px;
}

.palette-category:last-child {
  margin-bottom: 0;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.category-icon {
  font-size: 1rem;
}

.category-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #b5bac1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.palette-color {
  aspect-ratio: 1;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    0 2px 6px rgba(0, 0, 0, 0.3);
}

.palette-color:hover {
  transform: scale(1.15);
  z-index: 1;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.2),
    0 6px 20px rgba(0, 0, 0, 0.5);
}

.palette-color.selected {
  transform: scale(1.1);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.8),
    0 4px 16px rgba(0, 0, 0, 0.4);
}

.color-check {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* ═══════════════════════════════════════════════════════════════════════
   RECENT TAB
   ═══════════════════════════════════════════════════════════════════════ */

.recent-content {
  min-height: 180px;
}

.no-recent {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 180px;
  color: #72767d;
}

.no-recent-icon {
  font-size: 2.5rem;
  opacity: 0.5;
}

.no-recent-text {
  font-size: 0.9rem;
  font-weight: 500;
}

.recent-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.recent-color {
  aspect-ratio: 1;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    0 2px 8px rgba(0, 0, 0, 0.3);
}

.recent-color:hover {
  transform: scale(1.12);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.2),
    0 6px 20px rgba(0, 0, 0, 0.5);
}

.recent-color.selected {
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.8),
    0 4px 16px rgba(0, 0, 0, 0.4);
}

/* ═══════════════════════════════════════════════════════════════════════
   PREVIEW SECTION
   ═══════════════════════════════════════════════════════════════════════ */

.picker-preview-section {
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding: 0 20px 16px;
}

.preview-color-large {
  width: 80px;
  height: 56px;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.15),
    0 4px 16px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
}

.preview-color-large:hover {
  transform: scale(1.05);
}

.preview-hex-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.preview-color-large:hover .preview-hex-overlay {
  opacity: 1;
}

.hex-input-group {
  flex: 1;
  display: flex;
  align-items: center;
  background: #1e1f22;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.hex-input-group:focus-within {
  border-color: #5865F2;
  box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.2);
}

.hex-prefix {
  padding: 0 12px;
  color: #72767d;
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 1rem;
  font-weight: 600;
}

.hex-input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 14px 0;
  color: #fff;
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  outline: none;
}

.hex-input::placeholder {
  color: #4e5058;
}

.copy-btn {
  padding: 0 14px;
  background: transparent;
  border: none;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  color: #b5bac1;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

/* ═══════════════════════════════════════════════════════════════════════
   ACTIONS
   ═══════════════════════════════════════════════════════════════════════ */

.picker-actions {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-cancel,
.btn-confirm {
  flex: 1;
  padding: 14px 20px;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-cancel {
  background: rgba(255, 255, 255, 0.05);
  color: #b5bac1;
}

.btn-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.btn-confirm {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #57F287 0%, #3BA55C 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(87, 242, 135, 0.3);
}

.btn-confirm:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(87, 242, 135, 0.4);
}

.btn-confirm:active {
  transform: translateY(0);
}

.btn-icon {
  font-size: 1.1rem;
}

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE - MOBILE
   ═══════════════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
  .color-picker-overlay {
    padding: 12px;
    align-items: flex-end;
  }

  .color-picker-modal {
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 90vh;
    overflow-y: auto;
  }

  .picker-header {
    padding: 14px 16px;
  }

  .picker-title {
    font-size: 1rem;
  }

  .picker-tabs {
    padding: 10px 12px;
    gap: 6px;
  }

  .picker-tab {
    padding: 10px 12px;
    font-size: 0.85rem;
  }

  .picker-content {
    padding: 16px;
  }

  .gradient-area {
    height: 150px;
  }

  .palette-grid,
  .recent-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
  }

  .palette-color,
  .recent-color {
    border-radius: 12px;
  }

  .picker-preview-section {
    padding: 0 16px 12px;
    gap: 10px;
  }

  .preview-color-large {
    width: 64px;
    height: 50px;
  }

  .hex-input {
    font-size: 0.95rem;
    padding: 12px 0;
  }

  .picker-actions {
    padding: 12px 16px 20px;
  }

  .btn-cancel,
  .btn-confirm {
    padding: 12px 16px;
  }
}

/* Very small screens */
@media (max-width: 360px) {
  .palette-grid,
  .recent-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .gradient-area {
    height: 130px;
  }
}
