* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Noto Sans', sans-serif;
  background: #0a0a0a;
  color: #ffffff;
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.header {
  text-align: center;
  margin-bottom: 40px;
  padding: 30px 0;
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  border-radius: 15px;
  border: 1px solid #333;
}

.title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 10px;
  background: linear-gradient(45deg, #00ff88, #0088ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: 1.1rem;
  color: #aaa;
  opacity: 0.9;
}

.main-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  align-items: start;
}

.generator-section,
.chat-section {
  background: #1a1a1a;
  border-radius: 15px;
  padding: 25px;
  border: 1px solid #333;
  height: fit-content;
}

.input-area {
  margin-bottom: 30px;
}

#scriptPrompt {
  width: 100%;
  padding: 15px;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 8px;
  color: #fff;
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  resize: vertical;
  min-height: 120px;
  margin-bottom: 20px;
}

#scriptPrompt:focus {
  outline: none;
  border-color: #00ff88;
  box-shadow: 0 0 0 2px rgba(0, 255, 136, 0.2);
}

.options {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.option-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.option-group span {
  font-weight: 600;
  color: #ccc;
  font-size: 14px;
}

.option-group select {
  padding: 10px;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 6px;
  color: #fff;
  font-family: inherit;
}

.generate-btn {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #00ff88, #0088ff);
  border: none;
  border-radius: 8px;
  color: #000;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.generate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 255, 136, 0.3);
}

.generate-btn:active {
  transform: translateY(0);
}

.generate-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.output-area {
  position: relative;
}

.output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.output-header h3 {
  color: #fff;
  font-size: 18px;
}

.copy-btn {
  padding: 8px 16px;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
  display: none;
  /* hidden until script output present */
}

.output-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.copy-settings-btn {
  padding: 8px 12px;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
}

.copy-btn:hover {
  background: #3a3a3a;
  border-color: #00ff88;
}

.script-output {
  background: #0f0f0f;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 20px;
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  line-height: 1.5;
  max-height: 500px;
  overflow-y: auto;
  white-space: pre-wrap;
  color: #e0e0e0;
}

.placeholder {
  color: #666;
  font-style: italic;
  text-align: center;
  padding: 40px 20px;
}

.chat-section {
  max-height: 800px;
  display: flex;
  flex-direction: column;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #333;
}

.chat-header h3 {
  color: #fff;
  font-size: 18px;
}

.clear-btn {
  padding: 6px 12px;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s ease;
}

.clear-btn:hover {
  background: #3a3a3a;
  border-color: #ff4444;
}

.chat-container {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0;
  max-height: 600px;
  margin-bottom: 20px;
}

.chat-message {
  margin-bottom: 15px;
  padding: 15px;
  border-radius: 12px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-message.user {
  background: #2a2a2a;
  border: 1px solid #444;
  margin-left: 50px;
}

.chat-message.assistant {
  background: linear-gradient(135deg, #1a3a1a, #1a1a3a);
  border: 1px solid #333;
  margin-right: 50px;
}

.message-content {
  font-size: 14px;
  line-height: 1.6;
}

.chat-message.assistant .message-content {
  position: relative;
}

.roblox-game {
  color: #ff4444;
  font-weight: bold;
  background: rgba(255, 68, 68, 0.1);
  padding: 2px 4px;
  border-radius: 3px;
  border: 1px solid rgba(255, 68, 68, 0.3);
}

.chat-input-area {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

#chatInput {
  flex: 1;
  padding: 12px;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 8px;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
}

#chatInput:focus {
  outline: none;
  border-color: #00ff88;
  box-shadow: 0 0 0 2px rgba(0, 255, 136, 0.2);
}

.send-btn {
  padding: 12px 20px;
  background: linear-gradient(135deg, #00ff88, #0088ff);
  border: none;
  border-radius: 8px;
  color: #000;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.send-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(0, 255, 136, 0.3);
}

.send-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #333;
  border-top: 2px solid #00ff88;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
  .main-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .options {
    flex-direction: column;
    gap: 15px;
  }
  
  .title {
    font-size: 2rem;
  }
  
  .chat-message.user {
    margin-left: 20px;
  }
  
  .chat-message.assistant {
    margin-right: 20px;
  }
}