/* Shadow Generator specific styles */
.shadow-types {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.type-btn {
  padding: 10px 20px;
  border: 2px solid #e1e8ed;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.type-btn.active {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border-color: transparent;
}

.type-btn:hover:not(.active) {
  border-color: #667eea;
  background: #f8f9fa;
}

.shadow-layers {
  margin-bottom: 16px;
}

.shadow-layer {
  margin-bottom: 20px;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 2px solid #e1e8ed;
}

.layer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.layer-title {
  font-size: 14px;
  font-weight: 600;
  color: #2c3e50;
}

.remove-layer {
  padding: 4px 12px;
  border: none;
  background: #dc3545;
  color: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.remove-layer:hover:not(:disabled) {
  background: #c82333;
}

.remove-layer:disabled {
  background: #e9ecef;
  color: #6c757d;
  cursor: not-allowed;
}

.layer-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-label {
  font-size: 13px;
  font-weight: 600;
  color: #34495e;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.value-display {
  font-weight: 500;
  color: #667eea;
}

.shadow-layer input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #e1e8ed;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.shadow-layer input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.shadow-layer input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.shadow-color {
  width: 100%;
  height: 40px;
  border: 2px solid #e1e8ed;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.shadow-color:hover {
  border-color: #667eea;
  transform: scale(1.02);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #667eea;
}

.preview-section {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 20px;
  align-items: start;
}

.preview-container {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 40px;
  border: 2px solid #e1e8ed;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.box-preview {
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-element {
  width: 120px;
  height: 120px;
  background: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: #2c3e50;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}

.text-preview {
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-text {
  font-size: 32px;
  font-weight: bold;
  color: #333333;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}

.preview-settings {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.color-input {
  width: 100%;
  height: 40px;
  border: 2px solid #e1e8ed;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.color-input:hover {
  border-color: #667eea;
  transform: scale(1.02);
}

.code-output {
  width: 100%;
  min-height: 120px;
  padding: 16px;
  border: 2px solid #e1e8ed;
  border-radius: 8px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 13px;
  line-height: 1.5;
  background: #f8f9fa;
  color: #2c3e50;
  resize: vertical;
  margin-bottom: 12px;
}

.code-output:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.preset-shadows {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.preset-item {
  height: 100px;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #6c757d;
  position: relative;
  overflow: hidden;
}

.preset-item:hover {
  transform: translateY(-2px);
}

.preset-item::after {
  content: attr(data-name);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 4px 8px;
  font-size: 10px;
  text-align: center;
  transform: translateY(100%);
  transition: transform 0.2s ease;
}

.preset-item:hover::after {
  transform: translateY(0);
}

/* 模态框 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  border-radius: 12px;
  max-width: 600px;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 2px solid #e1e8ed;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #2c3e50;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: #e9ecef;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  color: #6c757d;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: #dc3545;
  color: white;
}

.modal-body {
  padding: 20px;
  max-height: 60vh;
  overflow-y: auto;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.preset-grid .preset-item {
  height: 80px;
}

@media (max-width: 768px) {
  .layer-controls {
    grid-template-columns: 1fr;
  }
  
  .preview-section {
    grid-template-columns: 1fr;
  }
  
  .shadow-types {
    flex-direction: column;
  }
  
  .preset-shadows {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .preset-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}