/**
 * CharacterCreator.css - KidsLearnCode
 * Criador de Personagens em Tela Cheia no Padrão Animal Island UI.
 * 
 * Regra de Ouro: Sem emojis na interface, botões 3D táteis de 50px, cores acolhedoras.
 */

.cc-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #fdfbf7;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  z-index: 10000;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-family: 'Nunito', 'Outfit', sans-serif;
  color: #725d42;
  animation: ccFadeIn 0.25s ease-out;
}

@keyframes ccFadeIn {
  from { opacity: 0; transform: scale(0.99); }
  to { opacity: 1; transform: scale(1); }
}

.cc-window {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  background: #fdfbf7;
  border: none;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Header */
.cc-header {
  background: #f7f3df;
  border-bottom: 3px solid #e2d9be;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.cc-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cc-title {
  margin: 0;
  font-family: 'Nunito', 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 900;
  color: #794f27;
  letter-spacing: -0.2px;
}

.cc-subtitle {
  margin: 0;
  font-family: 'Nunito', sans-serif;
  font-size: 0.92rem;
  color: #8a7b66;
  font-weight: 700;
}

.cc-close-btn {
  background: #fff;
  border: 2px solid #c4b89e;
  border-radius: 50px;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: var(--animal-cursor-pointer, pointer);
  color: #7a583e;
  box-shadow: 0 3px 0 #9e8e74;
  transition: transform 0.1s, box-shadow 0.1s;
}

.cc-close-btn:hover {
  background: #f8f8f0;
}

.cc-close-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #9e8e74;
}

/* Main Body Layout: Split Stage (Left) & Tabs (Right) */
.cc-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Left Stage: Spacious Organic Preview */
.cc-stage-panel {
  width: 440px;
  background: radial-gradient(circle at center, #f4fbf9 0%, #e6f7f3 100%);
  border-right: 3px solid #d0e4df;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  position: relative;
  flex-shrink: 0;
  overflow: visible;
}

.cc-preview-stage {
  width: 340px;
  height: 440px;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 16px;
  overflow: visible;
}

.cc-canvas {
  width: 340px;
  height: 440px;
  image-rendering: auto;
  display: block;
}


/* Stage Controls */
.cc-stage-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 360px;
  align-items: center;
}

.cc-direction-pills {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  background: #ffffff;
  padding: 6px;
  border-radius: 50px;
  border: 2px solid #c8e6df;
  width: 100%;
  box-sizing: border-box;
}

.cc-dir-btn {
  width: 100%;
  background: #f7f3df;
  border: 1.5px solid #d5cbaf;
  border-radius: 50px;
  padding: 7px 4px;
  font-size: 0.82rem;
  font-weight: 800;
  color: #725d42;
  cursor: var(--animal-cursor-pointer, pointer);
  text-align: center;
  white-space: nowrap;
  box-sizing: border-box;
  transition: all 0.15s;
}

.cc-dir-btn.active {
  background: #19c8b9;
  color: #ffffff;
  border-color: #0f8e83;
  box-shadow: 0 2px 0 #0f8e83;
}

.cc-anim-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.cc-anim-btn {
  background: #ffffff;
  border: 2px solid #d5cbaf;
  border-radius: 50px;
  padding: 7px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #725d42;
  cursor: var(--animal-cursor-pointer, pointer);
  box-shadow: 0 3px 0 #d5cbaf;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.12s;
}

.cc-anim-btn.active {
  background: #f59e0b;
  border-color: #d97706;
  color: #ffffff;
  box-shadow: 0 3px 0 #b45309;
}

.cc-anim-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #b45309;
}

.cc-random-btn {
  margin-top: 4px;
  background: #fdfbf7;
  border: 2px solid #ea580c;
  border-radius: 50px;
  padding: 9px 20px;
  font-size: 0.88rem;
  font-weight: 800;
  color: #ea580c;
  cursor: var(--animal-cursor-pointer, pointer);
  box-shadow: 0 3px 0 #c2410c;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s;
}

.cc-random-btn:hover {
  background: #fff7ed;
}

.cc-random-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #c2410c;
}

