/* Wheel Spinner CSS Styles */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: #f5f7fa;
  min-height: 100vh;
  color: #333;
  overflow: hidden;
}

.top-bar {
  background: #2c3e50;
  color: white;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.top-bar-buttons {
  display: flex;
  gap: 15px;
}

.top-bar-btn {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
}

.top-bar-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

.top-bar-btn:active {
  transform: translateY(0);
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  background: white;
  display: flex;
  height: calc(100vh - 48px);
}

.wheel-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: white;
  border-right: 1px solid #e0e6ed;
}

.controls-section {
  width: 380px;
  padding: 40px 30px;
  background: #fafbfc;
  overflow-y: auto;
}

.wheel-container {
  position: relative;
  width: calc(100vh - 120px);
  height: calc(100vh - 120px);
  max-width: calc(100vw - 500px);
  max-height: calc(100vh - 120px);
  margin: 20px 0;
  overflow: hidden;
}

.wheel-container canvas {
  display: block;
  margin: 0;
  padding: 0;
  transform-origin: 50% 50%;
  backface-visibility: hidden;
  will-change: transform;
}

.wheel-pointer {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 20px solid transparent;
  border-bottom: 20px solid transparent;
  border-right: 40px solid #2c3e50;
  z-index: 100;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.spin-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border: none;
  border-radius: 50%;
  background: #3498db;
  color: white;
  font-size: 32px;
  cursor: pointer;
  z-index: 200;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.spin-button:hover {
  background: #2980b9;
  transform: translate(-50%, -50%) scale(1.1);
}

.spin-button:disabled {
  background: #95a5a6;
  cursor: not-allowed;
  transform: translate(-50%, -50%);
}

.controls {
  width: 100%;
}

.title {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 30px;
  color: #2c3e50;
  text-align: center;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: text;
  transition: all 0.2s;
  width: 100%;
  resize: none;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.title:hover {
  border-color: #e0e6ed;
  background: #fafbfc;
}

.title:focus {
  outline: none;
  border-color: #3498db;
  background: white;
}

.input-group {
  margin-bottom: 30px;
}

.input-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #34495e;
  font-size: 20px;
}

.names-textarea {
  width: 100%;
  height: 400px;
  padding: 12px;
  border: 2px solid #e0e6ed;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  resize: none;
  overflow-y: auto;
  transition: border-color 0.2s;
}

.names-textarea:focus {
  outline: none;
  border-color: #3498db;
}

.names-textarea:disabled {
  background: #f5f6fa;
  color: #95a5a6;
  cursor: not-allowed;
}

.title:disabled {
  background: #f5f6fa;
  color: #95a5a6;
  cursor: not-allowed;
  border-color: #e0e6ed;
}

.names-count {
  margin-top: 8px;
  font-size: 12px;
  color: #7f8c8d;
}

.colors-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
}

.color-box {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.color-box:hover {
  transform: scale(1.1);
  border-color: #bdc3c7;
}

.color-controls {
  display: flex;
  gap: 8px;
}

.pointer-color-control {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 2px solid #e0e6ed;
  border-radius: 8px;
  background: #fafbfc;
  cursor: pointer;
  transition: all 0.2s;
}

.pointer-color-control:hover {
  border-color: #3498db;
  background: #f8f9fa;
}

.pointer-color-box {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.2s;
}

.pointer-color-box:hover {
  transform: scale(1.1);
}

.pointer-color-label {
  font-size: 14px;
  color: #7f8c8d;
  font-weight: 500;
}

.audio-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.volume-slider {
  flex: 1;
  height: 4px;
  background: #e0e6ed;
  border-radius: 2px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.volume-slider::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: #3498db;
  border-radius: 50%;
  cursor: pointer;
}

.volume-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #3498db;
  border-radius: 50%;
  border: none;
  cursor: pointer;
}

.volume-label {
  color: #666;
  font-size: 13px;
  min-width: 50px;
}

.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: #3498db;
  color: white;
}

.btn-primary:hover {
  background: #2980b9;
}

.btn-danger {
  background: #e74c3c;
  color: white;
}

.btn-danger:hover {
  background: #c0392b;
}

.btn-secondary {
  background: #95a5a6;
  color: white;
}

.btn-secondary:hover {
  background: #7f8c8d;
}

