/* VS Code-like Editor Styles */

:root {
  --vscode-bg: #1e1e1e;
  --vscode-line-highlight: #282828;
  --vscode-selection: #264f78;
  --vscode-editor-foreground: #d4d4d4;
  --vscode-sidebar: #252526;
  --vscode-titlebar: #3c3c3c;
  --vscode-activity-bar: #333333;
  --vscode-line-numbers: #858585;
  --vscode-scrollbar-bg: #1e1e1e;
  --vscode-scrollbar-thumb: #424242;
}

/* Code editor container */
.code-editor {
  background-color: var(--vscode-bg);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  margin: 20px 0;
  overflow: hidden;
  font-family: 'Fira Code', monospace;
  transition: box-shadow 0.3s ease;
  border: 1px solid #000;
}

.code-editor:hover {
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

/* Editor header (title bar) */
.editor-header {
  background-color: var(--vscode-titlebar);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid #000;
}

/* File tabs */
.file-tab {
  background-color: var(--vscode-sidebar);
  color: #cccccc;
  padding: 6px 15px;
  font-size: 12px;
  border-radius: 4px 4px 0 0;
  position: relative;
  border-top: 1px solid #3f3f3f;
  border-left: 1px solid #3f3f3f;
  border-right: 1px solid #3f3f3f;
}

.file-tab.active {
  background-color: var(--vscode-bg);
  color: #ffffff;
  border-bottom: 1px solid var(--vscode-bg);
}

.file-tab::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath fill='%23f5bb12' d='M26.5,21.5H5.5a2,2,0,0,1-2-2V6.5a2,2,0,0,1,2-2h21a2,2,0,0,1,2,2v13A2,2,0,0,1,26.5,21.5Z'/%3E%3Cpath fill='%23121212' d='M26.5,5a1.5,1.5,0,0,1,1.5,1.5v13a1.5,1.5,0,0,1-1.5,1.5H5.5A1.5,1.5,0,0,1,4,19.5V6.5A1.5,1.5,0,0,1,5.5,5h21m0-1H5.5A2.5,2.5,0,0,0,3,6.5v13A2.5,2.5,0,0,0,5.5,22h21A2.5,2.5,0,0,0,29,19.5V6.5A2.5,2.5,0,0,0,26.5,4Z'/%3E%3Cpath fill='%236a53ff' d='M13.382 9.037c.255 0 .51.11.682.277l.655.777 4.087 4.826s.292.364.292.655c0 .291-.292.655-.292.655l-4.087 4.826-.655.777a.918.918 0 01-.682.278c-.509 0-.921-.533-.921-1.191v-9.69c0-.657.412-1.19.921-1.19z'/%3E%3C/svg%3E");
  background-size: contain;
  vertical-align: middle;
}

/* Editor controls */
.editor-controls {
  display: flex;
  gap: 10px;
}

/* Control button styling */
.control-btn {
  background: linear-gradient(180deg, #4a4a4a 0%, #3a3a3a 100%);
  color: #ffffff;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  border: 1px solid #555;
}

.control-btn i {
  font-size: 11px;
}

/* Run button styling */
.control-btn#runCode {
  background: linear-gradient(180deg, #3f8574 0%, #2c6357 100%);
  border-color: #2d6d60;
}

.control-btn#runCode:hover {
  background: linear-gradient(180deg, #459485 0%, #337668 100%);
}

/* Reset button styling */
.control-btn#resetCode {
  background: linear-gradient(180deg, #8c3939 0%, #6e2c2c 100%);
  border-color: #742e2e;
}

.control-btn#resetCode:hover {
  background: linear-gradient(180deg, #a14444 0%, #833333 100%);
}

/* Button hover & active states */
.control-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.control-btn:active {
  transform: translateY(1px);
  box-shadow: none;
}

/* Ripple effect for buttons */
.button-ripple {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  transform: scale(0);
  animation: ripple 0.6s linear forwards;
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Editor body */
.editor-body {
  position: relative;
  padding: 0;
  background-color: var(--vscode-bg);
  counter-reset: line;
}

/* Code area with line numbers */
#codeEditor {
  font-family: 'Fira Code', monospace;
  font-size: 14px;
  line-height: 1.5;
  color: var(--vscode-editor-foreground);
  white-space: pre;
  tab-size: 4;
  -moz-tab-size: 4;
  margin: 0;
  padding: 10px 10px 10px 50px;  /* Extra padding for line numbers */
  overflow: auto;
  max-height: 300px;
  counter-reset: line;
  position: relative;
  outline: none;
  background-color: var(--vscode-bg);
}

/* Line numbers */
#codeEditor::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 40px;
  background-color: var(--vscode-bg);
  border-right: 1px solid #333;
  z-index: 1;
}