/* Right Customization Panel */
.cc-options-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #fdfbf7;
  overflow: hidden;
}

/* Category Navigation Tabs */
.cc-category-nav {
  display: flex;
  overflow-x: auto;
  padding: 14px 28px;
  background: #f8f6ec;
  border-bottom: 2px solid #e6e0ce;
  gap: 10px;
  flex-shrink: 0;
}

.cc-tab-btn {
  background: #ffffff;
  border: 2px solid #d5cbaf;
  border-radius: 50px;
  padding: 10px 20px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #725d42;
  cursor: var(--animal-cursor-pointer, pointer);
  box-shadow: 0 3px 0 #d5cbaf;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: all 0.15s;
}

.cc-tab-btn .ui-icon {
  width: 18px;
  height: 18px;
}

.cc-tab-btn.active {
  background: #19c8b9;
  border-color: #0f8e83;
  color: #ffffff;
  box-shadow: 0 3px 0 #0f8e83;
}

.cc-tab-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #0f8e83;
}

/* Options Content Scrollable Area */
.cc-tab-content {
  flex: 1;
  padding: 28px 36px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.cc-section-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #5c3c26;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Color Swatches Grid */
.cc-swatches-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.cc-swatch {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  cursor: var(--animal-cursor-pointer, pointer);
  position: relative;
  transition: transform 0.15s, box-shadow 0.15s;
}

.cc-swatch:hover {
  transform: scale(1.15);
}

.cc-swatch.active {
  border-color: #5c3c26;
  transform: scale(1.2);
  box-shadow: 0 0 0 3px #19c8b9, 0 4px 8px rgba(0, 0, 0, 0.25);
}

.cc-swatch-reset {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fdfbf7;
  color: #725d42;
}

.cc-swatch-reset svg {
  width: 20px;
  height: 20px;
  stroke: #725d42;
  transition: transform 0.2s ease;
}

.cc-swatch-reset:hover svg {
  transform: rotate(-45deg);
}

.cc-swatch-reset.active {
  background: #e6f9f6;
  color: #0f8e83;
}

.cc-swatch-reset.active svg {
  stroke: #0f8e83;
}

/* Style Items Card Grid - Visual Icon Buttons */
.cc-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 14px;
}

.cc-item-card {
  background: #ffffff;
  border: 2px solid #e2d9be;
  border-radius: 20px;
  width: 78px;
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: var(--animal-cursor-pointer, pointer);
  box-shadow: 0 4px 0 #e2d9be;
  padding: 4px;
  box-sizing: border-box;
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s, background 0.12s;
  outline: none;
}

.cc-item-card:hover {
  background: #fdfbf7;
  border-color: #19c8b9;
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #b8dfd8;
}

.cc-item-card.active {
  background: #e6f9f6;
  border-color: #19c8b9;
  box-shadow: 0 4px 0 #0f8e83;
}

.cc-item-card:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #0f8e83;
}

.cc-preview-icon {
  width: 62px;
  height: 62px;
  pointer-events: none;
  display: block;
  overflow: visible;
  object-fit: contain;
}

/* Footer / Action Bar */
.cc-footer {
  background: #f7f3df;
  border-top: 3px solid #e2d9be;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-shrink: 0;
}

.cc-name-input-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  max-width: 360px;
}

.cc-name-label {
  font-size: 0.92rem;
  font-weight: 800;
  color: #5c3c26;
  white-space: nowrap;
}

.cc-name-input {
  background: #ffffff;
  border: 2px solid #c4b89e;
  border-radius: 50px;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #5c3c26;
  outline: none;
  width: 100%;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.cc-name-input:focus {
  border-color: #19c8b9;
  box-shadow: 0 0 0 3px rgba(25, 200, 185, 0.25);
}

.cc-save-btn {
  background: #19c8b9;
  border: 2px solid #0f8e83;
  border-radius: 50px;
  padding: 14px 38px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  cursor: var(--animal-cursor-pointer, pointer);
  box-shadow: 0 4px 0 #0f8e83;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.12s;
}

.cc-save-btn:hover {
  background: #17b3a6;
}

.cc-save-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #0f8e83;
}