.btn:disabled {
  background: #bdc3c7;
  cursor: not-allowed;
}

.result-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.result-modal.show {
  opacity: 1;
  visibility: visible;
}

.result-content {
  background: white;
  padding: 60px;
  border-radius: 16px;
  text-align: center;
  max-width: 600px;
  width: 90%;
  transform: scale(0.7);
  transition: transform 0.3s;
}

.result-modal.show .result-content {
  transform: scale(1);
}

.result-name {
  font-size: 48px;
  font-weight: bold;
  color: #2c3e50;
  margin-bottom: 40px;
  word-wrap: break-word;
  line-height: 1.2;
}

.result-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.result-btn {
  padding: 16px 32px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  font-weight: 600;
  transition: all 0.2s;
  min-width: 120px;
}

.result-btn-keep {
  background: #27ae60;
  color: white;
}

.result-btn-keep:hover {
  background: #229954;
  transform: translateY(-1px);
}

.result-btn-remove {
  background: #e74c3c;
  color: white;
}

.result-btn-remove:hover {
  background: #c0392b;
  transform: translateY(-1px);
}

/* Dynamic Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  text-align: center;
}

.modal-content.small {
  max-width: 400px;
}

.modal-content.medium {
  max-width: 500px;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-title {
  margin-bottom: 20px;
  color: #2c3e50;
  font-size: 24px;
  font-weight: 600;
}

.modal-title.error {
  color: #e74c3c;
}

.modal-description {
  margin-bottom: 20px;
  color: #7f8c8d;
  line-height: 1.5;
}

.modal-url-container {
  background: #f8f9fa;
  border: 2px solid #e0e6ed;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
  word-break: break-all;
  font-family: monospace;
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-url-container:hover {
  border-color: #3498db;
  background: #e3f2fd;
}

.modal-button-container {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.modal-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
  font-size: 14px;
}

.modal-btn.primary {
  background: #3498db;
  color: white;
}

.modal-btn.primary:hover {
  background: #2980b9;
  transform: translateY(-1px);
}

.modal-btn.success {
  background: #27ae60;
  color: white;
}

.modal-btn.success:hover {
  background: #229954;
  transform: translateY(-1px);
}

.modal-btn.danger {
  background: #e74c3c;
  color: white;
}

.modal-btn.danger:hover {
  background: #c0392b;
  transform: translateY(-1px);
}

.modal-btn.secondary {
  background: #95a5a6;
  color: white;
}

.modal-btn.secondary:hover {
  background: #7f8c8d;
  transform: translateY(-1px);
}

.modal-btn.full-width {
  width: 100%;
}

/* Search Input */
.modal-search-input {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e6ed;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 20px;
  transition: border-color 0.2s;
}

.modal-search-input:focus {
  outline: none;
  border-color: #3498db;
}

/* Wheel List */
.wheel-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.wheel-item {
  padding: 15px;
  border: 2px solid #e0e6ed;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  background: #fafbfc;
  text-align: left;
}

.wheel-item:hover {
  border-color: #3498db;
  background: #f8f9fa;
}

.wheel-item-name {
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 5px;
}

.wheel-item-meta {
  font-size: 12px;
  color: #7f8c8d;
}

.wheel-item-preview {
  font-size: 12px;
  color: #95a5a6;
  margin-top: 3px;
}

.no-results {
  text-align: center;
  color: #7f8c8d;
  padding: 20px;
  font-style: italic;
}

/* Toast Messages */
.toast-message {
  position: fixed;
  top: 70px;
  right: 20px;
  color: white;
  padding: 12px 20px;
  border-radius: 6px;
  z-index: 10000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-width: 300px;
  transition: opacity 0.3s;
}

.toast-message.success {
  background: #27ae60;
}

.toast-message.error {
  background: #e74c3c;
}

.toast-message.info {
  background: #3498db;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }

  .wheel-section {
    border-right: none;
    border-bottom: 1px solid #e0e6ed;
    padding: 20px;
  }

  .controls-section {
    width: 100%;
    padding: 30px 20px;
  }

  .wheel-container {
    width: calc(100vw - 40px);
    height: calc(100vw - 40px);
    max-width: calc(100vh - 200px);
    max-height: calc(100vh - 200px);
  }
}
