/* Heart South Chatbot Styles - Updated with Directions & Links */
#heart-south-chatbot {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.chat-container {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    display: none;
    flex-direction: column;
    z-index: 9999;
}

.chat-container.active {
    display: flex;
}

.chat-header {
    background: #1e40af;
    color: white;
    padding: 15px 20px;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    font-size: 16px;
}

.minimize-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.minimize-btn:hover {
    opacity: 0.8;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f9fafb;
}

.message {
    margin-bottom: 15px;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.bot-message {
    background: white;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    margin-right: 40px;
}

.user-message {
    background: #1e40af;
    color: white;
    padding: 12px 16px;
    border-radius: 10px;
    margin-left: 40px;
    text-align: right;
}

/* Link styles */
.message a {
    color: #1e40af;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.bot-message a {
    color: #1e40af;
}

.user-message a {
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.message a:hover {
    border-bottom-color: currentColor;
}

.message a:visited {
    opacity: 0.8;
}

/* Location request styles */
.location-request {
    text-align: center;
}

.location-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1e40af;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    margin: 10px 0;
    transition: all 0.2s ease;
}

.location-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.location-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.location-btn svg {
    width: 16px;
    height: 16px;
}

.message p {
    margin: 0 0 8px 0;
}

.message p:last-child {
    margin-bottom: 0;
}

.message ul {
    margin: 8px 0;
    padding-left: 20px;
}

.message li {
    margin: 4px 0;
}

/* Directions formatting */
.message strong {
    font-weight: 600;
    color: #111827;
}

.user-message strong {
    color: white;
}

/* Turn-by-turn directions list */
.message ol {
    margin: 8px 0;
    padding-left: 20px;
}

.message ol li {
    margin: 6px 0;
    line-height: 1.5;
}

.typing-indicator {
    display: inline-block;
    background: white;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
}

.typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #6b7280;
    border-radius: 50%;
    margin-right: 4px;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
    margin-right: 0;
}

@keyframes typing {
    0%, 60%, 100% { opacity: 0.3; }
    30% { opacity: 1; }
}

.chat-input-container {
    padding: 20px;
    background: white;
    border-top: 1px solid #e5e7eb;
    border-radius: 0 0 10px 10px;
    display: flex;
    gap: 10px;
}

#chat-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #e5e7eb;
    border-radius: 5px;
    font-size: 14px;
    outline: none;
}

#chat-input:focus {
    border-color: #1e40af;
}

#send-btn {
    background: #1e40af;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

#send-btn:hover {
    background: #1d4ed8;
}

#send-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #1e40af;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

.chat-toggle:hover {
    background: #1d4ed8;
    transform: scale(1.05);
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chat-container {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
    
    .chat-header {
        border-radius: 0;
    }
    
    .chat-input-container {
        border-radius: 0;
    }
    
    .chat-toggle {
        bottom: 10px;
        right: 10px;
    }
    
    /* Adjust message margins on mobile */
    .bot-message {
        margin-right: 20px;
    }
    
    .user-message {
        margin-left: 20px;
    }
}

/* Accessibility */
.chat-container:focus-within {
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

/* Error states */
.error-message {
    background: #fee;
    color: #dc2626;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 20px;
    font-size: 14px;
}

/* Session warnings */
.session-warning {
    background: #FEF3C7;
    color: #92400E;
    padding: 10px;
    margin: 10px 20px;
    border-radius: 5px;
    font-size: 14px;
    text-align: center;
    border: 1px solid #FCD34D;
}

.inactivity-warning {
    background: #FEF3C7 !important;
    border: 1px solid #FCD34D !important;
}

.inactivity-warning p {
    color: #92400E;
    margin: 0;
}

/* Disabled state */
#chat-input:disabled,
#send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Message counter (optional visual indicator) */
.message-counter {
    position: absolute;
    top: 15px;
    right: 60px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

/* Special formatting for addresses and phone numbers */
.message address {
    font-style: normal;
    margin: 8px 0;
}

/* Map preview (if you add this feature later) */
.map-preview {
    width: 100%;
    height: 150px;
    border-radius: 8px;
    margin: 10px 0;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

/* Print styles */
@media print {
    .chat-container {
        position: static;
        width: 100%;
        height: auto;
        box-shadow: none;
    }
    
    .chat-toggle,
    .minimize-btn {
        display: none;
    }
}