#codeEditor > div {
  position: relative;
  counter-increment: line;
}

#codeEditor > div::before {
  content: counter(line);
  position: absolute;
  left: -45px;
  width: 30px;
  color: var(--vscode-line-numbers);
  text-align: right;
  font-size: 12px;
}

/* Scrollbar styling */
#codeEditor::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

#codeEditor::-webkit-scrollbar-track {
  background: var(--vscode-scrollbar-bg);
}

#codeEditor::-webkit-scrollbar-thumb {
  background: var(--vscode-scrollbar-thumb);
  border-radius: 5px;
}

#codeEditor::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Syntax highlighting colors */
.code-keyword {
  color: #569cd6;
}

.code-function {
  color: #dcdcaa;
}

.code-string {
  color: #ce9178;
}

.code-number {
  color: #b5cea8;
}

.code-comment {
  color: #6a9955;
  font-style: italic;
}

.code-operator {
  color: #d4d4d4;
}

.code-variable {
  color: #9cdcfe;
}

/* Console output */
.game-output {
  background-color: #1e1e1e;
  border-top: 1px solid #333;
  padding: 10px;
}

.output-header {
  display: flex;
  justify-content: space-between;
  color: #cccccc;
  font-size: 12px;
  padding-bottom: 5px;
  border-bottom: 1px solid #333;
  margin-bottom: 8px;
}

.status {
  font-weight: 500;
}

.status.pending {
  color: #cccc00;
}

.status.error {
  color: #f14c4c;
}

.status.success {
  color: #4cae4c;
}

.output-body {
  color: #d4d4d4;
  font-family: 'Fira Code', monospace;
  font-size: 13px;
  min-height: 60px;
  max-height: 150px;
  overflow-y: auto;
  padding: 5px;
  border-radius: 2px;
  background-color: #252526;
}

/* Hint section */
.game-hint {
  padding: 10px;
  background-color: #252526;
  border-top: 1px solid #333;
}

.hint-toggle {
  color: #cccccc;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.hint-toggle i {
  color: #e6b422;
}

.hint-toggle:hover {
  color: #ffffff;
}

.hint-content {
  display: none;
  margin-top: 8px;
  padding: 8px;
  background-color: #2d2d2d;
  border-radius: 4px;
  border-left: 3px solid #e6b422;
  color: #cccccc;
  font-size: 13px;
}

/* Success message */
.success-message {
  display: none;
  background: linear-gradient(135deg, #2d803e, #3ca553);
  color: white;
  padding: 15px;
  margin-top: 15px;
  border-radius: 5px;
  text-align: center;
  animation: successPulse 2s infinite;
}

@keyframes successPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(60, 165, 83, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(60, 165, 83, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(60, 165, 83, 0);
  }
}

.success-message h4 {
  margin-top: 0;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.success-message h4 i {
  animation: trophyWiggle 1s ease-in-out infinite;
}

@keyframes trophyWiggle {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}

.success-email {
  font-size: 14px;
  margin-top: 10px;
}

.success-email strong {
  background-color: rgba(255, 255, 255, 0.2);
  padding: 2px 5px;
  border-radius: 3px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .code-game {
    padding: 15px;
  }
  
  .editor-body {
    padding: 5px;
  }
  
  .output-body {
    max-height: 100px;
  }
  
  .control-btn {
    padding: 4px 8px;
    font-size: 11px;
  }
} 