@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&family=IM+Fell+English+SC&display=swap");

:root {
  --ink: #1f2524;
  --faded-ink: #4f5a57;
  --deep-green: #26352f;
  --wax: #7b2e2a;
}

body {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 15px;
  background:
    radial-gradient(circle at 20% 10%, rgba(255,255,255,0.08), transparent 28%),
    radial-gradient(circle at 80% 80%, rgba(255,255,255,0.06), transparent 30%),
    url("https://www.transparenttextures.com/patterns/dark-wood.png"),
    linear-gradient(135deg, #202623, #2f3a35 45%, #171d1b);
  color: var(--ink);
  overflow: hidden;
}

.container {
  display: flex;
  height: 100vh;
}

.sidebar-left,
.sidebar-right {
  width: 22%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px;
  box-sizing: border-box;
  background:
    linear-gradient(rgba(239, 232, 211, 0.95), rgba(218, 210, 187, 0.97)),
    url("https://www.transparenttextures.com/patterns/paper-fibers.png");
  border: 1px solid #2d352f;
  box-shadow:
    inset 0 0 38px rgba(37, 43, 39, 0.18),
    inset 0 0 0 5px rgba(255,255,255,0.22),
    0 0 30px rgba(0,0,0,0.32);
}

.sidebar-left {
  border-right: 3px double #424b45;
}

.sidebar-right {
  border-left: 3px double #424b45;
}

.sidebar-left h2,
.sidebar-right h3,
.main h1,
.modal-header h2,
.dock-modal-header h2 {
  font-family: "IM Fell English SC", Georgia, serif;
  color: var(--deep-green);
  font-weight: normal;
  letter-spacing: 1px;
  text-shadow: 1px 1px 0 rgba(255,255,255,0.55);
}

.sidebar-left h2,
.sidebar-right h3 {
  text-align: center;
  margin-top: 0;
  margin-bottom: 18px;
}

.sidebar-left h2 {
  font-size: 30px;
}

.sidebar-right h3 {
  font-size: 24px;
}

.main {
  width: 56%;
  padding: 24px;
  box-sizing: border-box;
  background:
    linear-gradient(rgba(232,226,205,0.92), rgba(210,202,178,0.95)),
    url("https://www.transparenttextures.com/patterns/natural-paper.png");
  border-left: 1px solid #424b45;
  border-right: 1px solid #424b45;
  position: relative;
  box-shadow:
    inset 26px 0 38px rgba(68,59,44,0.12),
    inset -26px 0 38px rgba(68,59,44,0.12);
}

.main::before {
  content: "Kiana’s Dissertation Manuscript";
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "IM Fell English SC", Georgia, serif;
  font-size: 13px;
  letter-spacing: 2.5px;
  color: rgba(39,52,47,0.68);
}

.main h1 {
  font-size: 38px;
  text-align: center;
  margin-top: 22px;
  margin-bottom: 20px;
}

#mainEditor {
  width: 100%;
  height: 76vh;
  box-sizing: border-box;
  padding: 34px 38px;
  font-size: 18px;
  line-height: 1.9;
  font-family: "Cormorant Garamond", Georgia, serif;
  border: 1px solid #48504a;
  outline: none;
  background:
    linear-gradient(90deg, rgba(95,80,52,0.10), transparent 7%, transparent 93%, rgba(95,80,52,0.08)),
    linear-gradient(rgba(250,245,226,0.92), rgba(232,222,196,0.95)),
    url("https://www.transparenttextures.com/patterns/paper-fibers.png");
  color: #202521;
  resize: none;
  box-shadow:
    inset 0 0 48px rgba(69,58,38,0.18),
    inset 0 0 0 8px rgba(255,255,255,0.16),
    0 12px 28px rgba(0,0,0,0.26);
}

#mainEditor::selection {
  background: rgba(123,46,42,0.22);
}

