/* Custom Styles for Backgrounds and Animations */
.hero-bg {
    background-image: linear-gradient(rgba(15, 23, 42, 0.90), rgba(15, 23, 42, 0.98)), url('img/courthouse_bg.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.section-bg {
    background-color: #0f172a;
    background-image: radial-gradient(#1e293b 1px, transparent 1px);
    background-size: 20px 20px;
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Gold text gradient */
.text-gradient-gold {
    background: linear-gradient(to right, #bf953f, #fcf6ba, #b38728, #fbf5b7, #aa771c);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* =====================================================
   CHATBOT STYLES
   ===================================================== */

/* Container */
#chatbot-container {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 100;
    font-family: 'Montserrat', sans-serif;
}

@media (min-width: 768px) {
    #chatbot-container {
        bottom: 32px;
        left: 32px;
    }
}

/* Toggle Button */
#chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border: 2px solid rgba(212, 175, 55, 0.4);
    color: #d4af37;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(212, 175, 55, 0.15);
}

#chatbot-toggle:hover {
    transform: scale(1.1);
    border-color: rgba(212, 175, 55, 0.7);
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.5), 0 0 25px rgba(212, 175, 55, 0.25);
}

#chatbot-pulse {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    background-color: #d4af37;
    border-radius: 50%;
    border: 3px solid #0f172a;
    animation: chatbot-pulse-anim 2s ease-in-out infinite;
}

@keyframes chatbot-pulse-anim {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

/* Chat Window */
#chatbot-window {
    position: absolute;
    bottom: 75px;
    left: 0;
    width: 380px;
    max-height: 560px;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 20px rgba(212, 175, 55, 0.08);
    transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s;
}

/* Mobile responsive */
@media (max-width: 480px) {
    #chatbot-window {
        width: calc(100vw - 32px);
        left: -8px;
        max-height: 75vh;
        bottom: 70px;
    }
}

#chatbot-window.chatbot-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    visibility: visible;
    pointer-events: auto;
}

#chatbot-window.chatbot-hidden {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    visibility: hidden;
    pointer-events: none;
}

/* Header */
#chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

#chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

#chatbot-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d4af37 0%, #b38728 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0f172a;
    font-size: 1.1rem;
    flex-shrink: 0;
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.3);
}

#chatbot-header h4 {
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

#chatbot-status {
    color: #94a3b8;
    font-size: 0.72rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.chatbot-status-dot {
    width: 7px;
    height: 7px;
    background: #22c55e;
    border-radius: 50%;
    display: inline-block;
    animation: chatbot-status-blink 2s infinite;
}

@keyframes chatbot-status-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

#chatbot-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

#chatbot-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

/* Privacy Notice */
#chatbot-privacy {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 18px;
    background: rgba(212, 175, 55, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #d4af37;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

#chatbot-privacy i {
    font-size: 0.7rem;
}

/* Messages Area */
#chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px 16px 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 180px;
    max-height: 280px;
    scroll-behavior: smooth;
}

/* Custom scrollbar */
#chatbot-messages::-webkit-scrollbar {
    width: 4px;
}

#chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

#chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.2);
    border-radius: 10px;
}

/* Message Wrappers */
.chatbot-msg-wrapper {
    display: flex;
    justify-content: flex-start;
    animation: chatbot-msg-in 0.35s ease-out;
}

.chatbot-msg-user-wrapper {
    justify-content: flex-end;
}

@keyframes chatbot-msg-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Message Bubbles */
.chatbot-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.82rem;
    line-height: 1.55;
    word-wrap: break-word;
}

.chatbot-msg-bot {
    background: #1e293b;
    color: #cbd5e1;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.chatbot-msg-bot strong {
    color: #ffffff;
}

.chatbot-msg-bot em {
    color: #d4af37;
}

.chatbot-msg-user {
    background: linear-gradient(135deg, #d4af37 0%, #b38728 100%);
    color: #0f172a;
    border-bottom-right-radius: 4px;
    font-weight: 600;
    font-size: 0.78rem;
}

/* Typing Indicator */
.chatbot-typing-bubble {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 12px 18px;
    min-width: 60px;
}

.chatbot-dot {
    width: 7px;
    height: 7px;
    background: #64748b;
    border-radius: 50%;
    animation: chatbot-bounce 1.4s infinite ease-in-out;
}

.chatbot-dot:nth-child(1) { animation-delay: 0s; }
.chatbot-dot:nth-child(2) { animation-delay: 0.2s; }
.chatbot-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes chatbot-bounce {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Options Area */
#chatbot-options {
    padding: 10px 16px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(15, 23, 42, 0.6);
    max-height: 180px;
    overflow-y: auto;
    transition: opacity 0.3s ease;
}

.chatbot-option-btn {
    background: rgba(30, 41, 59, 0.8);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: 'Montserrat', sans-serif;
    animation: chatbot-option-in 0.4s ease-out backwards;
    text-align: left;
}

@keyframes chatbot-option-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-option-btn:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: rgba(212, 175, 55, 0.5);
    color: #d4af37;
    transform: translateY(-1px);
}

.chatbot-option-btn:active {
    transform: scale(0.97);
}
