/* Chat Widget Styles */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid #00ff41;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.5);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
    transition: all 0.3s ease;
    transform: translateY(calc(100% + 20px));
    opacity: 0;
}

.chat-widget.active {
    transform: translateY(0);
    opacity: 1;
}

.chat-header {
    background: linear-gradient(135deg, #000000, #003300);
    padding: 15px;
    border-bottom: 2px solid #00ff41;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-title {
    color: #00ff41;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 0 10px #00ff41;
}

.chat-close {
    background: none;
    border: none;
    color: #00ff41;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.chat-close:hover {
    background: rgba(0, 255, 65, 0.2);
    color: #39ff14;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: thin;
    scrollbar-color: #00ff41 #000;
}

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

.chat-messages::-webkit-scrollbar-track {
    background: #000;
}

.chat-messages::-webkit-scrollbar-thumb {
    background-color: #00ff41;
    border-radius: 10px;
}

.message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 15px;
    margin-bottom: 5px;
    font-family: 'Courier Prime', monospace;
    position: relative;
    animation: fadeIn 0.3s ease;
}

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

.message.bot {
    align-self: flex-start;
    background: rgba(0, 255, 65, 0.15);
    border-left: 3px solid #00ff41;
    color: #00ff41;
}

.message.user {
    align-self: flex-end;
    background: rgba(0, 255, 255, 0.15);
    border-right: 3px solid #00ffff;
    color: #00ffff;
}

.message.bot::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, #00ff41, transparent);
    animation: scan-line-horizontal 2s linear infinite;
}

.message.typing {
    display: flex;
    align-items: center;
    gap: 5px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #00ff41;
    border-radius: 50%;
    animation: typing-animation 1.5s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.5s;
}

.typing-dot:nth-child(3) {
    animation-delay: 1s;
}

@keyframes typing-animation {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1); }
}

.chat-input-container {
    padding: 15px;
    border-top: 2px solid #00ff41;
    display: flex;
    gap: 10px;
    background: rgba(0, 0, 0, 0.9);
}

.chat-input {
    flex: 1;
    background: rgba(0, 255, 65, 0.1);
    border: 1px solid #00ff41;
    border-radius: 5px;
    padding: 10px 15px;
    color: #00ffff;
    font-family: 'Courier Prime', monospace;
    outline: none;
    transition: all 0.3s ease;
}

.chat-input:focus {
    border-color: #39ff14;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

.chat-input::placeholder {
    color: rgba(0, 255, 65, 0.5);
}

.chat-send {
    background: linear-gradient(135deg, #00ff41, #008f11);
    border: none;
    border-radius: 5px;
    color: #000;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    padding: 10px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chat-send:hover {
    background: linear-gradient(135deg, #39ff14, #00ff41);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 65, 0.3);
}

.chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #00ff41, #008f11);
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 999;
    transition: all 0.3s ease;
}

.chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 20px rgba(0, 255, 65, 0.5);
}

.chat-toggle.active {
    background: linear-gradient(135deg, #ff0040, #990026);
}

.chat-toggle i {
    transition: all 0.3s ease;
}

.chat-toggle.active i {
    transform: rotate(45deg);
}

/* Matrix-style typing animation */
.matrix-typing {
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid #00ff41;
    animation: typing 3s steps(40, end), blink-caret 0.75s step-end infinite;
    display: inline-block;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: #00ff41 }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .chat-widget {
        width: calc(100% - 40px);
        height: 60vh;
        bottom: 80px;
    }
}