input,
textarea,
select,
#studyFilter,
#taskSectionFilter,
#newTaskInput,
#aiInput,
#editorAiPopupInput,
#libraryApaInput {
  background:
    linear-gradient(rgba(250,246,230,0.96), rgba(231,224,201,0.96)),
    url("https://www.transparenttextures.com/patterns/paper-fibers.png");
  border: 1px solid #59625c;
  color: var(--ink);
  padding: 8px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 15px;
  box-sizing: border-box;
  box-shadow: inset 0 0 12px rgba(46,38,25,0.08);
}

#sectionsList {
  list-style: none;
  padding: 0;
  margin: 0;
}

.section-item {
  background:
    linear-gradient(rgba(247,241,221,0.94), rgba(224,216,193,0.96)),
    url("https://www.transparenttextures.com/patterns/paper-fibers.png");
  border: 1px solid #59625c;
  border-left: 5px solid #6f775f;
  padding: 10px 11px;
  margin-bottom: 9px;
  cursor: pointer;
  font-size: 15px;
  box-shadow: 2px 2px 0 rgba(56,47,34,0.22);
}

.section-item:hover {
  transform: translateY(-1px);
  box-shadow: 3px 3px 0 rgba(56,47,34,0.28);
}

.section-item.active {
  background:
    linear-gradient(rgba(222,229,218,0.96), rgba(194,205,194,0.98)),
    url("https://www.transparenttextures.com/patterns/paper-fibers.png");
  border: 1px solid #2f3f38;
  border-left: 6px solid var(--wax);
  color: #19211e;
  font-weight: 700;
}

.subsection-item {
  margin-left: 18px;
  border-left: 4px solid #889083;
  font-size: 14px;
  opacity: 0.92;
}

button,
#addSectionBtn,
#addSubsectionBtn,
#exportBackupBtn,
#importBackupBtn,
#progressListBtn,
#addTaskBtn,
#sendAiBtn,
#editorAiPopupSendBtn,
#editorAiPopupCloseBtn,
#editorAiPopupReplaceBtn,
#editorAiPopupAddBtn,
#editorAiPopupDismissBtn {
  background: linear-gradient(#e9dfc0, #cfc3a2);
  border: 1px solid #4d554f;
  border-bottom: 2px solid #323a35;
  color: #1f2524;
  padding: 8px 11px;
  font-family: "IM Fell English SC", Georgia, serif;
  font-size: 13px;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.26);
}

