/**
 * Home Office Hero - Frontend Chat Widget Styles
 * v1.1 - Added styles for Dynamic Form Fields
 */
.hoh-chat-widget {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    max-width: 800px;
    margin: 20px auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.hoh-chat-header {
    background: #f9f9f9;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hoh-chat-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.hoh-balance-display {
    font-size: 0.9rem;
    color: #555;
    font-weight: 500;
}

#hoh-credit-balance {
    font-weight: 700;
    color: #1a73e8;
    padding-left: 6px;
}

.hoh-chat-messages {
    height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hoh-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.6;
    font-size: 0.95rem;
}

.hoh-message p {
    margin: 0;
    white-space: pre-wrap; /* Respects newlines in AI response */
}

.hoh-message-bot {
    background: #f1f3f4;
    color: #3c4043;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.hoh-message-user {
    background: #1a73e8;
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.hoh-message-error {
    background: #fce8e6;
    color: #c5221f;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    font-weight: 500;
}

.hoh-loading-indicator {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    background: #fff;
    color: #777;
    font-style: italic;
    gap: 10px;
}

.hoh-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #1a73e8;
    border-top-color: transparent;
    border-radius: 50%;
    animation: hoh-spin 1s linear infinite;
}

@keyframes hoh-spin {
    to { transform: rotate(360deg); }
}

.hoh-chat-footer {
    border-top: 1px solid #e0e0e0;
    background: #f9f9f9;
}

#hoh-chat-form {
    display: flex;
    flex-direction: column; /* Changed to column to stack fields */
    padding: 12px;
}

/* --- NEW DYNAMIC FIELD STYLES --- */
.hoh-dynamic-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Responsive grid */
    gap: 12px;
    margin-bottom: 12px;
}

.hoh-form-field {
    display: flex;
    flex-direction: column;
}

.hoh-form-field label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
}

.hoh-dynamic-input,
.hoh-dynamic-textarea,
.hoh-dynamic-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    box-sizing: border-box; /* Important for layout */
}

.hoh-dynamic-textarea {
    resize: vertical;
}

.hoh-dynamic-input:focus,
.hoh-dynamic-textarea:focus,
.hoh-dynamic-select:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26,115,232,0.2);
}
/* --- END NEW STYLES --- */


.hoh-main-prompt {
    display: flex;
    align-items: stretch;
}

#hoh-user-prompt {
    flex-grow: 1;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    resize: none;
    min-height: 50px;
}

#hoh-user-prompt:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26,115,232,0.2);
}

#hoh-send-button {
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px;
    margin-left: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    transition: background-color 0.2s;
    align-self: flex-end; /* Align button to bottom */
}

#hoh-send-button:hover {
    background: #185abc;
}

#hoh-send-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

