/* Proyecto Noctilucas - Chatbot Tutorial Styles */

:root {
    --cb-bg: rgba(18, 18, 18, 0.85);
    --cb-accent: #00f2ff;
    --cb-text: #ffffff;
    --cb-text-sec: #a0a0a0;
    --cb-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
    --cb-border: 1px solid rgba(0, 242, 255, 0.2);
}

/* Chatbot Launcher Button */
#cb-launcher {
    position: fixed !important;
    top: 20px !important;
    right: 10px !important;
    height: 38px !important;
    padding: 0 16px !important;
    margin: 0 !important;
    background: var(--cb-accent);
    border-radius: 20px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 242, 255, 0.4) !important;
    z-index: 20000 !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none !important;
    color: #000 !important;
    font-weight: bold !important;
    font-size: 12px !important;
    letter-spacing: 0.5px;
}

#cb-launcher:hover {
    transform: scale(1.1);
    box-shadow: 0 0 25px rgba(0, 242, 255, 0.7);
}

#cb-launcher .icon {
    font-size: 18px;
    line-height: 1;
}

/* Chat Window */
#cb-window {
    position: fixed;
    top: 75px; /* Below the top-right launcher */
    right: 10px; /* Aligned with launcher */
    width: 320px;
    max-height: 450px;
    background: var(--cb-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 20px;
    border: var(--cb-border);
    box-shadow: var(--cb-shadow);
    display: none;
    flex-direction: column;
    z-index: 10000;
    overflow: hidden;
    animation: cb-fade-in 0.3s ease-out;
}

#cb-window.active {
    display: flex;
}

@keyframes cb-fade-in {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Chat Header */
.cb-header {
    padding: 15px 20px;
    background: rgba(0, 242, 255, 0.1);
    border-bottom: 1px solid rgba(0, 242, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cb-header h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--cb-accent);
    font-weight: 700;
}

.cb-close {
    background: none;
    border: none;
    color: var(--cb-text-sec);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

/* Chat Body */
.cb-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scrollbar-width: thin;
    scrollbar-color: var(--cb-accent) transparent;
}

.cb-body::-webkit-scrollbar {
    width: 4px;
}

.cb-body::-webkit-scrollbar-thumb {
    background: var(--cb-accent);
    border-radius: 10px;
}

/* Messages */
.cb-msg {
    max-width: 85%;
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.cb-msg.bot {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.05);
    color: var(--cb-text);
    border-bottom-left-radius: 2px;
}

.cb-msg.user {
    align-self: flex-end;
    background: var(--cb-accent);
    color: #000;
    border-bottom-right-radius: 2px;
    font-weight: 600;
}

/* Typing Indicator */
.cb-typing {
    display: flex;
    gap: 3px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    width: fit-content;
}

.cb-dot {
    width: 6px;
    height: 6px;
    background: var(--cb-accent);
    border-radius: 50%;
    animation: cb-typing 1.4s infinite both;
}

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

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

/* Options / Buttons */
.cb-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 5px;
}

.cb-opt-btn {
    background: rgba(0, 242, 255, 0.1);
    border: 1px solid rgba(0, 242, 255, 0.3);
    color: var(--cb-accent);
    padding: 8px 15px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    text-align: left;
    transition: all 0.2s;
    font-weight: 500;
}

.cb-opt-btn:hover {
    background: var(--cb-accent);
    color: #000;
}

/* Highlighter Effect */
.cb-highlight {
    position: fixed;
    z-index: 9999;
    border: 3px solid var(--cb-accent);
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6), 0 0 20px var(--cb-accent);
    pointer-events: none;
    transition: all 0.4s ease;
    display: none;
}

.cb-highlight.active {
    display: block;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    #cb-window {
        width: calc(100% - 30px);
        right: 15px;
    }
}
