:root {
    font-family: "Poppins", Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
    font-weight: 300;
    color: rgba(0, 0, 0, 0.87);
    background-color: #e4e4ff;
    text-align: center;
}

body {
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 320px;
    min-height: 100vh;
    align-items: center;
}

#app {
    max-width: 1280px;
}

.logo {
    margin-top: 45px;
    margin-left: 20%;
    align-self: flex-start;
}

button {
    font-family: "JetBrains Mono", Inter, system-ui, sans-serif;
    background-color: rgba(25, 25, 28, 0.5);
    cursor: pointer;
    color: rgba(255, 255, 255, 1);
}

.footer {
    margin-bottom: 36px;
    align-self: center;
    padding-top: 25px;
}

.iphone-container {
    position: relative;
    width: min(512px, 90vw);
    aspect-ratio: 1502 / 2948;
    margin: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    max-height: 95vh;
}

.iphone {
    display: block;
    object-fit: fill;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.chat-interface {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    border-radius: 7.5%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1;
}

.chat-interface::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 65%;
    background-image: url('/lh-logo.svg');
    background-size: clamp(70px, 50vmin, 200px);
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.1;
    pointer-events: none;
    display: none;
}

.screen-content {
    position: absolute;
    width: 90%;
    height: 95%;
    z-index: 1;
    overflow: hidden;
    font-size: clamp(14px, 2vmin, 18px);
}

.chat-messages {
    flex: 1;
    padding: 3em 1em 1em 1em;
    overflow-y: auto;
    background-color: transparent;
    position: relative;
    z-index: 1;
}

.chat-input {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background: #fff;
    border-radius: 2em 2em 0 0;
    margin-top: -1.25em;
    padding: 0 1.125em 1.125em 1.125em;
    width: calc(100% - 2.25em);
    position: relative;
    z-index: 2;
    box-shadow: 0 -0.25em 0.5em rgba(0, 0, 0, 0.05);
    overflow: hidden; /* Prevent overflow issues */
}

.chat-input textarea {
    resize: none;
    border: none;
    outline: none;
    background: transparent;
    font-size: 1.05em;
    padding: 1em 0 0.5em 0;
    font-family: inherit;
    color: #222;
    min-width: 0;
    width: 100%;
    height: auto;
    overflow: auto;
    box-shadow: none;
    line-height: 1.5em;
    max-height: calc(1.5em * 3);
    box-sizing: border-box;
}

.chat-input input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 1.1em;
    padding: 1em 0 0.5em 0;
    font-family: inherit;
    color: #222;
    min-width: 0;
    width: 100%;
    background: none;
    box-shadow: none;
}

.chat-input-controls {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 0.75em;
    margin-top: 0;
    margin-bottom: 0;
    padding-bottom: 0;
    background: none;
}

.chat-input-controls div {
    display: flex;
    gap: 0.625em;
    align-items: center;
}

.circle-btn {
    width: 2.75em;
    height: 2.75em;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f2f4f5;
    box-shadow: none;
    transition: background 0.15s;
    margin: 0 0.125em;
    padding: 0;
    cursor: pointer;
}

.plus-btn {
    background: #f2f4f5;
    color: #4644C5;
}

.mic-btn, .send-btn {
    background: #4644C5;
}

.mic-btn img, .send-btn img {
    width: 1.375em !important;
    height: 1.375em !important;
    filter: none;
}

.mic-btn:hover, .send-btn:hover {
    background: #2e2c8f;
}

.send-btn.disabled,
.send-btn:disabled {
    opacity: 0.7;
    filter: grayscale(0.5);
    cursor: not-allowed;
    pointer-events: none;
    background: #bfc0d6 !important;
    color: #fff !important;
}

.chat-bubble {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    margin-bottom: 1em;
    max-width: 95%;
}

.user-bubble {
    flex-direction: row-reverse;
    align-items: flex-start;
    margin-left: auto;
}

.system-bubble {
    align-items: flex-start;
    margin-right: auto;
}

.system-avatar {
    width: 4em;
    /* height: 2em; */
    /* border-radius: 50%;
    margin-right: 0.625em;
    margin-top: 0;
    background: #e4e4ff;
    border: 0.125em solid #fff;
    box-shadow: 0 0.0625em 0.25em rgba(0, 0, 0, 0.07); */
}

