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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: #0d0d0d;
  color: #e0e0e0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

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

header h1 {
  font-size: 1.5rem;
  color: #4caf50;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.switch-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #ccc;
}

.switch-label input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

#resetBtn {
  background: #d32f2f;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
}

#resetBtn:hover {
  background: #b71c1c;
}

#runBtn {
  background: #4caf50;
  color: white;
  border: none;
  padding: 10px 25px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
}

#runBtn:hover {
  background: #45a049;
}

.editor-container {
  display: grid;
  grid-template-columns: 1fr 10px 1fr;
  padding: 10px;
  height: calc(100vh - 60px);
  gap: 0;
}

@media (max-width: 768px) {
  .editor-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto 0px auto;
    height: auto;
    min-height: calc(100vh - 60px);
  }

  .editor-panel {
    flex: 0 0 auto;
  }

  .resize-handle {
    display: none;
  }

  .preview-panel {
    min-height: 300px;
  }
}

.editor-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 200px;
}

.resize-handle {
  width: 10px;
  background: #252525;
  cursor: col-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s;
  position: relative;
  margin: 0 3px;
}

.resize-handle::before {
  content: "⋮";
  color: #666;
  font-size: 20px;
}

.resize-handle:hover {
  background: #4caf50;
}

.resize-handle:hover::before {
  color: white;
}

.panel {
  display: flex;
  flex-direction: column;
  background: #1e1e1e;
  border-radius: 8px;
  overflow: hidden;
  min-height: 40px;
  flex: 1;
}

.panel.collapsed {
  flex: 0;
}

.panel.collapsed .panel-content {
  display: none;
}

.panel.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  border-radius: 0;
  flex: 1;
}

.panel.fullscreen .panel-content {
  display: flex;
}

.panel-header {
  background: #252525;
  padding: 10px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #333;
}

.collapse-btn {
  background: transparent;
  border: none;
  color: #4a9eff;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition:
    transform 0.2s,
    background 0.2s;
}

.collapse-btn:hover {
  background: #333;
}

.collapse-btn.collapsed {
  transform: rotate(-90deg);
}

.panel-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-content.collapsed {
  display: none;
}

.panel-header h2 {
  background: transparent;
  padding: 0;
  font-size: 1rem;
  color: #ccc;
  border: none;
}

.hamburger-menu {
  position: relative;
}

.hamburger-btn {
  background: #444;
  border: none;
  color: #ccc;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 4px;
  transition: background 0.2s;
}

.hamburger-btn:hover {
  background: #555;
}

.hamburger-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  background: #252525;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 8px 0;
  min-width: 180px;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.hamburger-menu.active .hamburger-dropdown {
  display: block;
}

.hamburger-dropdown button,
.hamburger-dropdown .menu-option {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: #ccc;
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
}

.hamburger-dropdown button:hover {
  background: #333;
}

.menu-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.menu-option input {
  width: 14px;
  height: 14px;
}

.panel-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.mini-switch input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.panel-fullscreen-btn {
  background: #444;
  border: none;
  color: #ccc;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition:
    background 0.2s,
    color 0.2s;
}

.panel-fullscreen-btn:hover {
  background: #4caf50;
  color: white;
}

.panel-fullscreen-btn.fullscreen-active {
  background: #d32f2f;
}

.panel-fullscreen-btn.fullscreen-active:hover {
  background: #b71c1c;
}

.panel-actions button {
  background: #333;
  color: #ccc;
  border: none;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: background 0.2s;
}

.panel-actions button:hover {
  background: #444;
}

textarea {
  flex: 1;
  background: #1e1e1e;
  color: #d4d4d4;
  border: none;
  padding: 15px;
  font-family: "Consolas", "Monaco", monospace;
  font-size: 14px;
  resize: none;
  line-height: 1.5;
  outline: none;
}

textarea:focus {
  background: #252525;
}

.preview-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}

.preview-content {
  flex: 1;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 10px;
  background: #f0f0f0;
}

.preview-content iframe {
  transform-origin: top center;
  transition: transform 0.1s;
}

.zoom-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.zoom-controls input[type="range"] {
  width: 100px;
  cursor: pointer;
}

.zoom-controls span {
  color: #ccc;
  font-size: 12px;
  min-width: 35px;
}

.preview-panel .panel-header {
  background: #252525;
}

.preview-panel .panel-header h2 {
  background: transparent;
  padding: 0;
  font-size: 1rem;
  color: #ccc;
  border: none;
}

.preview-panel.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  border-radius: 0;
}

iframe {
  flex: 1;
  border: none;
  width: 100%;
  height: 100%;
}
