:root {
  --primary: #2c3e50;
  --accent: #e74c3c;
  --light: #ecf0f1;
  --gray: #95a5a6;
  --snippet-bg: #fef9e7;
  --preview-bg: #fdfdfd;
  --edit-bg: #fff8e1;
  --placeholder-bg: #e8f4fc;
  --compound-ref-bg: #eaf7f0;
  --compound-ref-border: #27ae60;
  --citation-bg: #f8f9fa;
  --citation-border: #9b59b6;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f9f9f9;
  padding: 1em;
}

header {

  margin-bottom: 1.2em;
  padding: 1em;
  background: var(--primary);
  color: white;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
  margin-bottom: 1em;
  justify-content: center;
  position: sticky;
  top: 0;
  background: white;
  padding: 0.8em;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  width: 75%;
  left: 12.5%;
  margin-top: 140px;
}

button {
  padding: 0.5em 0.9em;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.88em;
  transition: background 0.3s;
}

button:hover { background: #1a252f; }
button.accent { background: var(--accent); }
button.word { background: #27ae60; }
button.preview { background: #3498db; }
button.snippet-btn {
  background: #f39c12;
  font-size: 0.8em;
  padding: 0.3em 0.6em;
  margin-left: 0.3em;
}
button.edit { background: #3498db; font-size: 0.8em; padding: 0.3em 0.6em; }
button.save { background: #27ae60; }
button.cancel { background: #95a5a6; }
button.copy { background: #9b59b6; }

/* ✅ MOBİL SANDVİÇ MENÜ */
#mobile-menu-btn {
  display: block;
  position: fixed;
  top: 145px;
  left: 17px;

  background: var(--primary);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0.6em;
  font-size: 1.2em;
  cursor: pointer;
}

#mobile-menu {
  display: none;
  position: fixed;
  top: 200px;
  left: 17px;
  width: 280px;
  height: 80vh;
  background: white;
  box-shadow: 2px 0 10px rgba(0,0,0,0.15);
  z-index: 1999;
  flex-direction: column;
  padding-top: 60px;
  overflow-y: auto;
}

#mobile-menu.open {
  display: flex;
}

.mobile-menu-item {
  width: 100%;
  padding: 0.7em 1.2em;
  text-align: left;
  border: none;
  background: white;
  color: var(--primary);
  font-size: 1em;
  cursor: pointer;
  border-bottom: 1px solid #eee;
}

.mobile-menu-item:hover {
  background: #f1f1f1;
}

@media (max-width: 768px) {
  .controls {
    display: none !important;
  }
  #mobile-menu-btn {
    display: block;
  }
}

/* ✅ KAPAK SAYFASI STİLİ */
.cover-section {
  background: white;
  border-radius: 6px;
  padding: 2.5em 1.5em;
  margin-bottom: 1.5em;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  text-align: center;
  font-family: "Times New Roman", serif;
}

.cover-section h2 { font-size: 1.4em; margin: 0.8em 0; color: var(--primary); }
.cover-section h3 { font-size: 1.2em; margin: 0.8em 0; }
.cover-section h1 { font-size: 1.6em; margin: 1.5em 0; font-weight: bold; }

.cover-section .cover-input {
  width: 100%;
  max-width: 500px;
  margin: 0.6em auto;
  padding: 0.5em;
  font-size: 1.1em;
  border: 1px solid #ccc;
  text-align: center;
  font-family: "Times New Roman", serif;
}

/* SAĞ YAN PANEL */
#sidebar-toggle {
  position: fixed;
  right: 17px;
  top: 145px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 4px 0 0 4px;
  padding: 0.6em 0.4em;
  cursor: pointer;
  z-index: 1000;
  font-weight: bold;
}

#sidebar {
  position: fixed;
  right: -350px;
  top: 100px;
  width: 320px;
  height: calc(100vh - 100px);
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px 0 0 6px;
  box-shadow: -2px 0 10px rgba(0,0,0,0.1);
  z-index: 1001;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}

#sidebar.open { right: 0; top: 100px; }

#sidebar-header {
  background: var(--primary);
  color: white;
  padding: 0.8em 2em 0.8em 0.8em;
  font-weight: bold;
  position: relative;
}

