/**
 * 🎭 Character Creator Styles
 * Beautiful, theatrical modal for avatar customization
 */

/* Modal Overlay */
.character-creator-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Main Modal Container */
.character-creator-modal {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
              0 0 100px rgba(102, 126, 234, 0.3);
  width: 90%;
  max-width: 1200px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  border: 2px solid rgba(102, 126, 234, 0.3);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Header */
.creator-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 25px 30px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
  border-bottom: 2px solid rgba(102, 126, 234, 0.3);
  border-radius: 20px 20px 0 0;
}

.creator-header h2 {
  margin: 0;
  color: #ffffff;
  font-size: 2em;
  font-weight: 700;
  text-shadow: 0 2px 10px rgba(102, 126, 234, 0.5);
  background: linear-gradient(135deg, #667eea, #764ba2, #f093fb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.creator-close {
  background: none;
  border: none;
  font-size: 2.5em;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.creator-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  transform: rotate(90deg);
}

/* Body */
.creator-body {
  flex: 1;
  overflow-y: auto;
  padding: 30px;
  display: grid;
  grid-template-columns: 1fr 300px;
  grid-template-rows: auto auto;
  gap: 25px;
  background: linear-gradient(180deg,
    rgba(26, 26, 46, 0.6) 0%,
    rgba(15, 52, 96, 0.4) 100%
  );
}

/* Stage Area */
.stage-area {
  grid-column: 1;
  grid-row: 1;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(26, 26, 46, 0.6));
  border-radius: 15px;
  padding: 20px;
  border: 2px solid rgba(102, 126, 234, 0.2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3),
              inset 0 0 50px rgba(102, 126, 234, 0.05);
  position: relative;
  overflow: hidden;
}

.stage-area::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
  animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

.stage-title {
  font-size: 1.3em;
  font-weight: 600;
  color: #667eea;
  margin-bottom: 15px;
  text-align: center;
  text-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.costume-preview {
  width: 100%;
  height: 400px;
  background: linear-gradient(135deg, #0a0a1e, #1a1a2e);
  border-radius: 10px;
  position: relative;
  z-index: 1;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5);
}

.costume-preview canvas {
  border-radius: 10px;
  display: block;
}

.stage-info {
  text-align: center;
  margin-top: 15px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.1em;
  font-weight: 500;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* Diamond Section */
.diamond-section {
  grid-column: 2;
  grid-row: 1;
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.1), rgba(102, 126, 234, 0.1));
  border-radius: 15px;
  padding: 20px;
  border: 2px solid rgba(0, 255, 136, 0.2);
  box-shadow: 0 10px 30px rgba(0, 255, 136, 0.1);
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.diamond-title {
  font-size: 1.3em;
  font-weight: 600;
  color: #00ff88;
  text-align: center;
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.diamond-preview-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.diamond-preview {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%,
    #00ff88ee,
    #00ff88aa 40%,
    #00ff8866 70%,
    #00ff8833
  );
  box-shadow:
    0 0 30px #00ff8888,
    inset 0 0 20px #00ff8844;
  animation: diamondFloat 3s ease-in-out infinite,
             diamondGlow 2s ease-in-out infinite;
  position: relative;
}

.diamond-preview::before {
  content: '💎';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 4em;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}

@keyframes diamondFloat {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(5deg); }
}

@keyframes diamondGlow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.2); }
}

.color-picker-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.color-picker-container label {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  font-size: 0.95em;
}

#diamondColorPicker {
  width: 100%;
  height: 50px;
  border: 2px solid rgba(102, 126, 234, 0.3);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

#diamondColorPicker:hover {
  border-color: rgba(102, 126, 234, 0.6);
  box-shadow: 0 0 15px rgba(102, 126, 234, 0.3);
}

#diamondColorHex {
  width: 100%;
  padding: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(102, 126, 234, 0.3);
  border-radius: 8px;
  color: #ffffff;
  font-family: 'Courier New', monospace;
  font-size: 1.1em;
  text-align: center;
  transition: all 0.3s ease;
}

#diamondColorHex:focus {
  outline: none;
  border-color: rgba(102, 126, 234, 0.6);
  box-shadow: 0 0 15px rgba(102, 126, 234, 0.3);
}

/* Costume Gallery */
.costume-gallery {
  grid-column: 1 / 3;
  grid-row: 2;
  background: linear-gradient(135deg, rgba(118, 75, 162, 0.1), rgba(102, 126, 234, 0.1));
  border-radius: 15px;
  padding: 20px;
  border: 2px solid rgba(118, 75, 162, 0.2);
}

.gallery-title {
  font-size: 1.3em;
  font-weight: 600;
  color: #764ba2;
  margin-bottom: 20px;
  text-align: center;
  text-shadow: 0 0 10px rgba(118, 75, 162, 0.5);
}

.gallery-thumbnails {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 20px;
}

.costume-thumbnail {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(26, 26, 46, 0.6));
  border: 2px solid rgba(102, 126, 234, 0.3);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.costume-thumbnail::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0), rgba(118, 75, 162, 0.2));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.costume-thumbnail:hover {
  transform: translateY(-10px) scale(1.05);
  border-color: rgba(102, 126, 234, 0.8);
  box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4),
              0 0 25px rgba(102, 126, 234, 0.3);
}

.costume-thumbnail:hover::before {
  opacity: 1;
}

.costume-thumbnail.selected {
  border-color: #00ff88;
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.2), rgba(102, 126, 234, 0.2));
  box-shadow: 0 10px 30px rgba(0, 255, 136, 0.3),
              0 0 20px rgba(0, 255, 136, 0.2);
  transform: scale(1.05);
}

.costume-thumbnail.selected::after {
  content: '✓';
  position: absolute;
  top: 5px;
  right: 5px;
  background: #00ff88;
  color: #1a1a2e;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(0, 255, 136, 0.5);
}

.thumbnail-icon {
  font-size: 4em;
  margin-bottom: 10px;
  filter: drop-shadow(0 0 10px rgba(102, 126, 234, 0.5));
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.costume-thumbnail:hover .thumbnail-icon {
  animation: spin 1s ease-in-out;
}

@keyframes spin {
  from { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.2); }
  to { transform: rotate(360deg) scale(1); }
}

.thumbnail-name {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  font-size: 1.1em;
  position: relative;
  z-index: 1;
}

/* Footer */
.creator-footer {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  padding: 20px 30px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
  border-top: 2px solid rgba(102, 126, 234, 0.3);
  border-radius: 0 0 20px 20px;
}

.btn-cancel,
.btn-save {
  padding: 12px 30px;
  border-radius: 10px;
  font-size: 1.1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.btn-cancel {
  background: rgba(0, 0, 0, 0.3);
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-cancel:hover {
  background: rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
}

.btn-save {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #ffffff;
  box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-save:hover {
  background: linear-gradient(135deg, #764ba2, #f093fb);
  box-shadow: 0 8px 30px rgba(102, 126, 234, 0.6);
  transform: translateY(-3px);
}

/* Responsive */
@media (max-width: 968px) {
  .creator-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }

  .stage-area {
    grid-column: 1;
    grid-row: 1;
  }

  .diamond-section {
    grid-column: 1;
    grid-row: 2;
  }

  .costume-gallery {
    grid-column: 1;
    grid-row: 3;
  }
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  padding: 15px 25px;
  border-radius: 10px;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  z-index: 10001;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  background: linear-gradient(135deg, #00ff88, #00d9ff);
}

.toast-error {
  background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
}

.toast-info {
  background: linear-gradient(135deg, #667eea, #764ba2);
}
