@media (max-width: 600px) {
  .chat-pane {
    max-height: 80vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
  }
  .chat-card {
    min-height: unset;
    max-height: unset;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
  }
  .chat-scroll {
    max-height: 40vh;
    min-height: 120px;
    overflow-y: auto;
  }
  .chat-input {
    position: sticky;
    bottom: 0;
    background: rgba(255, 255, 255, 0.12);
    z-index: 2;
  }
  .chat-actions {
    flex-wrap: wrap;
    gap: 8px;
  }
}
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");

:root {
  --bg: #000000;
  --card: rgba(255, 255, 255, 0.05);
  --panel: rgba(0, 0, 0, 0.3);
  --accent: #5dd6ff;
  --accent-2: #9c8cff;
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.6);
  --border: rgba(255, 255, 255, 0.1);
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  --mom-theme: #d96dc2;
  --dad-theme: #f28c38;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    system-ui,
    sans-serif;
  background: linear-gradient(180deg, #000000 0%, #0a0a0a 100%);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.call-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 16px;
  gap: 12px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.session-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mic-button.active {
  background: rgba(217, 109, 194, 0.16);
  border: 1px solid rgba(217, 109, 194, 0.4);
  color: var(--text);
}

body[data-parent="dad"] .mic-button.active {
  background: rgba(242, 140, 56, 0.16);
  border: 1px solid rgba(242, 140, 56, 0.4);
}

.brand {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand::before {
  content: "";
  width: 4px;
  height: 16px;
  background: var(--mom-theme);
  border-radius: 2px;
}

body[data-parent="dad"] .brand::before {
  background: var(--dad-theme);
}

.pill {
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border: none;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.call-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: calc(100vh - 72px);
}

.video-pane {
  position: relative;
}

.video-frame {
  position: relative;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: #000000;
  border: none;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  min-height: 75vh;
  height: 75vh;
}

#canvas-container {
  position: relative;
  width: 100%;
  height: 100%;
}

#canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.video-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.2) 0%,
    rgba(0, 0, 0, 0.6) 100%
  );
  display: flex;
  align-items: flex-end;
  padding: 20px;
  pointer-events: none;
}

.caption {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(20px);
  padding: 8px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--mom-theme);
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.caption::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--mom-theme);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

body[data-parent="dad"] .caption {
  border-color: var(--dad-theme);
}

body[data-parent="dad"] .caption::before {
  background: var(--dad-theme);
}

.chat-pane {
  width: 100%;
}

.chat-card {
  background: transparent;
  backdrop-filter: none;
  border: none;
  border-radius: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 80px;
}

.chat-scroll {
  flex: 1;
  max-height: 20vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 0;
  scrollbar-width: none;
}

.chat-scroll::-webkit-scrollbar {
  display: none;
}

.chat-input {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: none;
  border-radius: 24px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(30px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.input-meta {
  display: flex;
  justify-content: flex-end;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
}
#char-counter {
  opacity: 1;
}
#char-counter.over-limit {
  color: #ffb4c2;
}

#user-input {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  border-radius: 0;
  padding: 2px 0;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 400;
  min-height: 28px;
  resize: none;
  outline: none;
}

#user-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
  font-weight: 400;
}

.chat-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

button {
  cursor: pointer;
  border: none;
  font-family: inherit;
  font-weight: 600;
  border-radius: 18px;
  padding: 8px 16px;
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.85rem;
  letter-spacing: -0.01em;
}

button:active {
  transform: scale(0.96);
}

.primary {
  background: var(--mom-theme);
  color: white;
  box-shadow: 0 2px 8px rgba(217, 109, 194, 0.4);
  font-weight: 600;
}

.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(217, 109, 194, 0.5);
}

body[data-parent="dad"] .primary {
  background: var(--dad-theme);
  box-shadow: 0 2px 8px rgba(242, 140, 56, 0.4);
}

body[data-parent="dad"] .primary:hover {
  box-shadow: 0 4px 12px rgba(242, 140, 56, 0.5);
}

.ghost {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border: none;
  backdrop-filter: blur(10px);
}

.ghost:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.message {
  padding: 6px 12px;
  border-radius: 18px;
  max-width: 75%;
  line-height: 1.3;
  word-wrap: break-word;
  font-size: 0.85rem;
  font-weight: 400;
  border: none;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
  animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.user-message {
  align-self: flex-end;
  background: rgba(217, 109, 194, 0.15);
  border: none;
  color: rgba(255, 255, 255, 0.9);
}

body[data-parent="dad"] .user-message {
  background: rgba(242, 140, 56, 0.15);
}

.bot-message {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.08);
}

.error-log {
  font-size: 0.85rem;
  color: #ffb4c2;
  min-height: 18px;
}
.toast-container {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
  pointer-events: none;
}
.toast {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
  color: var(--text);
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  min-width: 200px;
  max-width: 320px;
  font-size: 0.85rem;
  font-weight: 500;
  pointer-events: auto;
  animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.toast.error {
  background: rgba(255, 59, 48, 0.9);
  color: white;
}

@media (min-width: 960px) {
  .call-grid {
    grid-template-columns: minmax(0, 7fr) minmax(320px, 4fr);
    align-items: stretch;
  }

  .video-frame {
    min-height: 520px;
  }
}

@media (max-width: 600px) {
  .call-shell {
    padding: 12px;
  }

  .chat-card {
    min-height: 200px;
  }

  .chat-actions {
    gap: 6px;
  }
}

#send-button,
#stop-button {
  padding: 10px 24px;
  color: white;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
  height: auto;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}