#sidebar-tabs {
  display: flex;
  background: #f1f1f1;
}

.sidebar-tab {
  flex: 1;
  padding: 0.6em;
  text-align: center;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.sidebar-tab.active { background: white; border-bottom: 2px solid var(--primary); }

#sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 1em;
}

.sidebar-item {
  padding: 0.6em;
  margin: 0.4em 0;
  background: #fafafa;
  border-radius: 4px;
  border-left: 3px solid #3498db;
  cursor: pointer;
  font-size: 0.95em;
}

.sidebar-item:hover { background: #eef7ff; }
.sidebar-item.compound { border-left-color: #27ae60; }
.sidebar-item.citation { border-left-color: #9b59b6; }

#snippets-panel,
#compound-refs-panel,
#citations-panel {
  background: white;
  border-radius: 6px;
  padding: 1em;
  margin-bottom: 1.5em;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  display: none;
}

#snippets-list,
#compound-refs-list,
#citations-list {
  margin-top: 1em;
}

.snippet-item,
.compound-ref-item,
.citation-item {
  padding: 1em;
  margin: 0.7em 0;
  border-radius: 6px;
  position: relative;
}

.snippet-item { background: var(--snippet-bg); border-left: 4px solid #f39c12; }
.compound-ref-item { background: var(--compound-ref-bg); border-left: 4px solid var(--compound-ref-border); }
.citation-item { background: var(--citation-bg); border-left: 4px solid var(--citation-border); }

.snippet-item.editing { background: var(--edit-bg); border-left-color: #e67e22; }
.compound-ref-item.editing { background: #d5f5e3; border-left-color: #229954; }
.citation-item.editing { background: #f5f0fc; border-left-color: #8e44ad; }

.snippet-title,
.compound-ref-title,
.citation-title {
  font-weight: bold;
  margin-bottom: 0.4em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.snippet-title { color: #e67e22; }
.compound-ref-title { color: #27ae60; }
.citation-title { color: #9b59b6; }

.snippet-actions,
.compound-ref-actions,
.citation-actions {
  display: flex;
  gap: 0.3em;
}

.snippet-content,
.compound-ref-content,
.citation-content {
  white-space: pre-wrap;
  font-family: monospace;
  font-size: 0.95em;
  padding: 0.6em;
  border-radius: 4px;
  background: rgba(0,0,0,0.02);
}

#workspace {
  max-width: 850px;
  margin: 0 auto;
}

.section {
  background: white;
  border-radius: 6px;
  padding: 1.2em;
  margin-bottom: 1.2em;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  border-left: 4px solid var(--primary);
}

.section.compound { border-left-color: #3498db; }
.section.figure { border-left-color: #27ae60; }

.section h3, .section h4 {
  margin-bottom: 0.6em;
  color: var(--primary);
}

.input-with-buttons {
  display: flex;
  align-items: center;
  gap: 0.3em;
  flex-wrap: wrap;
}

.input-with-buttons input {
  flex: 1;
  min-width: 150px;
}

input, textarea {
  width: 100%;
  padding: 0.6em;
  margin: 0.4em 0;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
}

textarea {
  min-height: 80px;
  resize: vertical;
}

.btn-group {
  display: flex;
  gap: 0.5em;
  margin-top: 0.6em;
}

#preview {
  margin-top: 2em;
  padding: 1.5em;
  background: var(--preview-bg);
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  display: none;
  border: 1px solid #eee;
}

#preview h2 {
  text-align: center;
  margin-bottom: 1em;
  color: var(--primary);
}

#preview-content {
  font-family: 'Times New Roman', serif;
  font-size: 1.1em;
  line-height: 1.6;
  max-width: 800px;
  margin: 0 auto;
}

@media print {
  body { padding: 0; background: white; }
  .controls, header button, #workspace, #snippets-panel, #compound-refs-panel, #citations-panel, #sidebar-toggle, #sidebar, #mobile-menu-btn, #mobile-menu { display: none; }
  #preview { display: block !important; }
}