/* Import base styles */
@import url('style.css');

/* Loading styles */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.loader {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(41, 255, 137, 0.2);
  border-top: 4px solid #29FF89;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.hidden {
  display: none !important;
}

/* Hero section */
.hero-section {
  position: relative;
  padding: 3rem 2rem;
  background: url('../../img/banner/banner2.png') no-repeat center center/cover;
  border-radius: 1rem;
  text-align: center;
  margin-bottom: 2rem;
  overflow: hidden;
  animation: fadeUp 0.8s ease;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.7) 70%);
  z-index: 0;
}

.hero-section h1,
.hero-section .description {
  position: relative;
  z-index: 1;
}

.hero-section h1 {
  font-size: 2.5rem;
  color: #29FF89;
  margin-bottom: 1rem;
}

.hero-section .description {
  font-size: 1.1rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

/* App layout */
.app-layout {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 2rem;
  animation: fadeUp 0.8s ease;
}

/* Controls panel */
.controls {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.neu-card {
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px);
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.4);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.2rem;
  color: #29FF89;
  margin-bottom: 1rem;
  font-weight: 600;
}

.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: #EAEAEA;
  font-weight: 500;
}

.neu-select {
  width: 100%;
  padding: 0.8rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  color: #EAEAEA;
  font-family: inherit;
  transition: all 0.3s ease;
}

.neu-select:focus {
  outline: none;
  border-color: #29FF89;
  box-shadow: 0 0 0 2px rgba(41, 255, 137, 0.2);
}

.neu-range {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  outline: none;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.neu-range:hover {
  opacity: 1;
}

.neu-range::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #29FF89, #1ED4F0);
  border-radius: 50%;
  cursor: pointer;
}

.neu-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #29FF89, #1ED4F0);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.range-value {
  margin-left: 1rem;
  color: #29FF89;
  font-weight: 600;
  min-width: 50px;
  text-align: center;
}

/* Block library */
.block-library {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.block {
  width: 40px;
  height: 40px;
  border-radius: 0.3rem;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  position: relative;
}

.block:hover {
  transform: scale(1.1);
  border-color: #29FF89;
}

.block.selected {
  border-color: #1ED4F0;
  box-shadow: 0 0 10px rgba(30, 212, 240, 0.5);
}

.block img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

/* Buttons */
.neu-button {
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #29FF89, #1ED4F0);
  border: none;
  border-radius: 0.5rem;
  color: #000;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
}

.neu-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(41, 255, 137, 0.3);
}

.neu-button.primary {
  font-size: 1.1rem;
  width: 100%;
}

/* Preview card */
.preview-card {
  min-height: 600px;
  display: flex;
  flex-direction: column;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.preview-actions {
  display: flex;
  gap: 1rem;
}

.preview-actions .neu-button {
  padding: 0.7rem 1.2rem;
  font-size: 0.9rem;
}

/* Gradient preview */
.gradient-preview-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.gradient-preview {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0.5rem;
  padding: 2rem;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2px;
  overflow: auto;
  max-height: 500px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.gradient-row {
  display: flex;
  gap: 2px;
}

.gradient-block {
  width: 24px;
  height: 24px;
  border-radius: 2px;
  overflow: hidden;
  position: relative;
  transition: transform 0.2s ease;
}

.gradient-block:hover {
  transform: scale(1.2);
  z-index: 10;
}

.gradient-block img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

/* 3D mode */
.gradient-preview.mode-3d .gradient-block {
  transform: rotateX(45deg) rotateY(45deg);
  box-shadow: 
    2px 2px 4px rgba(0, 0, 0, 0.3),
    -1px -1px 2px rgba(255, 255, 255, 0.1);
}

.gradient-preview.mode-3d .gradient-block:hover {
  transform: rotateX(45deg) rotateY(45deg) scale(1.2);
}

/* View toggle */
.view-toggle {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: 0.4s;
  border-radius: 34px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: #EAEAEA;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background: linear-gradient(135deg, #29FF89, #1ED4F0);
}

input:checked + .toggle-slider:before {
  transform: translateX(26px);
}

/* Responsive design */
@media (max-width: 1024px) {
  .app-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .controls {
    order: 2;
  }
  
  .preview-card {
    order: 1;
  }
}

@media (max-width: 768px) {
  .hero-section h1 {
    font-size: 2rem;
  }
  
  .hero-section .description {
    font-size: 1rem;
  }
  
  .neu-card {
    padding: 1rem;
  }
  
  .gradient-block {
    width: 20px;
    height: 20px;
  }
  
  .block-library {
    grid-template-columns: repeat(auto-fill, minmax(35px, 1fr));
  }
  
  .block {
    width: 35px;
    height: 35px;
  }
}