#send-button {
  background: var(--mom-theme);
  box-shadow: 0 2px 8px rgba(217, 109, 194, 0.4);
}

#send-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(217, 109, 194, 0.5);
}

body[data-parent="dad"] #send-button {
  background: var(--dad-theme);
  box-shadow: 0 2px 8px rgba(242, 140, 56, 0.4);
}

body[data-parent="dad"] #send-button:hover {
  box-shadow: 0 4px 12px rgba(242, 140, 56, 0.5);
}

#send-button:active {
  transform: scale(0.96);
}

#send-button:disabled {
  background: rgba(255, 255, 255, 0.2);
  cursor: not-allowed;
  opacity: 0.5;
}

#stop-button {
  background: rgba(255, 59, 48, 0.9);
  box-shadow: 0 2px 8px rgba(255, 59, 48, 0.3);
}

#stop-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 59, 48, 0.4);
}

#stop-button:active {
  transform: scale(0.96);
}

#stop-button:disabled {
  background: rgba(255, 255, 255, 0.2);
  cursor: not-allowed;
  opacity: 0.5;
}

/* Status and Error Log */
#status {
  padding: 8px 0 0 0;
  color: #888;
  font-size: 0.85em;
  text-align: center;
  min-height: 1.2em;
  flex-shrink: 0;
}

.error-log {
  margin: 20px auto 0 auto;
  width: 100%;
  max-width: 1400px;
  padding: 15px;
  background-color: #fff1f1;
  border: 3px solid #ff6b6b;
  border-radius: 12px;
  color: #cc0000;
  font-family: monospace;
  font-size: 0.9em;
  max-height: 150px;
  overflow-y: auto;
  display: none;
  box-sizing: border-box;
  line-height: 1.5;
  flex-shrink: 0;
  box-shadow: 4px 4px 0 rgba(255, 107, 107, 0.2);
}

/* Example repository buttons styling */
.example-repo {
  background-color: #f8aa8b;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.9em;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.example-repo:hover {
  background-color: #f7936a;
}

#end {
  font-size: large;
  font-weight: bolder;
}

ollama-settings input[type="text"],
.ollama-settings textarea {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #333;
  border-radius: 8px;
  box-sizing: border-box;
  font-size: 0.9em;
  background-color: #fefcf9;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.1);
  margin-bottom: 8px; /* Added margin for spacing before button */
}

.settings-button {
  padding: 8px 15px;
  background-color: #f8c6d8; /* A softer color for settings buttons */
  color: #333;
  border: 2px solid #333;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9em;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.15);
  align-self: flex-start; /* Align to left if container is flex */
  margin-top: 4px; /* Small space above */
}

.settings-button:hover {
  background-color: #f7b5cb;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2);
}

.settings-button:active {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.15);
}

/* Responsive Design */
@media (max-width: 1024px) {
  body {
    overflow: auto;
  }
  .main-container {
    flex-direction: column;
    align-items: center;
    height: auto;
    min-height: auto;
    padding-bottom: 20px;
  }
  #canvas-container {
    width: 90%;
    max-width: 500px;
    height: 60vw;
    max-height: 450px;
    margin-bottom: 20px;
    align-self: center;
    transform: rotate(0deg);
  }
  .chat-container {
    width: 90%;
    max-width: 500px;
    height: 65vh;
    min-height: 400px;
    transform: rotate(0deg);
  }
  .ollama-settings-sidebar {
    width: 100%;
    max-width: 300px;
    border-bottom-left-radius: 0;
    border-top: 4px solid #333;
    border-left: none;
    transform: translateX(100%);
  }
  #chat-input-area {
    align-items: center;
  }
  .message {
    transform: rotate(0deg) !important;
  }
}

/* Close button styling */
.close-settings-button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  background-color: #f8aa8b;
  border: 2px solid #333;
  border-radius: 50%;
  font-size: 24px;
  line-height: 32px;
  color: #333;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
  z-index: 20;
}

.close-settings-button:hover {
  background-color: #f7936a;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2);
}

.close-settings-button:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
}

@media (max-width: 600px) {
  body {
    padding: 10px;
  }
  h1 {
    font-size: 1.5em;
  }
  #canvas-container {
    width: 100%;
    max-width: 400px;
    height: 80vw;
    max-height: 400px;
  }
  .chat-container {
    width: 100%;
    max-width: none;
    height: 70vh;
    min-height: 350px;
  }
  .message {
    max-width: 90%;
    font-size: 0.9em;
  }
  #user-input {
    font-size: 0.9em;
  }
  #send-button,
  #stop-button {
    /* Apply responsive styles to stop button too */
    padding: 8px 15px;
    font-size: 0.9em;
    height: 38px;
  }
  .hamburger-menu {
    width: 32px;
    height: 32px;
    padding: 6px;
  }
  .hamburger-menu span {
    width: 18px;
    height: 2px;
  }
}
