/**
 * Collectible Modal Styles
 * Modal moderne glassmorphism pour collectibles
 * Couleur theme: Blue/Cyan (#3b82f6 / #06b6d4)
 */

/* ============================================
   OVERLAY & MODAL CONTAINER
   ============================================ */

.collectible-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1.5rem;
}

.collectible-modal {
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  border-radius: 24px;
  border: 1px solid rgba(59, 130, 246, 0.3);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(30, 30, 40, 0.95) 30%);
  backdrop-filter: blur(16px);
  box-shadow:
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    0 0 80px rgba(59, 130, 246, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ============================================
   MODAL HEADER
   ============================================ */

.collectible-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
}

.collectible-modal-header .header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.collectible-modal-header .header-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: all 0.3s ease;
}

.collectible-modal-header .header-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.collectible-modal-header .modal-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary, #fff);
}

.collectible-modal-header .modal-subtitle {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted, #888);
}

.collectible-modal-header .btn-close-modal {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.collectible-modal-header .btn-close-modal svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted, #888);
}

.collectible-modal-header .btn-close-modal:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
}

.collectible-modal-header .btn-close-modal:hover svg {
  color: #ef4444;
}

/* ============================================
   MODAL CONTENT
   ============================================ */

.collectible-modal-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Collectible Preview Live */
.collectible-preview-live {
  border-radius: 16px;
  border: 2px solid;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.collectible-preview-live .preview-color-bar {
  height: 5px;
  transition: background-color 0.3s ease;
}

.collectible-preview-live .preview-body {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
}

.collectible-preview-live .preview-image-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
}

.collectible-preview-live .preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.collectible-preview-live .preview-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  border-radius: 12px;
}

.collectible-preview-live .preview-rarity-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(30, 30, 40, 0.9);
}

.collectible-preview-live .preview-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.collectible-preview-live .preview-name {
  font-size: 1.1rem;
  font-weight: 600;
  transition: color 0.3s ease;
}

.collectible-preview-live .preview-id {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--text-muted, #888);
  display: inline-block;
  width: fit-content;
}

.collectible-preview-live .preview-rarity-label {
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: 10px;
  font-weight: 600;
  display: inline-block;
  width: fit-content;
}

/* ============================================
   FORM FIELDS
   ============================================ */

.collectible-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.collectible-form-grid .form-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.collectible-form-grid .form-field.full-width {
  grid-column: 1 / -1;
}

.collectible-form-grid .field-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary, #ccc);
}

.collectible-form-grid .field-label small {
  font-size: 0.7rem;
  color: var(--text-muted, #888);
  font-weight: 400;
}

.collectible-form-grid .label-icon {
  font-size: 0.9rem;
}

.collectible-form-grid .field-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-primary, #fff);
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.collectible-form-grid .field-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.collectible-form-grid .field-input.has-value {
  border-color: rgba(59, 130, 246, 0.4);
}

.collectible-form-grid .field-input::placeholder {
  color: var(--text-muted, #666);
}

.collectible-form-grid .field-hint {
  font-size: 0.75rem;
  color: var(--text-muted, #888);
  margin: 0;
}

/* Rarity Select Group */
.rarity-select-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.rarity-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: all 0.2s ease;
}

.rarity-option:hover {
  border-color: var(--option-color, #6366f1);
  background: rgba(255, 255, 255, 0.05);
}

.rarity-option.selected {
  border-color: var(--option-color, #6366f1);
  background: rgba(var(--option-color), 0.15);
  box-shadow: 0 0 12px rgba(var(--option-color), 0.2);
}

.rarity-option.selected::after {
  content: '✓';
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--option-color, #6366f1);
}

.rarity-option .rarity-emoji {
  font-size: 1rem;
}

.rarity-option .rarity-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary, #ccc);
}

.rarity-option.selected .rarity-name {
  color: var(--option-color, #6366f1);
}

/* Image Input Group */
.image-input-group {
  display: flex;
  gap: 0.5rem;
}

.image-input-group .field-input {
  flex: 1;
}

.btn-upload {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(59, 130, 246, 0.3);
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-upload:hover:not(:disabled) {
  background: rgba(59, 130, 246, 0.25);
  border-color: #3b82f6;
}

.btn-upload:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-upload.uploading {
  background: rgba(59, 130, 246, 0.1);
}

.upload-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(59, 130, 246, 0.3);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Image Preview Box */
.image-preview-box {
  position: relative;
  margin-top: 0.75rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
}

.image-preview-img {
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  display: block;
}

.image-error-box {
  padding: 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: #f97316;
}

.image-error-box .error-icon {
  font-size: 1.5rem;
}

.image-preview-actions {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  gap: 0.35rem;
}

.btn-preview-action {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.btn-preview-action:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

.btn-preview-action.danger:hover {
  background: rgba(239, 68, 68, 0.8);
}

/* ============================================
   VALIDATION ERROR
   ============================================ */

.collectible-modal-content .validation-error-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 12px;
}

.collectible-modal-content .error-icon {
  font-size: 1rem;
}

.collectible-modal-content .error-text {
  font-size: 0.85rem;
  color: #ef4444;
  font-weight: 500;
}

/* ============================================
   MODAL FOOTER
   ============================================ */

.collectible-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
}

.collectible-modal-footer .btn-modal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.collectible-modal-footer .btn-cancel {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary, #ccc);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.collectible-modal-footer .btn-cancel:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-primary, #fff);
}

.collectible-modal-footer .btn-save {
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  color: #fff;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.collectible-modal-footer .btn-save:hover:not(.disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.collectible-modal-footer .btn-save.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.collectible-modal-footer .btn-icon {
  font-size: 0.85rem;
}

/* ============================================
   TRANSITION ANIMATIONS
   ============================================ */

.modal-fade-enter-active,
.modal-fade-leave-active {
  transition: all 0.3s ease;
}

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

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

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 600px) {
  .collectible-modal-overlay {
    padding: 1rem;
  }

  .collectible-modal {
    max-height: 95vh;
  }

  .collectible-form-grid {
    grid-template-columns: 1fr;
  }

  .rarity-select-group {
    grid-template-columns: 1fr;
  }

  .collectible-modal-header {
    padding: 1rem;
  }

  .collectible-modal-content {
    padding: 1rem;
  }

  .collectible-modal-footer {
    padding: 1rem;
  }
}
