/* style.css */
:root {
  --bg-dark: #0f172a;
  --bg-panel: #1e293b;
  --bg-editor: #0d1117;
  --primary: #3b82f6; /* Azul Vibrante */
  --primary-hover: #2563eb;
  --accent: #10b981; /* Verde Sucesso */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border: #334155;
  --font-ui: "Inter", sans-serif;
  --font-code: "Fira Code", monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-ui);
  height: 100vh;
  overflow: hidden;
}

/* Layout Grid */
.app-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100vh;
}

/* Sidebar */
.sidebar {
  background-color: var(--bg-panel);
  border-right: 1px solid var(--border);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo i {
  color: #f7df1e;
  font-size: 1.8rem;
}

.progress-container p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 5px;
}
.progress-bar-bg {
  background: var(--bg-dark);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar-fill {
  background: var(--accent);
  height: 100%;
  transition: width 0.3s ease;
}
#progressText {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
  margin-top: 5px;
  text-align: right;
}

.nav-modules {
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.nav-item {
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: all 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}
.nav-item.active {
  background: var(--primary);
  color: white;
}
.nav-item.completed i {
  color: var(--accent);
}

/* Main Content */
.content-area {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.lesson-header {
  padding: 20px 30px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-dark);
}
.tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary);
  font-weight: 700;
}
h1 {
  font-size: 1.5rem;
  margin-top: 5px;
}

.actions {
  display: flex;
  gap: 10px;
}
button {
  padding: 10px 20px;
  border-radius: 6px;
  border: none;
  font-family: var(--font-ui);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: 0.2s;
}
.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-hover);
}
.btn-primary:disabled {
  background: var(--border);
  cursor: not-allowed;
  opacity: 0.5;
}
.btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  border-color: var(--text-main);
  color: var(--text-main);
}

/* Workspace Split */
.workspace {
  display: grid;
  grid-template-columns: 40% 60%;
  flex: 1;
  overflow: hidden;
}

/* Theory Panel */
.theory-panel {
  padding: 30px;
  background: var(--bg-dark);
  overflow-y: auto;
  border-right: 1px solid var(--border);
  line-height: 1.6;
}
.theory-panel h2 {
  margin-bottom: 15px;
  color: var(--text-main);
}
.theory-panel p {
  margin-bottom: 15px;
  color: var(--text-muted);
}
.theory-panel code {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 5px;
  border-radius: 4px;
  font-family: var(--font-code);
  color: #f7df1e;
}

/* Editor Panel */
.editor-panel {
  background: var(--bg-editor);
  display: flex;
  flex-direction: column;
  position: relative;
}
.editor-header {
  background: #010409;
  padding: 10px 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
}
.code-wrapper {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
}
#codeEditor {
  flex: 1;
  background: transparent;
  border: none;
  color: #e6edf3;
  font-family: var(--font-code);
  font-size: 14px;
  padding: 20px;
  resize: none;
  outline: none;
  line-height: 1.5;
  z-index: 10;
}
.line-numbers {
  padding: 20px 10px;
  text-align: right;
  color: var(--border);
  font-family: var(--font-code);
  font-size: 14px;
  line-height: 1.5;
  background: #010409;
  user-select: none;
}

.console-output {
  height: 150px;
  background: #010409;
  border-top: 1px solid var(--border);
  padding: 15px;
  font-family: var(--font-code);
  font-size: 0.85rem;
  overflow-y: auto;
}
.console-label {
  display: block;
  color: var(--text-muted);
  margin-bottom: 5px;
  font-size: 0.75rem;
  text-transform: uppercase;
}
#logs {
  color: var(--accent);
  white-space: pre-wrap;
}
#logs .error {
  color: #f87171;
}

.btn-run {
  position: absolute;
  bottom: 170px;
  right: 20px;
  background: var(--accent);
  color: #064e3b;
  z-index: 20;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.btn-run:hover {
  background: #34d399;
  transform: translateY(-2px);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--bg-panel);
  border: 1px solid var(--accent);
  padding: 15px 20px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}
.toast.active {
  transform: translateY(0);
  opacity: 1;
}
.toast i {
  font-size: 2rem;
  color: var(--accent);
}
.toast h4 {
  margin-bottom: 2px;
}
.toast p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
