/* Modern Chatbot Design - FXAN Theme */
:root {
    --primary-color: #1B3764;      /* Temno modra iz FXAN logotipa */
    --secondary-color: #4A90E2;    /* Svetlo modra iz FXAN logotipa */
    --accent-color: #F5A623;       /* Oranžna za poudarke */
    --background-color: #FFFFFF;
    --text-color: #1B3764;
    --light-gray: #F5F7FA;
    --border-radius: 16px;
    --shadow: 0 8px 24px rgba(27, 55, 100, 0.12);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Chat Widget Button */
.groq-chatbot-widget-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 28px;
    background-color: var(--primary-color);
    box-shadow: var(--shadow);
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    border: none;
}

.groq-chatbot-widget-button:hover {
    transform: translateY(-2px);
    background-color: var(--secondary-color);
    box-shadow: 0 12px 28px rgba(27, 55, 100, 0.2);
}

.groq-chatbot-widget-button svg {
    width: 24px;
    height: 24px;
    fill: white;
}

/* Chat Container */
.groq-chatbot-container {
    display: none;
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 380px;
    height: 600px;
    background: var(--background-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    z-index: 9998;
    overflow: hidden;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.groq-chatbot-container.active {
    display: flex !important;
    animation: chatbotSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes chatbotSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Chat Header */
.groq-chatbot-header {
    background: var(--primary-color);
    color: white;
    padding: 16px 20px;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.groq-chatbot-header .header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.groq-chatbot-header .header-left img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
}

.groq-chatbot-header .header-left span {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 16px;
    font-weight: 500;
}

.groq-chatbot-header .header-left span::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--accent-color);
    border-radius: 50%;
}

.groq-chatbot-header .close-button {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: var(--transition);
}

.groq-chatbot-header .close-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Messages Container */
.groq-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--background-color);
    scroll-behavior: smooth;
}

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

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

.groq-chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

/* Message Bubbles */
.groq-chatbot-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    animation: messagePopIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes messagePopIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.groq-chatbot-message.user {
    background: var(--primary-color);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.groq-chatbot-message.bot {
    background: var(--light-gray);
    color: var(--text-color);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border-left: 3px solid var(--secondary-color);
}

.groq-chatbot-message.system {
    background: rgba(0, 0, 0, 0.05);
    color: rgba(0, 0, 0, 0.5);
    font-size: 13px;
    text-align: center;
    max-width: 100%;
    margin: 8px auto;
    padding: 8px 16px;
    border-radius: 8px;
}

/* Input Area */
.groq-chatbot-input {
    padding: 16px;
    background: var(--background-color);
    border-top: 1px solid var(--light-gray);
    display: flex;
    gap: 12px;
    align-items: center;
}

#groq-chatbot-message {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--light-gray);
    border-radius: 24px;
    font-size: 14px;
    line-height: 1.5;
    outline: none;
    transition: var(--transition);
    resize: none;
    height: 44px;
    background: var(--light-gray);
}

#groq-chatbot-message:focus {
    border-color: var(--secondary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

#groq-chatbot-send {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    padding: 0;
}

#groq-chatbot-send:hover {
    background: var(--secondary-color);
    transform: scale(1.05);
}

#groq-chatbot-send:active {
    transform: scale(0.95);
}

#groq-chatbot-send svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: var(--light-gray);
    border-radius: 16px;
    width: fit-content;
    margin-top: 8px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

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

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-4px);
    }
}

/* Responsive Design */
@media screen and (max-width: 480px) {
    .groq-chatbot-container {
        width: calc(100% - 32px);
        height: calc(100% - 120px);
        right: 16px;
        bottom: 80px;
    }

    .groq-chatbot-widget-button {
        right: 16px;
        bottom: 16px;
    }
}

/* Code Block Styling */
.groq-chatbot-message pre {
    background: #1E1E1E;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 12px 0;
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    line-height: 1.6;
}

.groq-chatbot-message code {
    font-family: 'Fira Code', monospace;
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* Links in Messages */
.groq-chatbot-message a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}

.groq-chatbot-message a:hover {
    border-bottom-color: var(--primary-color);
}

/* Lists in Messages */
.groq-chatbot-message ul,
.groq-chatbot-message ol {
    margin: 8px 0 8px 24px;
    padding: 0;
}

