/* AI Chatbot Widget Styles */
#ai-chatbot {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    font-family: inherit;
}

.chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--highlight-color, #64ffda);
    color: #020c1b;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    position: relative;
}

.chat-toggle:hover {
    transform: scale(1.05);
}

.chat-toggle i {
    width: 24px;
    height: 24px;
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
}

.chat-panel {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: #112240;
    border-radius: 12px;
    box-shadow: 0 10px 30px -15px rgba(2, 12, 27, 0.7);
    border: 1px solid rgba(100, 255, 218, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.chat-panel.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.chat-header {
    padding: 15px 20px;
    background: rgba(10, 25, 47, 0.95);
    border-bottom: 1px solid rgba(100, 255, 218, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--highlight-color, #64ffda);
    color: #020c1b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.chat-header-info h4 {
    margin: 0;
    color: #e6f1ff;
    font-size: 1rem;
}

.chat-status {
    font-size: 0.75rem;
    color: var(--highlight-color, #64ffda);
}

.chat-close {
    background: transparent;
    border: none;
    color: #a8b2d1;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
}

.chat-close:hover {
    color: #ff4757;
}

.chat-close i {
    width: 20px;
    height: 20px;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

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

.chat-messages::-webkit-scrollbar-track {
    background: rgba(10, 25, 47, 0.5);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(100, 255, 218, 0.3);
    border-radius: 3px;
}

.chat-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.chat-message p {
    margin: 0;
}

.chat-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.chat-action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(100, 255, 218, 0.35);
    color: #e6f1ff;
    text-decoration: none;
    font-size: 0.8rem;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.chat-action-link:hover {
    background: rgba(100, 255, 218, 0.12);
    border-color: var(--highlight-color, #64ffda);
    transform: translateY(-1px);
}

.chat-message.bot {
    background: rgba(10, 25, 47, 0.8);
    color: #a8b2d1;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}

.chat-message.user {
    background: rgba(100, 255, 218, 0.1);
    color: #e6f1ff;
    border: 1px solid rgba(100, 255, 218, 0.2);
    border-bottom-right-radius: 4px;
    align-self: flex-end;
}

.chat-input-area {
    padding: 15px;
    background: rgba(10, 25, 47, 0.95);
    border-top: 1px solid rgba(100, 255, 218, 0.1);
    display: flex;
    gap: 10px;
}

#chat-input {
    flex: 1;
    background: transparent;
    border: 1px solid rgba(100, 255, 218, 0.2);
    border-radius: 20px;
    padding: 10px 15px;
    color: #e6f1ff;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s ease;
}

#chat-input:focus {
    border-color: var(--highlight-color, #64ffda);
}

#chat-send {
    background: var(--highlight-color, #64ffda);
    color: #020c1b;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

#chat-send:hover {
    transform: scale(1.05);
}

#chat-send i {
    width: 18px;
    height: 18px;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: rgba(10, 25, 47, 0.8);
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    width: fit-content;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--highlight-color, #64ffda);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

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

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

@media (max-width: 768px) {
    .chat-panel {
        width: calc(100vw - 40px);
        right: -10px;
        bottom: 70px;
    }
}

/* Redesigned portfolio chat skin */
#ai-chatbot {
    bottom: 28px;
    right: 28px;
}

.chat-toggle {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    background: linear-gradient(135deg, #55f0c5, #f0b429);
    color: #071014;
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.34);
}

.chat-badge {
    background: #ff6b8a;
    border: 2px solid #071014;
}

.chat-panel {
    width: min(390px, calc(100vw - 36px));
    height: 560px;
    border-radius: 8px;
    background: rgba(14, 27, 34, 0.96);
    border: 1px solid rgba(220, 232, 238, 0.12);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(16px);
}

.chat-header,
.chat-input-area {
    background: rgba(7, 16, 20, 0.86);
    border-color: rgba(220, 232, 238, 0.1);
}

.chat-avatar {
    border-radius: 8px;
    background: rgba(85, 240, 197, 0.14);
    border: 1px solid rgba(85, 240, 197, 0.42);
    color: #eafff8;
}

.chat-status {
    color: #55f0c5;
}

.chat-message {
    border-radius: 8px;
}

.chat-message.bot {
    background: rgba(220, 232, 238, 0.06);
    border: 1px solid rgba(220, 232, 238, 0.08);
    color: #c8d8df;
}

.chat-message.user {
    background: rgba(85, 240, 197, 0.13);
    border-color: rgba(85, 240, 197, 0.28);
}

#chat-input {
    border-radius: 8px;
}

#chat-send {
    border-radius: 8px;
    background: #55f0c5;
}

.typing-indicator {
    border-radius: 8px;
    background: rgba(220, 232, 238, 0.06);
}

@media (max-width: 768px) {
    #ai-chatbot {
        right: 16px;
        bottom: 18px;
    }

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

    .chat-panel {
        right: 0;
        bottom: 74px;
        height: min(540px, calc(100vh - 110px));
    }
}
