/* ---------------------------------------------------------
   GLOBAL RESET + BASE
--------------------------------------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, sans-serif;
  background: #f4f4f4;
  color: #222;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ---------------------------------------------------------
   HEADER
--------------------------------------------------------- */
.app-header {
  background: #222;
  color: #fff;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.app-header h1 {
  font-size: 1.4rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

#theme-select {
  padding: 4px 6px;
}

/* ---------------------------------------------------------
   MAIN LAYOUT
--------------------------------------------------------- */
.main-layout {
  flex: 1;
  display: flex;
  gap: 16px;
  padding: 16px;
  overflow: hidden;
}

/* ---------------------------------------------------------
   PANELS
--------------------------------------------------------- */
.panel {
  background: #fff;
  border: 1px solid #ccc;
  padding: 12px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
}

.screenshot-panel {
  flex: 1;
  min-width: 40%;
}

.editor-panel {
  flex: 1;
  min-width: 40%;
}

/* ---------------------------------------------------------
   SCREENSHOT PANEL
--------------------------------------------------------- */
#screenshot-dropzone {
  border: 2px dashed #aaa;
  padding: 20px;
  text-align: center;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 12px;
}

#screenshot-dropzone:hover {
  background: #f0f0f0;
}

#screenshot-input {
  display: none;
}

#screenshot-viewer-wrapper {
  flex: 1;
  overflow: hidden;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #000;
  position: relative;
}

#screenshot-viewer img {
  transform-origin: center center;
  user-select: none;
  pointer-events: none;
}

.screenshot-controls {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

.screenshot-controls button {
  padding: 6px 12px;
}

/* ---------------------------------------------------------
   EDITOR PANEL
--------------------------------------------------------- */
.field-group {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
}

.field-group label {
  font-weight: 600;
  margin-bottom: 4px;
}

.field-group input,
.field-group textarea {
  padding: 6px;
  border: 1px solid #bbb;
  border-radius: 4px;
  font-size: 0.95rem;
}

.field-row {
  display: flex;
  gap: 12px;
}

.field-row .half {
  flex: 1;
}

.editor-actions {
  margin-top: auto;
  display: flex;
  gap: 10px;
}

.editor-actions button {
  padding: 6px 12px;
}

/* ---------------------------------------------------------
   OUTPUT SECTION
--------------------------------------------------------- */
.output-section {
  border-top: 1px solid #ccc;
  background: #fff;
  padding: 12px 16px;
}

.output-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.output-tab {
  padding: 6px 12px;
  border: 1px solid #aaa;
  background: #eee;
  cursor: pointer;
  border-radius: 4px;
}

.output-tab.active {
  background: #ddd;
  font-weight: 600;
}

.output-panels {
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fafafa;
  height: 200px;
  overflow: auto;
  margin-bottom: 10px;
}

.output-panel {
  display: none;
  padding: 10px;
}

.output-panel.active {
  display: block;
}

.output-actions {
  display: flex;
  gap: 10px;
}

.output-actions button {
  padding: 6px 12px;
}

/* ---------------------------------------------------------
   BUTTONS (GLOBAL)
--------------------------------------------------------- */
button {
  background: #444;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

button:hover {
  background: #333;
}
