body {
  margin: 0;
  padding: 0;
  color: rgba(255, 255, 255, 0.87);
  background-color: #000000;
  --brand-gradient: linear-gradient(to right, #d946ef, #a855f7, #6366f1);
}

#app {
  width: 100%;
  height: 100vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* --- ADD THIS CSS FOR THE FORM --- */

.form-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  font-family: Arial, sans-serif;
}

#client-form {
  background: #1a1a2e;
  color: #fff;
  padding: 20px 30px;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  border: 2px solid transparent;
  background-image: linear-gradient(#1a1a2e, #1a1a2e), var(--brand-gradient);
  background-origin: border-box;
  background-clip: padding-box, border-box;
}

#client-form h3 {
  margin-top: 0;
  margin-bottom: 20px;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

#client-form label {
  display: block;
  margin-top: 15px;
  margin-bottom: 5px;
  font-weight: bold;
  font-size: 0.9em;
  color: #a855f7;
}

#client-form input,
#client-form textarea {
  width: 95%;
  padding: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  font-size: 1em;
  color: #fff;
}

#client-form input:focus,
#client-form textarea:focus {
  outline: none;
  border-color: #a855f7;
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.2);
}

#client-form input:read-only {
  background-color: rgba(255, 255, 255, 0.05);
  color: #9ca3af;
  cursor: not-allowed;
}

#client-form .form-buttons {
  margin-top: 25px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

#client-form button {
  padding: 10px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1em;
  font-weight: bold;
}

#client-form button[type="submit"] {
  background: var(--brand-gradient);
  color: white;
  transition: opacity 0.3s ease;
}

#client-form button[type="submit"]:hover {
  opacity: 0.9;
}

#client-form button[type="button"] {
  background-color: #6c757d;
  color: white;
}

/* --- CHAT BOX STYLES --- */

.chat-box-container {
    background-color: rgba(0, 0, 0, 0.85);
    border: 2px solid transparent;
    background-image: linear-gradient(rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.85)), var(--brand-gradient);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    border-radius: 4px;
    padding: 15px;
    box-sizing: border-box;
    overflow-y: auto;
    pointer-events: auto;
    font-family: 'Courier New', Courier, monospace;
    color: #ffffff;
    font-size: 18px;
    line-height: 1.5;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-box-content {
    white-space: pre-wrap;
    word-wrap: break-word;
    flex: 1;
    min-height: 0;
}

.chat-voice-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.chat-voice-controls.hidden {
    display: none;
}

.chat-voice-btn {
    border: none;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.2);
}

.chat-voice-btn:hover:not([disabled]) {
    background: rgba(255, 255, 255, 0.35);
}

.chat-voice-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-mic-btn.recording {
    background: rgba(217, 70, 239, 0.7);
}

.chat-voice-transport {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    padding: 6px 8px;
}

.chat-speaking-indicator {
    font-size: 12px;
    color: #ffd166;
    background: rgba(255, 209, 102, 0.15);
    border: 1px solid rgba(255, 209, 102, 0.35);
    border-radius: 4px;
    padding: 6px 8px;
}

.chat-speaking-indicator.hidden {
    display: none;
}

/* Custom Scrollbar for Chat Box */
.chat-box-container::-webkit-scrollbar {
    width: 10px;
}

.chat-box-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.chat-box-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
}

.chat-box-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.8);
}

/* --- CANVAS PREVIEW MODAL --- */

#canvas-preview-modal {
  background: #1a1a2e;
  color: #fff;
  padding: 24px;
  border-radius: 12px;
  width: 95%;
  max-width: 1200px;
  max-height: 98vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  border: 2px solid transparent;
  background-image: linear-gradient(#1a1a2e, #1a1a2e), var(--brand-gradient);
  background-origin: border-box;
  background-clip: padding-box, border-box;
}

#canvas-preview-title {
  margin: 0 0 20px 0;
  font-size: 1.5em;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-align: center;
}

/* BMC Grid Layout - 5 columns for proper BMC structure */
#canvas-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: auto auto;
  gap: 10px;
  margin-bottom: 16px;
}

.canvas-block {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px;
  grid-row: span 2;
}

.canvas-block-double {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.canvas-sub-block {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px;
  flex: 1;
}

.canvas-block-wide {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px;
}

/* Cost structure spans 2 columns, Revenue spans 3 */
#block-cost-structure {
  grid-column: span 2;
}

#block-revenue-streams {
  grid-column: span 3;
}

.canvas-block h4,
.canvas-sub-block h4,
.canvas-block-wide h4 {
  margin: 0 0 8px 0;
  font-size: 0.85em;
  color: #a855f7;
}

.canvas-block textarea,
.canvas-sub-block textarea,
.canvas-block-wide textarea,
.insight-block textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  color: #fff;
  padding: 8px;
  font-size: 0.85em;
  resize: vertical;
  font-family: inherit;
  box-sizing: border-box;
}

.canvas-block textarea:focus,
.canvas-sub-block textarea:focus,
.canvas-block-wide textarea:focus,
.insight-block textarea:focus {
  outline: none;
  border-color: #a855f7;
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.2);
}

/* Extra Insights Section */
#canvas-insights {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.insight-block {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 8px;
  padding: 10px;
}

.insight-block h4 {
  margin: 0 0 8px 0;
  font-size: 0.85em;
  color: #6366f1;
}

/* Modal Buttons */
.modal-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.modal-buttons button {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95em;
  font-weight: bold;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--brand-gradient);
  color: white;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-cancel {
  background: rgba(107, 114, 128, 0.5);
  color: white;
}

.btn-cancel:hover {
  background: rgba(107, 114, 128, 0.7);
}

/* Responsive adjustments */
@media (max-width: 800px) {
  #canvas-grid {
    grid-template-columns: 1fr;
  }
  
  .canvas-block {
    grid-row: span 1;
  }
  
  #block-cost-structure,
  #block-revenue-streams {
    grid-column: span 1;
  }
  
  #canvas-insights {
    grid-template-columns: 1fr;
  }
}
