/* ========================================
   FONT FACES
   ======================================== */
@font-face {
  font-family: 'Alora';
  src: url('/assets/fonts/Alora.ttf') format('truetype');
  font-weight: 400;
}
@font-face {
  font-family: 'Alina';
  src: url('/assets/fonts/Alina.ttf') format('truetype');
  font-weight: 400;
}
@font-face {
  font-family: 'Amelia';
  src: url('/assets/fonts/Amelia.ttf') format('truetype');
  font-weight: 400;
}
@font-face {
  font-family: 'Anna';
  src: url('/assets/fonts/Anna.ttf') format('truetype');
  font-weight: 400;
}
@font-face {
  font-family: 'Brielle';
  src: url('/assets/fonts/Brielle.ttf') format('truetype');
  font-weight: 400;
}
@font-face {
  font-family: 'Emma';
  src: url('/assets/fonts/Emma.ttf') format('truetype');
  font-weight: 400;
}
@font-face {
  font-family: 'Flora';
  src: url('/assets/fonts/Flora.ttf') format('truetype');
  font-weight: 400;
}
@font-face {
  font-family: 'Grace';
  src: url('/assets/fonts/Grace.ttf') format('truetype');
  font-weight: 400;
}
@font-face {
  font-family: 'Harmony';
  src: url('/assets/fonts/Harmony.ttf') format('truetype');
  font-weight: 400;
}
@font-face {
  font-family: 'Hope';
  src: url('/assets/fonts/Hope.ttf') format('truetype');
  font-weight: 400;
}
@font-face {
  font-family: 'Isabelle';
  src: url('/assets/fonts/Isabelle.ttf') format('truetype');
  font-weight: 400;
}
@font-face {
  font-family: 'Juniper';
  src: url('/assets/fonts/Juniper.ttf') format('truetype');
  font-weight: 400;
}
@font-face {
  font-family: 'Kendall';
  src: url('/assets/fonts/Kendall.ttf') format('truetype');
  font-weight: 400;
}
@font-face {
  font-family: 'Luna';
  src: url('/assets/fonts/Luna.ttf') format('truetype');
  font-weight: 400;
}
@font-face {
  font-family: 'Megan';
  src: url('/assets/fonts/Megan.ttf') format('truetype');
  font-weight: 400;
}
@font-face {
  font-family: 'Melody';
  src: url('/assets/fonts/Melody.ttf') format('truetype');
  font-weight: 400;
}
@font-face {
  font-family: 'Skylar';
  src: url('/assets/fonts/Skylar.ttf') format('truetype');
  font-weight: 400;
}
@font-face {
  font-family: 'Sophia';
  src: url('/assets/fonts/Sophia.ttf') format('truetype');
  font-weight: 400;
}
@font-face {
  font-family: 'Stella';
  src: url('/assets/fonts/Stella.ttf') format('truetype');
  font-weight: 400;
}

/* ========================================
   STEP TRANSITIONS
   ======================================== */
.step-content {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.step-content.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step-content {
  animation-duration: 0.4s;
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   PROGRESS BAR
   ======================================== */
.progress-step {
  position: relative;
  flex: 1;
  transition: all 0.3s ease;
}

.progress-step::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 2px;
  background: #e5e7eb;
  z-index: -1;
}

.progress-step:last-child::after {
  display: none;
}

.progress-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  font-weight: bold;
  color: #6b7280;
  transition: all 0.3s;
}

.progress-step.active .progress-circle {
  background: #9333ea;
  color: white;
  transform: scale(1.1);
  box-shadow: 0 0 0 4px rgba(147, 51, 234, 0.2);
}

.progress-step.completed .progress-circle {
  background: #22c55e;
  color: white;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
}

/* ========================================
   TYPE SELECTION CARDS
   ======================================== */
.type-card {
  transition: all 0.3s ease;
  cursor: pointer;
}

.type-card:hover {
  transform: translateY(-4px);
}

.type-card:active {
  transform: translateY(-2px);
}

/* ========================================
   TEXT ACCORDION
   ======================================== */
.text-accordion {
  transition: max-height 0.35s ease-out;
  max-height: 0;
  overflow: hidden;
}