.user-bubble .bubble-content {
    background: #4644C5;
    color: #fff;
    border-radius: 1.375em 0.375em 1.375em 1.375em;
    padding: 0.75em 1.125em;
    font-size: 0.9em;
    text-align: left;
    box-shadow: 0 2px 8px rgba(70, 68, 197, 0.08);
    word-wrap: break-word;        
    word-break: break-word;       
    overflow-wrap: break-word;   
    hyphens: auto;              
}

.system-bubble .bubble-content {
    background: #f2f4f5;
    color: #222;
    border-radius: 0.375em 1.375em 1.375em 1.375em;
    padding: 0.75em 1.125em;
    font-size: 0.9em;
    text-align: left;
    box-shadow: 0 2px 8px rgba(70, 68, 197, 0.04);
}

.bubble-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin-top: 0.5rem;
}

.bubble-content p {
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}

/*
.bubble-content code {
    margin-top: 0;
    margin-bottom: 0;
}
*/

code {
  display: block;           
  font-family: inherit;     
  font-size: 1em;           
  background: none;         
  padding: 0;               
  margin: 0 0 1em 0;        
  white-space: normal;      
}

.chat-messages {
    scroll-behavior: smooth;
}

@media (max-width: 875px) {
    .logo {
        margin-top: 10px;
    }
}

@media (max-width: 600px) {
    header.logo {
        display: none;
    }

    .chat-interface::before {
        display: block;
    }
}

/* Connection Status Styles */
.connection-status-container {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 1000;
}

.connection-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.connection-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: block;
}

.connection-status.connected {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.connection-status.connected::before {
    background: #fff;
    animation: pulse-green 2s infinite;
}

.connection-status.connecting {
    background: linear-gradient(135deg, #FF9800, #f57c00);
    color: white;
}

.connection-status.connecting::before {
    background: #fff;
    animation: pulse-orange 1s infinite;
}

.connection-status.disconnected {
    background: linear-gradient(135deg, #F44336, #d32f2f);
    color: white;
}

.connection-status.disconnected::before {
    background: #fff;
    animation: pulse-red 0.8s infinite;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .connection-status-container {
        top: 10px;
        right: 10px;
    }
    
    .connection-status {
        padding: 4px 8px;
        font-size: 10px;
    }
    
    .connection-status::before {
        width: 6px;
        height: 6px;
    }

    .footer {
        margin-bottom: 20px;
        padding-top: 15px;
    }
}

@media (max-width: 480px) {
    .footer {
        margin-bottom: 10px;
        padding-top: 10px;
    }
}

@keyframes pulse {
    0% {
        background-color: #f2f4f5;
    }
    50% {
        background-color: #e0e0e0;
    }
    100% {
        background-color: #f2f4f5;
    }
}

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

.send-btn .dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
}

.send-btn .dot {
  width: 6px;
  height: 6px;
  background-color: white;
  border-radius: 50%;
  animation: bounce 1.4s infinite;
}

.send-btn .dot:nth-child(1) {
  animation-delay: -0.32s;
}

.send-btn .dot:nth-child(2) {
  animation-delay: -0.16s;
}

.send-btn .dot:nth-child(3) {
  animation-delay: 0s;
}

.w-full {
    width: 100%;
}
.h-auto {
    height: auto;
}
.max-h-\[240px\] {
    max-height: 240px;
}
.min-h-\[57px\] {
    min-height: 57px;
}

/* Widget Form Styles */
.widget-bubble {
  max-width: 80%;
  margin: 0.5rem 1rem;
}

.widget-content {
  padding: 1rem;
}

.widget-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
  color: #000;
}

.widget-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.widget-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.widget-label {
  font-size: 0.875rem;
  color: #666;
  font-weight: 500;
}

.widget-input {
  padding: 0.5rem;
  border: 1px solid #e0e0e0;
  border-radius: 0.5rem;
  font-size: 1rem;
  background: #f9f9f9;
  transition: all 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.widget-input:focus {
  outline: none;
  border-color: #007AFF;
  background: #fff;
}

.widget-input:disabled {
  background: #e0e0e0;
  color: #666;
  -webkit-text-fill-color: #666;
  opacity: 1;
}

.widget-submit {
  margin-top: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: #007AFF;
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.widget-submit:hover:not(:disabled) {
  background: #0051D5;
}

.widget-submit:disabled {
  background: #34C759;
  cursor: not-allowed;
}
