/* Rocky Chatbot Frontend Styles */
#rocky-chatbot-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
}

/* Toggle Button */
#rocky-toggle {
    background: linear-gradient(135deg, #0F4C81 0%, #1a6fb3 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(15, 76, 129, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    min-width: 200px;
    border: 2px solid #D4AF37;
}

#rocky-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(15, 76, 129, 0.4);
}

.rocky-avatar {
    background: white;
    color: #0F4C81;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    border: 2px solid #D4AF37;
}

.rocky-toggle-text {
    flex: 1;
    line-height: 1.3;
}

.rocky-name {
    font-weight: 700;
    font-size: 16px;
    display: block;
}

.rocky-tagline {
    font-size: 12px;
    opacity: 0.9;
    display: block;
}

.rocky-close-btn {
    background: rgba(255, 255, 255, 0.2);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
}

/* Chat Window - FIXED LAYOUT */
#rocky-chat-window {
    width: 380px;
    height: 580px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    border: 2px solid #D4AF37;
}

.rocky-header {
    background: linear-gradient(135deg, #0F4C81 0%, #1a6fb3 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0; /* Don't shrink header */
}

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

.rocky-avatar-lg {
    background: white;
    color: #0F4C81;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    border: 2px solid #D4AF37;
}

.rocky-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.rocky-status {
    margin: 2px 0 0 0;
    font-size: 12px;
    opacity: 0.9;
}

.rocky-minimize {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rocky-minimize:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Messages Area - FIXED FLEXBOX */
#rocky-messages {
    flex: 1 1 auto;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Critical for scrolling */
}

.rocky-message {
    margin-bottom: 16px;
    animation: rockyFadeIn 0.3s ease;
    flex-shrink: 0; /* Don't shrink messages */
}

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

.rocky-message-content {
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 85%;
    position: relative;
}

.rocky-bot .rocky-message-content {
    background: white;
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

.rocky-user .rocky-message-content {
    background: linear-gradient(135deg, #0F4C81 0%, #1a6fb3 100%);
    color: white;
    border-radius: 18px 18px 4px 18px;
    margin-left: auto;
}

.rocky-message-content p {
    margin: 0;
    line-height: 1.5;
    font-size: 14px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.rocky-message-time {
    font-size: 11px;
    color: #6c757d;
    margin-top: 4px;
    padding: 0 8px;
}

.rocky-user .rocky-message-time {
    text-align: right;
}

/* Typing Indicator */
.rocky-typing .rocky-message-content {
    background: #e9ecef;
    padding: 16px;
    width: 60px;
}

.rocky-typing-dots {
    display: flex;
    gap: 4px;
}

.rocky-typing-dots span {
    width: 8px;
    height: 8px;
    background: #6c757d;
    border-radius: 50%;
    animation: rockyBounce 1.4s infinite ease-in-out;
}

.rocky-typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.rocky-typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes rockyBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Input Area - FIXED TO BOTTOM */
.rocky-input-area {
    padding: 16px;
    border-top: 1px solid #e9ecef;
    background: white;
    display: flex;
    gap: 10px;
    flex-shrink: 0; /* Don't shrink */
    margin-top: auto; /* Push to bottom */
}

#rocky-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

#rocky-input:focus {
    border-color: #0F4C81;
}

#rocky-send {
    background: linear-gradient(135deg, #0F4C81 0%, #1a6fb3 100%);
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

#rocky-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(15, 76, 129, 0.3);
}

/* Footer */
.rocky-footer {
    padding: 12px 16px;
    text-align: center;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    font-size: 11px;
    color: #6c757d;
    flex-shrink: 0;
}

.rocky-footer a {
    color: #0F4C81;
    text-decoration: none;
}

.rocky-footer a:hover {
    text-decoration: underline;
}

/* Better Scrollbar */
#rocky-messages::-webkit-scrollbar {
    width: 8px;
}

#rocky-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#rocky-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

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

/* Firefox */
#rocky-messages {
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}

/* Responsive */
@media (max-width: 768px) {
    #rocky-chatbot-container {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }
    
    #rocky-chat-window {
        width: calc(100vw - 20px);
        height: 70vh;
        right: 10px;
        bottom: 80px;
    }
    
    #rocky-toggle {
        min-width: auto;
        max-width: 300px;
    }
    
    .rocky-message-content {
        max-width: 90%;
    }
}
/* ===== FORCE SCROLLBARS - DEBUG MODE ===== */

/* Force scrollbar to ALWAYS be visible */
#rocky-messages {
    overflow-y: scroll !important;
    -ms-overflow-style: scrollbar !important; /* IE/Edge */
}

/* Make scrollbar THICK and VISIBLE */
#rocky-messages::-webkit-scrollbar {
    width: 16px !important; /* Extra thick */
    background-color: #f1f1f1 !important;
}

#rocky-messages::-webkit-scrollbar-track {
    background: #0F4C81 !important; /* Blue track */
    border: 4px solid #f1f1f1 !important;
    border-radius: 8px !important;
}

#rocky-messages::-webkit-scrollbar-thumb {
    background: #D4AF37 !important; /* Gold thumb */
    border: 4px solid #0F4C81 !important;
    border-radius: 8px !important;
}

#rocky-messages::-webkit-scrollbar-thumb:hover {
    background: #ffd700 !important; /* Bright gold on hover */
}

/* Firefox - force visible scrollbar */
#rocky-messages {
    scrollbar-width: auto !important;
    scrollbar-color: #D4AF37 #0F4C81 !important;
}

/* Ensure container has proper height for scrolling */
#rocky-chat-window {
    min-height: 580px !important;
    display: flex !important;
    flex-direction: column !important;
}

#rocky-messages {
    flex: 1 !important;
    min-height: 300px !important; /* Force minimum height */
    max-height: 400px !important; /* Force maximum height */
}