.groq-chatbot-message li {
    margin: 4px 0;
}

/* Markdown styling */
.groq-chatbot-message p {
    margin: 0 0 10px 0;
}

.groq-chatbot-message p:last-child {
    margin-bottom: 0;
}

.groq-chatbot-message h1,
.groq-chatbot-message h2,
.groq-chatbot-message h3,
.groq-chatbot-message h4,
.groq-chatbot-message h5,
.groq-chatbot-message h6 {
    margin: 15px 0 10px 0;
    color: #fff;
    font-weight: 600;
    line-height: 1.2;
}

.groq-chatbot-message h1 { font-size: 1.5em; }
.groq-chatbot-message h2 { font-size: 1.3em; }
.groq-chatbot-message h3 { font-size: 1.2em; }
.groq-chatbot-message h4 { font-size: 1.1em; }
.groq-chatbot-message h5 { font-size: 1em; }
.groq-chatbot-message h6 { font-size: 0.9em; }

.groq-chatbot-message blockquote {
    border-left: 3px solid #2ea0da;
    margin: 10px 0;
    padding: 5px 15px;
    background: rgba(46, 160, 218, 0.1);
    font-style: italic;
}

.groq-chatbot-message table {
    border-collapse: collapse;
    margin: 10px 0;
    width: 100%;
}

.groq-chatbot-message th,
.groq-chatbot-message td {
    border: 1px solid #333;
    padding: 6px 10px;
    text-align: left;
}

.groq-chatbot-message th {
    background: rgba(255, 255, 255, 0.1);
}

.groq-chatbot-message hr {
    border: none;
    border-top: 1px solid #333;
    margin: 15px 0;
}

.groq-chatbot-message img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 10px 0;
}

/* Syntax highlighting customization */
.groq-chatbot-message .token.comment,
.groq-chatbot-message .token.prolog,
.groq-chatbot-message .token.doctype,
.groq-chatbot-message .token.cdata {
    color: #7c8596;
}

.groq-chatbot-message .token.punctuation {
    color: #9ea7b3;
}

.groq-chatbot-message .token.property,
.groq-chatbot-message .token.keyword,
.groq-chatbot-message .token.tag {
    color: #d19a66;
}

.groq-chatbot-message .token.string {
    color: #98c379;
}

.groq-chatbot-message .token.operator,
.groq-chatbot-message .token.entity,
.groq-chatbot-message .token.url {
    color: #56b6c2;
}

.groq-chatbot-message .token.function {
    color: #61afef;
}

.groq-chatbot-message .token.number {
    color: #e5c07b;
}

.groq-chatbot-message .token.boolean,
.groq-chatbot-message .token.constant {
    color: #c678dd;
}

/* Typing indicator */
.groq-chatbot-message.typing {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    padding: 8px 15px;
}

.groq-chatbot-message.typing::after {
    content: '';
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    margin-left: 4px;
    animation: typingDot 1s infinite;
}

.groq-chatbot-message.typing::before {
    content: '';
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    margin-right: 4px;
    animation: typingDot 1s infinite 0.3s;
}

@keyframes typingDot {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}

/* Links in messages */
.groq-chatbot-message a {
    color: #2ea0da;
    text-decoration: underline;
}

.groq-chatbot-message a:hover {
    color: #ed245d;
}

/* Lists in messages */
.groq-chatbot-message ul,
.groq-chatbot-message ol {
    margin: 5px 0 5px 20px;
    padding: 0;
}

.groq-chatbot-message li {
    margin: 2px 0;
}

.groq-chatbot-typing {
    padding: 10px 15px;
    background: #f1f1f1;
    border-radius: 15px;
    display: inline-block;
    margin-bottom: 15px;
    animation: typing 1s infinite;
}

@keyframes typing {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

.new-chat-button {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 6px 14px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition);
    margin-left: 12px;
}

.new-chat-button:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Izboljšave za vnosno polje */
#groq-chatbot-message:focus {
    border-color: #2ea0da;
    box-shadow: 0 0 0 2px rgba(46, 160, 218, 0.2);
}

@media (max-width: 480px) {
    .groq-chatbot-container {
        width: 90%;
        height: 70vh;
        bottom: 10px;
        right: 5%;
    }
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.new-chat-button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.new-chat-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.new-chat-button svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
} 