.text-accordion.open {
  max-height: 900px;
}

.text-header {
  scroll-margin-top: 100px;
}

/* ========================================
   COLOR PICKER CIRCLE (КРАСИВЫЙ КРУГ)
   ======================================== */
.color-picker-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid #e5e7eb;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.color-picker-circle:hover {
  border-color: #9333ea;
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(147, 51, 234, 0.3);
}

.color-picker-circle:active {
  transform: scale(1.05);
}

.color-picker-input,
.shadow-color-input,
.stroke-color-input {
  cursor: pointer;
  z-index: 2;
  border-radius: 50%;
}

/* ========================================
   DROPDOWN WITH SCROLLING
   ======================================== */
.font-select {
  height: auto !important;
  max-height: none !important;
}

.font-select option {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.effect-select {

}

/* ========================================
   HIDDEN SHADOW/STROKE COLOR PICKERS
   ======================================== */
.shadow-color-picker,
.stroke-color-picker {
  transition: all 0.3s ease;
}

/* ========================================
   CANVAS - ФИКСИРОВАННЫЕ РАЗМЕРЫ
   ======================================== */
#canvas-container {
  position: relative;
  width: 100%;
  max-width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem 0;
  overflow: visible;
}

#canvas {
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  touch-action: none;
}

.canvas-container {
  position: relative !important;
  margin: 0 auto !important;
  display: block !important;
}

.upper-canvas {
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
}

#text-list {
  max-height: 400px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* ========================================
   CATEGORY BUTTONS
   ======================================== */
.category-btn {
  transition: all 0.2s ease;
}

/* ========================================
   MOBILE OPTIMIZATIONS
   ======================================== */
@media (max-width: 768px) {
  .progress-circle {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
  
  .progress-step p {
    font-size: 10px;
  }
  
  .text-accordion.open {
    max-height: 1000px;
  }
  
  .step-content {
    padding: 0;
  }
  
  .type-card {
    padding: 1rem;
  }
  
  .type-card svg {
    width: 60px;
    height: 60px;
  }
  
  .type-card h3 {
    font-size: 1rem;
  }
  
  .type-card p {
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .grid.grid-cols-2 {
    gap: 0.5rem;
  }
  
  .text-accordion .grid.grid-cols-5 {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .text-accordion .grid.grid-cols-2 {
    grid-template-columns: 1fr;
  }
  
  #canvas-container {
    padding: 0.5rem 0;
  }
}

@media (max-width: 360px) {
  #canvas-container {
    padding: 0.25rem 0;
  }
}

@media (min-width: 1024px) {
  #text-list {
    max-height: 500px;
  }
}

#step-4 .lg\:grid {
  gap: 1rem;
}

@media (max-width: 1023px) {
  #step-4 {
    padding: 0;
  }
  
  #step-4 button:not(#add-text-btn) {
    font-size: 14px;
    padding: 0.65rem 1rem;
  }
  
  #add-text-btn {
    font-size: 16px;
    padding: 0.75rem 1rem;
  }
}

@media (max-width: 640px) {
  .text-accordion .grid {
    gap: 0.5rem;
  }
  
  .text-accordion input,
  .text-accordion select {
    font-size: 14px;
    padding: 0.5rem;
  }
  
  .text-accordion .grid-cols-5 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ========================================
   LOADING STATES
   ======================================== */
.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* ========================================
   SMOOTH ROTATE FOR ICONS
   ======================================== */
.rotate-180 {
  transform: rotate(180deg);
}

svg {
  transition: transform 0.3s ease;
}

/* ========================================
   FOCUS STATES FOR ACCESSIBILITY
   ======================================== */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #9333ea;
  outline-offset: 2px;
}

/* ========================================
   DISABLED STATES
   ======================================== */
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ========================================
   NOTIFICATION IMPROVEMENTS
   ======================================== */
.notification-enter {
  animation: slideInRight 0.3s ease-out;
}

.notification-exit {
  animation: slideOutRight 0.3s ease-in;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* ========================================
   PRINT HIDE
   ======================================== */
@media print {
  #progress-bar,
  button,
  #fullscreen-canvas,
  #global-loader {
    display: none !important;
  }
}