button:hover {
  background: linear-gradient(#f5ecd0, #d9ceb0);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(1px);
}

.progress-bar {
  width: 100%;
  height: 18px;
  background: linear-gradient(rgba(245,240,220,0.95), rgba(218,210,187,0.95));
  border: 1px solid #4d554f;
  overflow: hidden;
  margin-bottom: 8px;
  box-shadow: inset 0 0 12px rgba(45,37,24,0.15);
}

.progress {
  width: 30%;
  height: 100%;
  background: linear-gradient(90deg, #556d61, #849174, #b4a16e, #556d61);
  background-size: 200% 100%;
  animation: candleMove 6s linear infinite;
}

#progressText {
  color: var(--faded-ink);
  text-align: center;
  font-size: 14px;
}

.sidebar-right button:not(.icon-btn) {
  width: 100%;
  margin-bottom: 10px;
}

.session-button-row {
  display: grid;
  grid-template-columns: repeat(2, 56px);
  justify-content: center;
  gap: 18px 28px;
  margin-top: 18px;
  width: 100%;
}

.icon-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: radial-gradient(circle at 35% 30%, #b88b6f, #7b2e2a 62%, #4b1715);
  border: 1px solid #b5a169;
  box-shadow:
    inset 0 0 8px rgba(255,255,255,0.12),
    2px 2px 0 rgba(0,0,0,0.32);
}

.icon-btn:hover {
  transform: scale(1.05);
}



.bottom-dock {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: flex;
  gap: 14px;
  padding: 12px 18px;
  background:
    linear-gradient(rgba(43,53,48,0.96), rgba(28,36,33,0.98)),
    url("https://www.transparenttextures.com/patterns/dark-wood.png");
  border: 1px solid #a89562;
  box-shadow: 0 0 24px rgba(0,0,0,0.45);
  z-index: 1500;
}

.dock-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid #b5a169;
  background: radial-gradient(circle at 35% 30%, #b88b6f, #7b2e2a 62%, #4b1715);
  color: #f6edd3;
  font-family: "IM Fell English SC", Georgia, serif;
}

.modal,
.dock-modal {
  background: rgba(18,23,21,0.58);
}

.modal {
  position: fixed !important;
  inset: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 999998 !important;
}

.modal.hidden,
.dock-modal.hidden,
.hidden {
  display: none !important;
}

.modal-content,
.dock-modal-window,
.editor-ai-popup {
  background:
    linear-gradient(rgba(241,234,213,0.98), rgba(219,209,184,0.98)),
    url("https://www.transparenttextures.com/patterns/paper-fibers.png");
  border: 2px solid #3f4942;
  box-shadow:
    inset 0 0 28px rgba(62,51,34,0.12),
    0 18px 44px rgba(0,0,0,0.44);
  color: var(--ink);
}

.modal-content {
  width: min(720px, 86vw) !important;
  max-height: 78vh !important;
  overflow-y: auto !important;
}

.dock-modal {
  position: fixed !important;
  inset: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999 !important;
  background: rgba(18,23,21,0.62);
}

.dock-modal-window {
  width: min(760px, 86vw) !important;
  max-height: 78vh;
  overflow-y: auto;
  padding: 18px;
  box-sizing: border-box;
}

.task-item {
  background:
    linear-gradient(rgba(247,241,221,0.94), rgba(224,216,193,0.96)),
    url("https://www.transparenttextures.com/patterns/paper-fibers.png");
  border: 1px solid #59625c;
  border-left: 5px solid var(--wax);
  padding: 10px;
  margin-bottom: 10px;
}

.task-text.completed {
  text-decoration: line-through;
  opacity: 0.56;
}

.editor-ai-popup {
  width: min(720px, 90vw) !important;
  max-height: 70vh !important;
  overflow-y: auto !important;
  padding: 16px !important;
  font-size: 16px !important;
  line-height: 1.5 !important;
}

#editorAiPopupInput {
  width: 100% !important;
  min-height: 95px !important;
  font-size: 16px !important;
  line-height: 1.4 !important;
}

#editorAiPopupResponse {
  margin-top: 12px !important;
  max-height: 320px !important;
  overflow-y: auto !important;
  white-space: pre-wrap !important;
  background: rgba(255,255,255,0.55);
  border: 1px solid #5b625d;
  padding: 12px;
}

#editorAiPopupResponseText {
  white-space: pre-wrap !important;
}

#floatingNotesContainer {
  position: fixed;
  right: 24px;
  top: 260px;
  width: 280px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.floating-note {
  background:
    linear-gradient(rgba(252,246,225,0.98), rgba(231,222,197,0.98)),
    url("https://www.transparenttextures.com/patterns/paper-fibers.png");
  border: 1px solid #4d554f;
  border-left: 5px solid var(--wax);
  box-shadow: 4px 4px 0 rgba(0,0,0,0.22);
  color: var(--ink);
  font-size: 15px;
  padding: 10px;
  transform: rotate(-1deg);
  animation: noteSlideIn 0.3s ease forwards;
}

.floating-note:nth-child(even) {
  transform: rotate(1deg);
}

#floatingTimer {
  position: fixed;
  bottom: 16px;
  right: 16px;
  background: linear-gradient(rgba(43,53,48,0.96), rgba(28,36,33,0.98));
  border: 1px solid #a89562;
  padding: 10px 14px;
  font-family: "IM Fell English SC", Georgia, serif;
  font-size: 14px;
  color: #f0e5c7;
  box-shadow: 0 0 18px rgba(0,0,0,0.42);
}

