/* Modernized styles by Phil - Adjusted margins and responsive tweaks */
:root {
  --primary-color: #388e3c;
  --background-color: #f5f5f5;
  --panel-bg: #ffffff;
  --border-radius: 8px;
  --padding: 8px;
  --gap: 8px;
  --max-width: 60vw;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--background-color);
  font-family: 'Segoe UI', Tahoma, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.header {
  width: var(--max-width);
  margin: var(--gap) auto 0 auto;
  padding: var(--padding);
  background-color: var(--primary-color);
  color: #fff;
  font-size: 1.5rem;
  border-bottom-left-radius: var(--border-radius);
  border-bottom-right-radius: var(--border-radius);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.textarea {
  width: var(--max-width);
  margin: var(--gap) auto;
  padding: var(--padding);
  background-color: var(--panel-bg);
  border-radius: var(--border-radius);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  height: 300px;
  overflow-y: auto;
}

.inputarea {
  width: var(--max-width);
  margin: var(--gap) auto;
  display: flex;
  align-items: center;
  gap: var(--gap);
  padding: var(--padding);
  background-color: var(--panel-bg);
  border-radius: var(--border-radius);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.input_elem {
  flex: 10;
  padding: var(--padding);
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: var(--border-radius);
  box-sizing: border-box;
}

/* Auto-resize textarea */
#inputarea .input_elem {
  overflow-y: hidden;
  resize: none;
}

.div_audio {
  width: var(--max-width);
  margin: var(--gap) auto;
  display: flex;
  gap: var(--gap);
  padding: var(--padding);
  background-color: var(--panel-bg);
  border-radius: var(--border-radius);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  height: 200px;
}

.div_canvas {
  flex: 1;
}

#canvas {
  width: 100%;
  height: 100%;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: var(--border-radius);
  display: block;
}

.div_breath {
  width: 200px;
  height: 200px;
}

.file,
#attach_icon,
#file_folder_icon,
#vector_store_icon,
#share_screen_icon,
#record_audio_icon {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.footer {
  width: var(--max-width);
  margin: var(--gap) auto var(--gap) auto;
  padding: var(--padding);
  text-align: center;
  color: #fff;
  font-size: 0.9rem;
  background-color: var(--primary-color);
  border-top-left-radius: var(--border-radius);
  border-top-right-radius: var(--border-radius);
}

/* Floating div styles */
#floating-div {
	display: none;
	position: fixed;
	top: 20px;
	right: 20px;
	width: 350px;
	height: 230px;
	padding: 20px;
	background: rgba(255,255,255,0.95);
	box-shadow: 0 2px 10px rgba(0,0,0,0.3);
	border-radius: 8px;
	z-index: 999;
}
#floating-div-title {
	font-weight: bold;
	font-size: 20px;
}

#floating-div .close-icon {
	position: absolute;
	top: 8px;
	right: 8px;
	cursor: pointer;
	font-size: 18px;
}
#floating-contents {
	width: 100%;
	height: 80%;
	overflow-y: scroll;
	overflow-x: auto;
	white-space: nowrap;
}

.file_entry {
	width: 100%;
	padding: 3px;
	margin: 0px;
	font-size: 14px;
	font-family: monospace;
	font-weight: bold;
	cursor: pointer;
}
.dir_span {
	color: red;
}
.file_span {
	color: blue; 
}

.has-menu {
	cursor: context-menu;
}

#file_context_menu {
	position: fixed;
	display: none;
	background: #ffffff;
	border: 1px solid #c4c4c4;
	box-shadow: 0 4px 12px rgba(0,0,0,.15);
	border-radius: .25rem;
	list-style: none;
	padding: .25rem 0;
	margin: 0;
	z-index: 9999;
	min-width: 160px;
}
#file_context_menu.show { display: block; }

#file_context_menu li {
	padding: .4rem .8rem;
	white-space: nowrap;
	cursor: pointer;
}
#file_context_menu li:hover {
	background: #eaeafa;
}

#dir_context_menu {
	position: fixed;
	display: none;
	background: #ffffff;
	border: 1px solid #c4c4c4;
	box-shadow: 0 4px 12px rgba(0,0,0,.15);
	border-radius: .25rem;
	list-style: none;
	padding: .25rem 0;
	margin: 0;
	z-index: 9999;
	min-width: 160px;
}
#dir_context_menu.show { display: block; }

#dir_context_menu li {
	padding: .4rem .8rem;
	white-space: nowrap;
	cursor: pointer;
}
#dir_context_menu li:hover {
	background: #eaeafa;
}

/* highlight plugin configuration */
pre code.hljs {
  background:#282c34;
  color:#e0e0e0;
  padding:1rem;
  border-radius:6px;
  overflow-x:auto;
}

/* Enhanced saturation animation for header and footer */
@keyframes saturationPulse {
  0%, 100% {
    filter: saturate(1);
  }
  50% {
    filter: saturate(3);
  }
}

.header.saturation-animation,
.footer.saturation-animation {
  animation: saturationPulse 1.5s infinite alternate;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  :root { --max-width: 95vw; }
  body { padding: var(--gap); }
  .header,
  .textarea,
  .inputarea,
  .div_audio,
  .footer {
    width: 95vw;
    margin: var(--gap) auto;
  }
  .div_breath {
    display: none;
  }
  /* Slightly increase textarea height on mobile */
  .textarea {
    height: 240px;
  }
}

/* Override for mobile: ensure canvas transparent and breath circles visible above canvas */
@media (max-width: 600px) {
  .div_audio { position: relative; }
  .div_canvas canvas {
    background-color: transparent !important;
    position: relative;
    z-index: 1;
  }
  .div_breath {
    display: block !important;
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0.5;
    z-index: 2;
    pointer-events: none;
  }
}

