@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  margin: 0;
  background-color: #111827;
  color: #f3f4f6;
  overflow: hidden;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
}
canvas {
  display: block;
  outline: none;
}

.icon-svg {
  width: 24px;
  height: 24px;
  stroke: #f3f4f6;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#mobile-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 55px;
  background-color: rgba(17, 24, 39, 0.98);
  border-bottom: 1px solid #374151;
  display: flex;
  align-items: center;
  padding: 0 8px;
  box-sizing: border-box;
  z-index: 100;
  gap: 8px;
}
.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:active {
  opacity: 0.7;
}

#top-bar-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  overflow: hidden;
  line-height: 1.2;
}
#top-patient-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #f3f4f6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
#top-case-details {
  font-size: 0.7rem;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

#top-status-display {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  color: white;
  display: none;
  white-space: nowrap;
}
.status-approve {
  background-color: #22c55e;
}
.status-redesign {
  background-color: #a78bfa;
}

.drawer {
  position: absolute;
  top: 55px;
  bottom: 70px;
  width: 260px;
  background-color: rgba(31, 41, 55, 0.98);
  border-right: 1px solid #374151;
  padding: 16px;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 90;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#ui-panel.open {
  transform: translateX(0);
}
#log-panel {
  right: 0;
  left: auto;
  border-left: 1px solid #374151;
  border-right: none;
  transform: translateX(100%);
}
#log-panel.open {
  transform: translateX(0);
}

.drawer-header-info {
  background-color: #1f2937;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #4b5563;
  margin-bottom: 8px;
}
.drawer-label {
  font-size: 0.7rem;
  color: #9ca3af;
  display: block;
}
.drawer-value {
  font-size: 0.9rem;
  color: #f3f4f6;
  font-weight: 600;
  word-break: break-all;
}

#approval-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background-color: #1f2937;
  border-top: 1px solid #374151;
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  box-sizing: border-box;
  z-index: 100;
  gap: 8px;
}
#approval-bar button {
  height: 44px;
  border-radius: 8px;
  border: 2px solid transparent;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
}
#reject-button {
  background-color: #a78bfa;
  color: white;
  flex: 2;
}
#approve-button {
  background-color: #22c55e;
  color: white;
  flex: 2;
}

button.btn-active {
  opacity: 1 !important;
  border-color: #ffffff !important;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
  /* transform: scale(1.02); */
}
button.btn-inactive {
  opacity: 0.3 !important;
  /* transform: scale(0.95); */
  filter: grayscale(0.6);
}
.btn-check-icon {
  display: none;
  width: 18px;
  height: 18px;
  margin-right: 6px;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
}
button.btn-active .btn-check-icon {
  display: inline-block;
}

#btn-comment {
  background-color: #374151;
  flex: 0 0 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#btn-comment:active {
  background-color: #4b5563;
}

#mode-toggle-container {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(31, 41, 55, 0.9);
  border: 1px solid #4b5563;
  border-radius: 24px;
  padding: 4px;
  display: flex;
  gap: 4px;
  z-index: 85;
}
.mode-btn {
  background: transparent;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #9ca3af;
  font-size: 0.9rem;
  font-weight: 500;
}
.mode-btn.active {
  background-color: #3b82f6;
  color: white;
}
.mode-btn.active .icon-svg {
  stroke: white;
}
.mode-btn .icon-svg {
  width: 18px;
  height: 18px;
  stroke: #9ca3af;
}

h2 {
  font-size: 1rem;
  color: #e5e7eb;
  margin: 0 0 8px 0;
  border-bottom: 1px solid #4b5563;
  padding-bottom: 4px;
}
label {
  font-size: 0.85rem;
  color: #9ca3af;
  display: block;
  margin-bottom: 4px;
}
input[type="text"],
input[type="file"] {
  width: 100%;
  padding: 8px;
  background: #374151;
  border: 1px solid #4b5563;
  color: white;
  border-radius: 6px;
  box-sizing: border-box;
  font-size: 0.9rem;
}
.control-group {
  margin-bottom: 12px;
}
#color-swatch-container {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 0;
}
.color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 2px solid #4b5563;
  cursor: pointer;
}
.color-swatch.active {
  border-color: white;
  transform: scale(1.1);
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 16px;
  box-sizing: border-box;
}
.modal-box {
  background-color: #1f2937;
  border: 1px solid #374151;
  border-radius: 12px;
  padding: 20px;
  width: 100%;
  max-width: 380px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#comment-list {
  flex-grow: 1;
  min-height: 150px;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #374151;
  background: #111827;
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.comment-item {
  background-color: #374151;
  padding: 10px;
  border-radius: 8px;
  font-size: 0.9rem;
}
.comment-date {
  font-size: 0.7rem;
  color: #9ca3af;
  margin-top: 4px;
  text-align: right;
  display: block;
}
#comment-text {
  width: 100%;
  height: 60px;
  background: #374151;
  border: 1px solid #4b5563;
  color: white;
  border-radius: 6px;
  padding: 8px;
  box-sizing: border-box;
  font-family: inherit;
  resize: none;
}

#instructions {
  position: absolute;
  bottom: 140px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.7);
  color: #d1d5db;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  pointer-events: none;
  z-index: 80;
  display: none;
}

#log-content {
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
details {
  background: #374151;
  border-radius: 4px;
  padding: 8px;
  border: 1px solid #4b5563;
}
summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  outline: none;
  font-size: 0.9rem;
  width: 100%;
  box-sizing: border-box;
}

.log-line-name {
  flex-grow: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 8px;
  cursor: text;
}
.log-line-name:hover {
  text-decoration: underline;
  text-decoration-style: dotted;
  color: #ffffff;
}

#btn-clear-all-lines {
  width: 100%;
  background-color: #ef4444;
  color: white;
  padding: 8px;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 10px;
  cursor: pointer;
}

.log-action-btn {
  border: none;
  border-radius: 4px;
  width: 24px;
  height: 24px;
  cursor: pointer;
  margin-left: 4px;
  font-weight: bold;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.log-btn-edit {
  background-color: #eab308;
  color: white;
}
.log-btn-rename {
  background-color: #3b82f6;
  color: white;
}
.log-btn-delete {
  background-color: #ef4444;
  color: white;
}
.log-btn-container {
  display: flex;
  flex-shrink: 0;
}