.webcam-box {
  margin-top: 16px;
  display: block;
}

#selfieVideo {
  width: 320px;
  height: 220px;
  object-fit: cover;
  display: none;
  margin-bottom: 12px;
  border: 1px solid #4d554f;
  transform: scaleX(-1);
}

#selfieVideo.active {
  display: block;
}

.webcam-button-row {
  display: flex;
  gap: 12px;
  margin: 12px 0;
}

#selfieCanvas {
  display: none !important;
}

@keyframes candleMove {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: 200% 0%;
  }
}

@keyframes noteSlideIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes noteSlideOut {
  to {
    opacity: 0;
    transform: translateX(40px);
  }
}

#flowerDrawingCanvas {
  display: block;
  margin: 12px auto;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid #4d554f;
}

.flower-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.flower-studio {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.flower-sidebar {
  width: 72px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: rgba(218, 210, 187, 0.55);
  border: 1px solid #4d554f;
  box-shadow: inset 0 0 12px rgba(37,43,39,0.08);
}

.fsb-section {
  padding: 6px 5px;
  border-bottom: 1px solid #c5bca0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.fsb-section:last-child { border-bottom: none; }

.fsb-label {
  font-family: "IM Fell English SC", Georgia, serif;
  color: #6b7870;
  font-size: 8px;
  letter-spacing: 0.06em;
  margin-bottom: 1px;
}

.fsb-color-row {
  display: flex;
  align-items: center;
  gap: 3px;
}

.fsb-color-input {
  width: 34px;
  height: 22px;
  padding: 1px;
  border: 1px solid #4d554f;
  cursor: pointer;
  background: none;
}

.fsb-icon-btn {
  padding: 2px 4px;
  font-size: 12px;
  background: rgba(239, 232, 211, 0.8);
  border: 1px solid #4d554f;
  color: #26352f;
  cursor: pointer;
  line-height: 1;
}

.fsb-icon-btn:hover,
.fsb-icon-btn.active {
  background: #7b2e2a;
  color: #efe8d3;
}

.fsb-btn {
  width: 100%;
  padding: 4px 4px;
  font-size: 10px;
  background: rgba(239, 232, 211, 0.75);
  border: 1px solid #4d554f;
  color: #26352f;
  cursor: pointer;
  text-align: left;
  box-sizing: border-box;
}

.fsb-btn:hover {
  background: rgba(239, 232, 211, 1);
}

.fsb-btn.active,
.flower-type-btn.fsb-btn.active {
  background: #7b2e2a;
  color: #efe8d3;
  border-color: #5a2120;
}

.flower-size-btn {
  padding: 3px 5px;
  font-size: 10px;
  background: rgba(239, 232, 211, 0.75);
  border: 1px solid #4d554f;
  color: #26352f;
  cursor: pointer;
  flex: 1;
}

.flower-size-btn.active {
  background: #7b2e2a;
  color: #efe8d3;
  border-color: #5a2120;
}

.flower-tool-group {
  display: flex;
  gap: 2px;
}

.fsb-actions {
  gap: 4px;
}

.fsb-plant-btn {
  background: #26352f !important;
  color: #efe8d3 !important;
  border-color: #26352f !important;
  font-size: 11px;
  text-align: center;
  margin-top: 2px;
}

.fsb-plant-btn:hover {
  background: #3d4e44 !important;
}

.fsb-slider {
  width: 100%;
  height: 4px;
  accent-color: #7b2e2a;
  margin: 2px 0;
}

.fsb-select {
  width: 100%;
  font-size: 9px;
  padding: 2px 1px;
  border: 1px solid #4d554f;
  background: rgba(239, 232, 211, 0.75);
  color: #26352f;
}

.flower-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 1px;
}

.flower-swatch {
  width: 13px;
  height: 13px;
  border: 1px solid #4d554f;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.flower-canvas-area {
  flex: 1;
  min-width: 0;
}

.flower-canvas-area canvas {
  display: block;
  width: 100%;
  height: auto;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid #4d554f;
  cursor: crosshair;
}

.flower-garden-canvas {
  position: relative;
  width: 100%;
  height: 420px;
  overflow: hidden;
  margin-top: 16px;
  border: 1px solid #4d554f;

  background-image: url("garden-landscape.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;

  background-color: transparent;
}

.garden-flower {
  position: absolute;
  width: 90px;
  height: auto;
  cursor: grab;
  user-select: none;
  z-index: 10;
}

.garden-flower:active {
  cursor: grabbing;
  z-index: 1000;
}

.guest-cams-floating-box {
  position: static;
  width: 100%;
  max-height: 260px;
  overflow-y: auto;
  margin-top: 18px;

  width: 220px;
  max-height: 420px;
  overflow-y: auto;

  padding: 12px;

  border: 2px solid #333;
  background: rgba(245, 240, 225, 0.96);

  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.25);

  z-index: 50;
}

.guest-cams-floating-box h4 {
  margin: 0 0 10px 0;
  font-size: 15px;
}

.guest-cam-card {
  margin-bottom: 14px;
}

.guest-cam-card {
  display: flex;
  flex-direction: column;
}

.guest-cam-name {
  font-size: 13px;
  margin-bottom: 6px;
}

.guest-cam-image {
  width: 100%;
  height: auto;
  border: 1px solid #444;
  display: block;
  background: #ddd;
}

.guest-cam-updated {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 4px;
}

.private-chat-box {
  margin-top: 10px;
  border-top: 1px solid #ccc;
  padding-top: 10px;
}

.private-chat-messages {
  height: 90px;
  overflow-y: auto;
  font-size: 12px;
  margin-bottom: 8px;
}

.private-chat-message {
  margin-bottom: 4px;
}

.private-chat-input-row {
  display: flex;
  gap: 6px;
}

.private-chat-input-row input {
  flex: 1;
  padding: 6px;
}

.from-kiana {
  font-weight: bold;
}

.private-chat-box {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0,0,0,0.15);
}

