.spin-wheel-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  font-family: Arial, sans-serif;
}

.room-controls {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.room-info {
  display: flex;
  gap: 15px;
  align-items: center;
  font-weight: bold;
}

.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s;
}

.btn-primary {
  background: #007bff;
  color: white;
}
.btn-secondary {
  background: #6c757d;
  color: white;
}
.btn-success {
  background: #28a745;
  color: white;
}
.btn-info {
  background: #17a2b8;
  color: white;
}
.btn-danger {
  background: #dc3545;
  color: white;
}

.btn:hover {
  opacity: 0.9;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.wheel-section {
  display: flex;
  justify-content: center;
  margin: 40px 0;
}

.wheel-container {
  position: relative;
  display: inline-block;
}

#wheel-canvas {
  border: 3px solid #333;
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
  transform-origin: center center;
  transition: none; /* We'll control transitions via JavaScript */
}

.wheel-pointer {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-top: 30px solid #333;
  z-index: 10;
}

.spin-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid #333;
  background: #fff;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s;
}

.spin-button:hover:not(:disabled) {
  background: #f0f0f0;
  transform: translate(-50%, -50%) scale(1.1);
}

.slice-controls {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.add-slice-form {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  align-items: center;
  flex-wrap: wrap;
}

#slice-name-input {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

#slice-color-input {
  width: 50px;
  height: 38px;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
}

.slices-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
  margin-bottom: 15px;
}

.slice-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  background: white;
  border-radius: 4px;
  border-left: 4px solid;
}

.slice-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.slice-color-preview {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid #ddd;
}

.slice-limit-info {
  text-align: center;
  font-weight: bold;
  color: #666;
}

.result-display {
  background: #e8f5e8;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  margin: 20px 0;
  border: 2px solid #28a745;
}

.result-display h3 {
  margin: 0 0 10px 0;
  color: #28a745;
}

#result-text {
  font-size: 24px;
  font-weight: bold;
  color: #333;
}

@media (max-width: 768px) {
  .room-controls {
    flex-direction: column;
    align-items: center;
  }

  .room-info {
    flex-direction: column;
    text-align: center;
  }

  #wheel-canvas {
    width: 300px;
    height: 300px;
  }

  .add-slice-form {
    flex-direction: column;
  }

  #slice-name-input {
    min-width: auto;
  }
}

/* Slice Library Styles */
.slice-library-section {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.slice-library-section h3 {
  margin: 0 0 10px 0;
  color: #333;
}

.slice-library-section p {
  margin: 0 0 15px 0;
  color: #666;
  font-size: 14px;
}

.library-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.library-select {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
}

.library-preview {
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px;
  margin-top: 15px;
}

.library-preview h4 {
  margin: 0 0 10px 0;
  color: #333;
}

.library-preview p {
  margin: 0 0 15px 0;
  color: #666;
  font-style: italic;
}

.preview-slices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.preview-slice-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 4px;
  border-left: 4px solid;
}

.preview-slice-color {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid #ddd;
  flex-shrink: 0;
}

.preview-slice-info {
  flex: 1;
}

.preview-slice-name {
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 2px;
}

.preview-slice-description {
  font-size: 12px;
  color: #666;
  line-height: 1.3;
}

.library-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid #eee;
  padding-top: 15px;
}

.library-loading {
  text-align: center;
  padding: 20px;
  color: #666;
}

.library-error {
  background: #f8d7da;
  color: #721c24;
  padding: 10px;
  border-radius: 4px;
  margin-top: 10px;
}

@media (max-width: 768px) {
  .library-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .library-select {
    min-width: auto;
  }

  .preview-slices-grid {
    grid-template-columns: 1fr;
  }

  .library-actions {
    flex-direction: column;
  }
}

/* Notification Styles */
.spin-wheel-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  max-width: 400px;
  font-weight: 500;
  animation: slideInRight 0.3s ease-out;
}

.notification-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.notification-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.notification-info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

.notification-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.notification-close:hover {
  background: rgba(0, 0, 0, 0.1);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .spin-wheel-notification {
    position: fixed;
    top: 10px;
    left: 10px;
    right: 10px;
    max-width: none;
  }

  @keyframes slideInRight {
    from {
      transform: translateY(-100%);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }
}

/* Loading state styles */
.room-loading {
  opacity: 0.7;
  pointer-events: none;
}

.room-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
