/* ============================
   CHAT WIDGET — BRUTALIST
   Matches classes from main.js ChatWidget
   ============================ */

/* WIDGET WRAPPER */
.chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: var(--font-body, 'JetBrains Mono', 'Courier New', monospace);
}

/* TOGGLE BUTTON (FAB) */
.chat-toggle {
    width: 56px;
    height: 56px;
    border: 3px solid #CCFF00;
    background: #000;
    color: #CCFF00;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
    position: relative;
    z-index: 2;
}

.chat-toggle svg {
    width: 24px;
    height: 24px;
    fill: #CCFF00;
}

.chat-toggle:hover {
    background: #CCFF00;
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 #FF4D00;
}

.chat-toggle:hover svg {
    fill: #000;
}

.chat-toggle.active {
    background: #FF4D00;
    border-color: #FF4D00;
}

.chat-toggle.active svg {
    fill: #fff;
}

/* CHAT WINDOW */
.chat-window {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 380px;
    max-height: 520px;
    background: #000;
    border: 3px solid #fff;
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 3;
    animation: chatSlideIn 0.2s ease;
}

.chat-window.open {
    display: flex;
}

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

/* WINDOW HEADER */
.chat-window-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #1A1A1A;
    border-bottom: 3px solid #CCFF00;
    flex-shrink: 0;
}

.chat-window-header .chat-avatar {
    width: 36px;
    height: 36px;
    border: 2px solid #CCFF00;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #000;
}

.chat-window-header .chat-avatar svg {
    stroke: #CCFF00;
}

.chat-window-header .chat-info h4 {
    font-family: 'Bebas Neue', Impact, sans-serif;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #fff;
    margin: 0;
    line-height: 1.2;
}

.chat-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.6rem;
    color: #CCFF00;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: #CCFF00;
    display: inline-block;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* MESSAGES AREA */
.chat-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    min-height: 250px;
    max-height: 340px;
    background: #000;
}

.chat-messages-container::-webkit-scrollbar {
    width: 3px;
}

.chat-messages-container::-webkit-scrollbar-track {
    background: #1A1A1A;
}

.chat-messages-container::-webkit-scrollbar-thumb {
    background: #333;
}

/* WELCOME MESSAGE */
.welcome-message {
    text-align: center;
    padding: 20px 8px;
}

.welcome-message h5 {
    font-family: 'Bebas Neue', Impact, sans-serif;
    font-size: 1.3rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
    color: #fff;
}

.welcome-message p {
    font-size: 0.7rem;
    color: #888;
    line-height: 1.6;
    margin-bottom: 16px;
}

.quick-actions {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
}

.quick-action {
    padding: 6px 14px;
    border: 2px solid #333;
    background: transparent;
    color: #888;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.15s ease;
}

.quick-action:hover {
    border-color: #CCFF00;
    color: #CCFF00;
    background: rgba(204, 255, 0, 0.05);
}

/* CHAT MESSAGES */
.chat-message {
    margin-bottom: 12px;
    animation: msgIn 0.3s ease;
    font-size: 0.78rem;
    line-height: 1.6;
    padding: 10px 14px;
    position: relative;
}

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

.chat-message.user {
    background: #1A1A1A;
    border-left: 3px solid #CCFF00;
    color: #F0F0F0;
    border-top: 1px solid #333;
    border-right: 1px solid #333;
    border-bottom: 1px solid #333;
}

.chat-message.bot {
    background: rgba(255,255,255,0.02);
    border: 1px solid #333;
    color: #F0F0F0;
}

.chat-message .timestamp {
    display: block;
    font-size: 0.55rem;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 6px;
}

/* TYPING INDICATOR */
.chat-message.typing {
    display: flex;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid #333;
    background: rgba(255,255,255,0.02);
}

.chat-message.typing span {
    width: 5px;
    height: 5px;
    background: #CCFF00;
    display: block;
    animation: typingPulse 1.2s infinite;
}

.chat-message.typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-message.typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* INPUT AREA */
.chat-input-container {
    display: flex;
    border-top: 3px solid #333;
    background: #1A1A1A;
    flex-shrink: 0;
}

.chat-input {
    flex: 1;
    padding: 12px 14px;
    background: transparent;
    border: none;
    color: #fff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    outline: none;
}

.chat-input::placeholder {
    color: #555;
}

.chat-send {
    padding: 12px 16px;
    background: #CCFF00;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-send svg {
    width: 18px;
    height: 18px;
    fill: #000;
}

.chat-send:hover {
    background: #FF4D00;
}

.chat-send:hover svg {
    fill: #fff;
}

.chat-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ============================
   HERO CHAT MESSAGES (main.js MainChat)
   ============================ */
.main-chat-message {
    padding: 10px 16px;
    margin-bottom: 8px;
    font-size: 0.8rem;
    line-height: 1.6;
    animation: msgIn 0.3s ease;
    position: relative;
}

.main-chat-message.user {
    background: #1A1A1A;
    border-left: 3px solid #CCFF00;
    border-top: 1px solid #333;
    border-right: 1px solid #333;
    border-bottom: 1px solid #333;
    color: #F0F0F0;
}

.main-chat-message.bot {
    background: rgba(255,255,255,0.02);
    border: 1px solid #333;
    color: #F0F0F0;
}

.main-chat-message .msg-time {
    display: block;
    font-size: 0.55rem;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 6px;
}

.main-chat-message.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    border: 1px solid #333;
}

.main-chat-message.typing-indicator span {
    width: 5px;
    height: 5px;
    background: #CCFF00;
    display: block;
    animation: typingPulse 1.2s infinite;
}

.main-chat-message.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.main-chat-message.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

/* ============================
   MOBILE MENU OVERLAY (created by main.js)
   ============================ */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 998;
    display: none;
}

.menu-overlay.active {
    display: block;
}

/* Mobile nav open state */
.nav-links.open {
    display: flex !important;
}

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 640px) {
    .chat-widget {
        bottom: 16px;
        right: 16px;
    }

    .chat-window {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-height: 100%;
        border: none;
        border-top: 3px solid #CCFF00;
    }

    .chat-messages-container {
        max-height: none;
        flex: 1;
    }

    .chat-toggle {
        width: 48px;
        height: 48px;
    }
}
