/* ==========================================================================
   PRE-CHAT FORM & OFFLINE/ONLINE STATUS
   ========================================================================== */
#lcfw-chat-root-container #lcfw-pre-chat-form {
    display: flex;
    flex-direction: column;
    height: 100%; /* Fill the available height of the chat body */
}

#lcfw-chat-root-container #lcfw-pre-chat-form p {
    text-align: center;
    margin-bottom: 15px;
    color: #555;
    font-size: 0.9em;
    flex-shrink: 0; /* Prevent shrinking */
}

#lcfw-chat-root-container #lcfw-pre-chat-form label {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 5px;
    margin-top: 10px;
}

/* Container for the form inputs needs to grow to fill space */
#lcfw-chat-root-container #lcfw-online-form-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Occupy remaining vertical space */
}

/* Inputs specifically within pre-chat form */
#lcfw-chat-root-container #lcfw-pre-chat-form input[type="text"],
#lcfw-chat-root-container #lcfw-pre-chat-form input[type="email"],
#lcfw-chat-root-container #lcfw-pre-chat-form input[type="tel"] {
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0; /* Prevent inputs from squishing */
}

/* Textarea - The Dynamic Height Element */
#lcfw-chat-root-container #lcfw-pre-chat-form textarea {
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
    width: 100%;
    box-sizing: border-box;
    
    /* Flex properties to fill empty space */
    flex-grow: 1; 
    min-height: 60px; /* Minimum comfortable typing area */
    resize: none; /* Disable manual resize so layout stays fixed */
}

/* Start Chat Button - Pushed to bottom */
#lcfw-chat-root-container #lcfw-start-chat-button {
    background-color: var(--lcfw-bubble-color);
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    margin-top: auto; /* Ensure it stays at the bottom if using block layout, though flex handles it */
    margin-bottom: 0;
    transition: background-color 0.3s ease;
    width: 100%;
    flex-shrink: 0; /* Do not shrink */
}

#lcfw-chat-root-container #lcfw-start-chat-button:hover {
    background-color: color-mix(in srgb, var(--lcfw-bubble-color) 80%, black);
}

/* Validation Errors */
#lcfw-chat-root-container .lcfw-input-error {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 1px #e74c3c;
}

#lcfw-chat-root-container .lcfw-validation-error {
    color: #e74c3c;
    font-size: 0.8em;
    margin-top: -8px;
    margin-bottom: 10px;
    display: block;
}

/* Status Messages */
#lcfw-chat-root-container #lcfw-pre-chat-status-message {
    font-weight: bold;
    font-size: 0.9em !important;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px !important;
}

#lcfw-chat-root-container #lcfw-pre-chat-status-message.lcfw-online {
    background-color: #e6ffe6;
    color: #28a745;
}

#lcfw-chat-root-container #lcfw-pre-chat-status-message.lcfw-offline {
    background-color: #fff0f0;
    color: #dc3545;
}

/* ==========================================================================
   OFFLINE CONTACT & SOCIAL LINKS
   ========================================================================== */
#lcfw-chat-root-container #lcfw-offline-contact-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 10px 0;
    height: 100%;
    overflow-y: auto; /* Allow scrolling if contact info is long */
}

#lcfw-chat-root-container #lcfw-offline-contact-info p {
    margin-bottom: 10px;
    color: #333;
    font-size: 1em;
}

/* Contact Details List */
#lcfw-chat-root-container .lcfw-contact-details {
    list-style: none;
    padding: 0;
    margin: 15px 0 20px 0;
    width: 100%;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}

#lcfw-chat-root-container .lcfw-contact-details li {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95em;
}

#lcfw-chat-root-container .lcfw-contact-details li a {
    color: var(--lcfw-bubble-color);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Social Media Links */
#lcfw-chat-root-container .lcfw-social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

#lcfw-chat-root-container .lcfw-social-links a {
    color: var(--lcfw-bubble-color);
    text-decoration: none;
    transition: color 0.3s ease, transform 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
}

/* Shared Icon Styles (Contact & Social) */
#lcfw-chat-root-container .lcfw-contact-details li a i,
#lcfw-chat-root-container .lcfw-social-links a i,
#lcfw-chat-root-container .lcfw-social-links svg {
    font-size: 1.8em;
    color: var(--lcfw-bubble-color);
    line-height: 1;
    width: 1em;
    height: 1em;
    margin: 5px;
    transition: color 0.3s ease, transform 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    fill: currentColor;
}

#lcfw-chat-root-container .lcfw-contact-details li a:hover,
#lcfw-chat-root-container .lcfw-social-links a:hover i {
    color: color-mix(in srgb, var(--lcfw-bubble-color) 80%, black);
    transform: translateY(-2px);
}