/* ========================================
   ПРЕДОТВРАЩАЕМ ГОРИЗОНТАЛЬНУЮ ПРОКРУТКУ
   ======================================== */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

.container {
  max-width: 100%;
  overflow-x: hidden;
}

/* ========================================
   HERO CAROUSEL - УВЕЛИЧЕННЫЕ РАЗМЕРЫ НА МОБИЛАХ
   ======================================== */
.hero-carousel-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-card {
  position: absolute;
  width: 250px;
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-card-center {
  z-index: 3;
  transform: scale(1.15) translateY(0);
  opacity: 1;
}

.hero-card-left {
  z-index: 1;
  transform: scale(0.85) translateX(-150px) translateY(25px);
  opacity: 0.6;
}

.hero-card-right {
  z-index: 1;
  transform: scale(0.85) translateX(150px) translateY(25px);
  opacity: 0.6;
}

@media (max-width: 1024px) {
  .hero-card {
    width: 240px;
  }
  
  .hero-card-left {
    transform: scale(0.85) translateX(-140px) translateY(20px);
  }
  
  .hero-card-right {
    transform: scale(0.85) translateX(140px) translateY(20px);
  }
}

@media (max-width: 768px) {
  .hero-carousel-container {
    height: 400px !important;
  }
  
  .hero-card {
    width: 220px;
  }
  
  .hero-card-center {
    transform: scale(1.2) translateY(0);
  }
  
  .hero-card-left {
    transform: scale(0.85) translateX(-120px) translateY(18px);
  }
  
  .hero-card-right {
    transform: scale(0.85) translateX(120px) translateY(18px);
  }
}

@media (max-width: 480px) {
  .hero-carousel-container {
    height: 380px !important;
  }
  
  .hero-card {
    width: 180px;
  }
  
  .hero-card-center {
    transform: scale(1.1) translateY(0);
  }
  
  .hero-card-left {
    transform: scale(0.8) translateX(-100px) translateY(15px);
  }
  
  .hero-card-right {
    transform: scale(0.8) translateX(100px) translateY(15px);
  }
}

@media (max-width: 360px) {
  .hero-carousel-container {
    height: 350px !important;
  }
  
  .hero-card {
    width: 160px;
  }
  
  .hero-card-left {
    transform: scale(0.75) translateX(-90px) translateY(12px);
  }
  
  .hero-card-right {
    transform: scale(0.75) translateX(90px) translateY(12px);
  }
}

/* ========================================
   IMAGE MODAL
   ======================================== */
#image-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  animation: fadeIn 0.2s ease;
}

#image-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

#modal-image {
  max-width: 90%;
  max-height: 90vh;
  object-fit: contain;
  animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.gallery-image {
  cursor: zoom-in;
  transition: transform 0.2s;
}

.gallery-image:hover {
  transform: scale(1.05);
}

/* ========================================
   STYLES SLIDER
   ======================================== */
#styles-slider {
  overflow: hidden;
  width: 100%;
  padding-top: 8px; /* Добавляем padding сверху, чтобы карточки не обрезались при hover */
  padding-bottom: 8px;
}

#styles-gallery {
  display: flex;
  gap: 1rem;
  transition: transform 0.3s ease-in-out;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.style-card {
  transition: all 0.2s ease;
}

.style-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.style-card.selected {
  border-color: #9333ea !important;
  background-color: #f3e8ff;
}

/* Кнопки слайдера */
#prev-style,
#next-style {
  transition: all 0.2s ease;
}

#prev-style:hover:not([style*="cursor: not-allowed"]),
#next-style:hover:not([style*="cursor: not-allowed"]) {
  background-color: #f3f4f6;
  transform: translateY(-50%) scale(1.1);
}

@media (max-width: 768px) {
  .style-card {
    width: 150px !important;
  }
  
  #prev-style,
  #next-style {
    padding: 0.5rem;
  }
  
  #prev-style svg,
  #next-style svg {
    width: 1.25rem;
    height: 1.25rem;
  }
}