/* ===== CHAT INTERFACE STYLING ===== */

/* General chat window structure */
.chat-window {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

/* Chat header styling */
.chat-header {
    background-color: #323131;
    color: white;
    padding: 1rem;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    flex: 0 0 auto;
}

/* Chat body styling */
.chat-body {
    padding: 1.25rem;
    overflow-y: auto;
    background-color: #fafafa;
    flex: 1 1 auto;
}

/* Message styling */
.message {
    padding: 0.9rem 1.2rem;
    border-radius: 18px;
    margin-bottom: 1rem;
    max-width: 85%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.message-received {
    background-color: #f1f2f6;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}

.message-sent {
    background-color: #4f4f4f;
    color: white;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
    margin-left: auto;
}

/* Chat footer styling */
.chat-footer {
    padding: 12px;
    border-top: 1px solid #eee;
    background-color: white;
    flex: 0 0 auto;
}

/* Input group styling */
.chat-footer .input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

/* Input field styling */
.chat-footer .form-control {
    border-radius: 24px;
    padding: 12px 16px;
    height: auto;
    border: 1px solid #e0e0e0;
    background-color: #f8f9fa;
    flex: 1;
    font-family: 'Poppins', sans-serif;
}

.chat-footer .form-control:focus {
    box-shadow: 0 0 0 3px rgba(74, 107, 255, 0.1);
    border-color: var(--primary-color);
}

/* Send button styling */
.chat-footer .btn-primary {
    width: 46px;
    height: 46px;
    min-width: 46px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Send button icon */
.chat-footer .btn-primary i {
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Error message styling */
.message-received.error {
    background-color: #fff8f8;
    border-left: 3px solid #f44336;
    color: #d32f2f;
}

/* Typing indicator styling */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 10px 15px !important;
    min-width: 40px;
    max-width: 80px !important;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    float: left;
    margin: 0 1px;
    background-color: #9E9EA1;
    display: block;
    border-radius: 50%;
    opacity: 0.4;
}

.typing-indicator span:nth-of-type(1) {
    animation: 1s blink infinite 0.3333s;
}

.typing-indicator span:nth-of-type(2) {
    animation: 1s blink infinite 0.6666s;
}

.typing-indicator span:nth-of-type(3) {
    animation: 1s blink infinite 0.9999s;
}

@keyframes blink {
    50% {
        opacity: 1;
    }
}

/* ===== MOBILE VIEW OPTIMIZATIONS ===== */
@media (max-width: 767px) {
    /* Adjust hero section padding for responsive view */
    .hero-section {
        padding-top: 15px; /* Reduced space between header and chat window */
        padding-bottom: 30px;
    }
    
    /* Chat window structure for mobile */
    .chat-window {
        display: flex;
        flex-direction: column;
        max-height: 80vh;
        border-radius: 16px;
        overflow: hidden;
        margin-bottom: 1.5rem;
        margin-top: 0; /* Ensure no additional spacing at the top */
    }
    
    /* Chat header for mobile */
    .chat-header {
        flex: 0 0 auto;
    }
    
    /* Chat body for mobile */
    .chat-body {
        flex: 1 1 auto;
        height: auto;
        min-height: 200px;
        max-height: calc(80vh - 110px);
        padding: 1rem;
    }
    
    /* Chat footer for mobile */
    .chat-footer {
        flex: 0 0 auto;
        padding: 10px 12px;
        border-top: 1px solid #e6e6e6;
        background-color: white;
        width: 100%;
        position: relative;
        bottom: 0;
    }
    
    /* Input group for mobile */
    .chat-footer .input-group {
        display: flex;
        align-items: center;
        gap: 6px;
        background-color: #f5f5f5;
        border-radius: 24px;
        padding: 0 0 0 4px;
        overflow: hidden;
        width: 100%;
        margin: 0;
    }
    
    /* Input field for mobile */
    .chat-footer .form-control {
        border: none;
        background-color: transparent;
        padding: 10px 16px;
        height: 42px;
        font-size: 14px;
        box-shadow: none;
    }
    
    /* Send button for mobile */
    .chat-footer .btn-primary {
        width: 42px;
        height: 42px;
        min-width: 42px;
        border-radius: 50%;
        margin-right: 2px;
    }
    
    /* Send button icon for mobile */
    .chat-footer .btn-primary i {
        font-size: 16px;
    }
    
    /* Messages for mobile */
    .message {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
        max-width: 90%;
    }
    
    /* Remove any extra padding in the hero row */
    .hero-section .row {
        margin-top: 0;
    }
    
    /* Ensure the chat is properly positioned with minimal spacing */
    .hero-section .col-lg-6 {
        padding-top: 0;
        margin-top: 0;
    }
}

/* Enhanced User Information Form Styling */
.user-info-form {
    background-color: white;
    border-radius: 16px;
    padding: 28px 24px;
    margin-top: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transition: all 0.4s ease;
    transform: translateY(0);
    border: 1px solid rgba(220, 220, 235, 0.5);
}

.user-info-form:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.user-info-form .form-control {
    height: 52px;
    padding: 12px 20px;
    font-size: 16px;
    border-radius: 12px;
    border: 2px solid #edf2f7;
    background-color: #f8fafc;
    box-shadow: none;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.user-info-form .form-control:focus {
    border-color: #4a6bff;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(74, 107, 255, 0.15);
}

.user-info-form label {
    font-weight: 500;
    margin-bottom: 8px;
    color: #4a5568;
    transition: all 0.2s ease;
}

.user-info-form .form-control:focus + label,
.user-info-form .form-control:not(:placeholder-shown) + label {
    color: #4a6bff;
}

.user-info-form .form-label {
    display: inline-block;
    margin-bottom: 8px;
    font-weight: 500;
}

.user-info-form button {
    height: 52px;
    border-radius: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-transform: none;
    padding: 0 24px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(74, 107, 255, 0.25);
}

.user-info-form button:hover {
    transform: translateY(-2px);
    background-color: #4f4f4f;
    box-shadow: 0 6px 20px rgba(74, 107, 255, 0.35);
}

.user-info-form button:active {
    transform: translateY(1px);
}

/* Pulse animation on form load */
@keyframes formPulse {
    0% { opacity: 0; transform: scale(0.95); }
    70% { opacity: 1; transform: scale(1.02); }
    100% { opacity: 1; transform: scale(1); }
}

.user-info-form {
    animation: formPulse 0.5s ease-out forwards;
}

/* Input field focus highlight effect */
.user-info-form .form-control:focus::placeholder {
    opacity: 0.7;
    transition: opacity 0.3s;
}

/* Input validation styling */
.user-info-form .form-control.is-valid {
    border-color: #FFD700;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2348bb78' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.user-info-form .form-control.is-invalid {
    border-color: #f56565;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23f56565' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23f56565' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* Responsiveness improvements */
@media (max-width: 768px) {
    .user-info-form {
        padding: 20px 18px;
    }
    
    .user-info-form .form-control {
        height: 48px;
        font-size: 15px;
    }
    
    .user-info-form button {
        height: 48px;
    }
}