.private-chat-messages {
  height: 90px;
  overflow-y: auto;

  background: rgba(255,255,255,0.55);

  border: 1px solid #555;

  padding: 8px;

  margin-bottom: 8px;

  font-size: 12px;
  line-height: 1.4;
}

.private-chat-message {
  margin-bottom: 6px;
}

.private-chat-input-row {
  display: flex;
  gap: 6px;
}

.private-chat-input-row input {
  flex: 1;
  min-width: 0;
}

.private-chat-input-row button {
  flex-shrink: 0;
}

.from-kiana {
  font-weight: bold;
}
.private-status-badge {
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid #4d554f;
  font-family: "IM Fell English SC", Georgia, serif;
  text-align: center;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.22);
}

.private-status-badge.online {
  background: #dce8d2;
}

.private-status-badge.paused {
  background: #efe1b8;
}

.private-status-badge.offline {
  background: #e6c8c2;
}

.live-status-badge {
  margin: 10px 0;
  padding: 8px 10px;
  border: 1px solid #4d554f;
  text-align: center;
  font-family: "IM Fell English SC", Georgia, serif;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.22);
}

.live-status-badge.on {
  background: #dce8d2;
}

.live-status-badge.off {
  background: #e6c8c2;
}

.icon-btn {
  font-size: 22px;
  line-height: 1;
  color: #f6edd3;
  text-align: center;
}

.icon-btn img {
  display: none !important;
}

.icon-btn {
  font-size: 24px !important;
  line-height: 1 !important;
  color: #f6edd3 !important;
  text-indent: 0 !important;
  white-space: normal !important;
  font-family: "IM Fell English SC", Georgia, serif !important;
}