/* LuaLike Web REPL Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  min-height: 100vh;
  color: #333;
}

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

/* Header */
header {
  text-align: center;
  margin-bottom: 30px;
  color: white;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

header p {
  font-size: 1.1rem;
  opacity: 0.9;
}

/* Main Content */
.main-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 30px;
}

@media (max-width: 768px) {
  .main-content {
    grid-template-columns: 1fr;
  }
}

/* Editor Section */
.editor-section {
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.editor-header {
  background: #2c3e50;
  color: white;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.editor-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.editor-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.editor-controls select {
  padding: 5px 10px;
  border: none;
  border-radius: 5px;
  background: white;
  color: #333;
  cursor: pointer;
}

.editor-controls button {
  padding: 8px 15px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
}

.editor-controls button:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.run-button {
  background: #27ae60;
  color: white;
}

.run-button:hover {
  background: #229954;
}

#clear {
  background: #e74c3c;
  color: white;
}

#clear:hover {
  background: #c0392b;
}

/* Code Editor Container */
.code-editor-container {
  position: relative;
  height: 400px;
  background: #2d3748;
  border-radius: 0 0 10px 10px;
  overflow: hidden;
}

/* Code Editor */
.code-editor {
  width: 100%;
  height: 100%;
  padding: 20px;
  border: none;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.6;
  background: #2d3748;
  color: #e2e8f0;
  outline: none;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  resize: vertical;
  min-height: 400px;
}

.code-editor:empty::before {
  content: attr(data-placeholder);
  color: #718096;
  font-style: italic;
  pointer-events: none;
}

.code-editor:focus {
  background: #2d3748;
}

/* Prism.js overrides for better integration */
.code-editor .token.comment {
  color: #68d391;
  font-style: italic;
}

.code-editor .token.string {
  color: #fbb6ce;
}

.code-editor .token.number {
  color: #f6ad55;
}

.code-editor .token.keyword {
  color: #90cdf4;
  font-weight: bold;
}

.code-editor .token.function {
  color: #f6e05e;
}

.code-editor .token.operator {
  color: #e2e8f0;
}

.code-editor .token.punctuation {
  color: #a0aec0;
}

.code-editor .token.variable {
  color: #e2e8f0;
}

/* Scrollbar styling for code editor */
.code-editor::-webkit-scrollbar {
  width: 8px;
}

.code-editor::-webkit-scrollbar-track {
  background: #2d3748;
}

.code-editor::-webkit-scrollbar-thumb {
  background: #4a5568;
  border-radius: 4px;
}

.code-editor::-webkit-scrollbar-thumb:hover {
  background: #718096;
}

/* Output Section */
.output-section {
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.output-header {
  background: #34495e;
  color: white;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.output-header h3 {
  margin: 0;
  font-size: 1.2rem;
}

#clearOutput {
  padding: 8px 15px;
  border: none;
  border-radius: 5px;
  background: #95a5a6;
  color: white;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
}

#clearOutput:hover {
  background: #7f8c8d;
  transform: translateY(-1px);
}

.output-content {
  height: 400px;
  padding: 20px;
  overflow-y: auto;
  background: #2c3e50;
  color: #ecf0f1;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.output-content:empty::before {
  content: "Output will appear here when you run your code...";
  color: #7f8c8d;
  font-style: italic;
}

/* Footer */
footer {
  text-align: center;
  color: white;
  opacity: 0.8;
  padding: 20px 0;
}

footer p {
  margin-bottom: 5px;
}

footer a {
  color: #3498db;
  text-decoration: none;
  font-weight: bold;
}

footer a:hover {
  color: #2980b9;
  text-decoration: underline;
}

/* Animations */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.container>* {
  animation: slideIn 0.6s ease-out;
}

/* Output styling for different message types */
.output-content .error {
  color: #e74c3c;
  font-weight: bold;
}

.output-line {
  color: #ffffff;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  white-space: pre-wrap;
  margin: 2px 0;
}

.output-content .success {
  color: #27ae60;
}

.output-content .info {
  color: #3498db;
}

/* Scrollbar styling */
.output-content::-webkit-scrollbar {
  width: 8px;
}

.output-content::-webkit-scrollbar-track {
  background: #34495e;
}

.output-content::-webkit-scrollbar-thumb {
  background: #7f8c8d;
  border-radius: 4px;
}

.output-content::-webkit-scrollbar-thumb:hover {
  background: #95a5a6;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  header h1 {
    font-size: 2rem;
  }

  .editor-header {
    flex-direction: column;
    align-items: stretch;
  }

  .editor-controls {
    justify-content: center;
  }

  #sourceCode,
  .output-content {
    height: 300px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }
}