/* EarthEssence PHA Styles */
#earthEssencePHA {
    font-family: 'Segoe UI', system-ui, sans-serif;
}

/* Chat Window */
.pha-window {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 400px;
    height: 500px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    z-index: 10001;
    display: none;
    flex-direction: column;
    border: 1px solid #e0e0e0;
}

.pha-window.open {
    display: flex;
    animation: slideUp 0.3s ease;
}

/* Body with Scroll */
.pha-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
    max-height: 300px;
}

/* Messages */
.message {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 80%;
    line-height: 1.5;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* TRIGGER BUTTON STYLES */
.pha-trigger {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #2E8B57, #32CD32);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 20px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(46, 139, 87, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10000;
    transition: all 0.3s ease;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

.pha-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(46, 139, 87, 0.4);
}

.pha-trigger.active {
    background: linear-gradient(135deg, #228B22, #2E8B57);
}

.trigger-icon {
    font-size: 20px;
}

.trigger-text {
    font-weight: 600;
    font-size: 14px;
}

/* HEADER STYLES */
.pha-header {
    background: linear-gradient(135deg, #2E8B57, #32CD32);
    color: white;
    padding: 16px 20px;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-icon {
    font-size: 24px;
}

.header-title {
    font-weight: 700;
    font-size: 16px;
}

.header-subtitle {
    font-size: 12px;
    opacity: 0.9;
}

.close-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
}

.close-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* USER MESSAGE STYLES */
.user-message {
    flex-direction: row-reverse;
}

.user-message .message-icon {
    background: #667eea;
}

.user-message .message-content {
    background: #667eea;
    color: white;
}

.bot-message .message-icon {
    background: #2E8B57;
}

/* QUICK ACTIONS */
.quick-actions {
    padding: 12px 20px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    background: white;
    border-bottom: 1px solid #e0e0e0;
}

.quick-btn {
    background: rgba(46, 139, 87, 0.1);
    color: #2E8B57;
    border: 1px solid rgba(46, 139, 87, 0.2);
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.3s;
}

.quick-btn:hover {
    background: #2E8B57;
    color: white;
}

/* INPUT AREA */
.input-area {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
}

#userInput {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 25px;
    outline: none;
    font-size: 14px;
}

#userInput:focus {
    border-color: #2E8B57;
}

#sendButton {
    background: #2E8B57;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
}

#sendButton:hover {
    background: #228B22;
}

/* LOADING STYLES */
.loading {
    color: #666;
    font-style: italic;
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Animation */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal Styles */
.health-assistant-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10002;
    animation: fadeIn 0.3s ease;
}

.health-assistant-content {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    line-height: 1;
}

.close-modal:hover {
    color: #333;
}

.health-form-title {
    color: #2E8B57;
    margin-bottom: 20px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
}

.health-form-benefits {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
}

.health-form-benefits ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.health-form-benefits li {
    padding: 8px 0;
    display: flex;
    align-items: center;
}

.icon-check {
    color: #2E8B57;
    font-weight: bold;
    margin-right: 10px;
}

.security-note {
    text-align: center;
    margin-top: 15px;
    font-size: 12px;
    color: #666;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    .pha-window {
        width: calc(100vw - 40px);
        height: 70vh;
        right: 20px;
        bottom: 80px;
    }
    
    .chat-messages {
        max-height: 50vh;
    }
    
    .pha-trigger {
        right: 15px;
        bottom: 15px;
    }
    
    .health-assistant-content {
        padding: 20px;
        margin: 10px;
    }
}

@media (max-width: 480px) {
    .pha-window {
        width: 100vw;
        height: 100vh;
        right: 0;
        bottom: 0;
        border-radius: 0;
    }
    
    .pha-header {
        border-radius: 0;
    }
}

/* Ensure modal displays properly */
.health-assistant-modal.modal-open {
    display: flex !important;
}

/* Highlight the Get Plan button */
.get-plan-btn {
    background: #2E8B57 !important;
    color: white !important;
    border: none !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-weight: bold !important;
    transition: all 0.3s ease !important;
}

.get-plan-btn:hover {
    background: #228B22 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(46, 139, 87, 0.3) !important;
}

/* Make sure modal is on top */
.health-assistant-modal {
    z-index: 10002 !important;
}

/* ===================================================
   DEBUG MODAL STYLES - ADD TO BOTTOM OF EXISTING CSS
   =================================================== */

/* Force modal display when active */
.health-assistant-modal.active {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 10002 !important;
}

/* Make sure modal backdrop covers everything */
.health-assistant-modal {
    background: rgba(0,0,0,0.8) !important;
    z-index: 10002 !important;
}

/* Style the Get Plan button */
.get-plan-btn {
    background: #2E8B57 !important;
    color: white !important;
    border: none !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-weight: bold !important;
    margin: 10px 0 !important;
    font-size: 14px !important;
    transition: all 0.3s ease !important;
}

.get-plan-btn:hover {
    background: #228B22 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(46, 139, 87, 0.3) !important;
}

/* Ensure modal content is visible */
.health-assistant-content {
    background: white !important;
    z-index: 10003 !important;
    position: relative !important;
}

/* Make close button visible */
.close-modal {
    z-index: 10004 !important;
    position: absolute !important;
}

/* ULTRA SIMPLE MODAL FIX */
#emailCaptureModal {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0,0,0,0.8) !important;
    z-index: 99999 !important;
    justify-content: center !important;
    align-items: center !important;
}

#emailCaptureModal[style*="display: flex"] {
    display: flex !important;
}

.health-assistant-content {
    background: white !important;
    padding: 30px !important;
    border-radius: 10px !important;
    max-width: 500px !important;
    width: 90% !important;
    position: relative !important;
    z-index: 100000 !important;
}

.get-plan-btn {
    background: #2E8B57 !important;
    color: white !important;
    border: none !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-weight: bold !important;
    margin: 10px 0 !important;
}
