/* resources/css/floating-taskbar.css */

/* Main container for positioning */
.pms-fab-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: move; /* Indicate draggable */
    transition: none; /* Remove transitions during drag */
}

.pms-fab-container.dragging {
    transition: none !important;
    user-select: none;
}

.pms-fab-container.dragging * {
    pointer-events: none; /* Prevent child elements from interfering with drag */
}

/* Main Toggle Button */
.pms-fab-toggle {
    background-color: azure;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    cursor: move; /* Show move cursor for drag */
    transition: transform 0.3s ease, background-color 0.3s ease;
    z-index: 3;
}

.pms-fab-toggle:focus {
    outline: none;
    border: none;
}

.pms-fab-toggle:hover {
    transform: scale(1.1);
}

.pms-fab-toggle .pms-fab-icon-plus {
    transition: transform 0.3s ease-in-out;
}

/* Rotate icon when active */
.pms-fab-container.active .pms-fab-toggle {
    transform: rotate(10deg);
    transition: transform 0.3s ease, background-color 0.3s ease;
    background-color: #ffffff;
}

/* The expanding bar */
.pms-fab-bar {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translate(-50%, 20px) scale(0.8);
    opacity: 0;
    visibility: hidden;
    background-color: white;
    border-radius: 30px;
    padding: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0s 0.3s;
    z-index: 2;
    width: 560px;
    background-color: azure;
}

.pms-fab-container.active .pms-fab-bar {
    transform: translate(-50%, 0) scale(1);
    opacity: 1;
    visibility: visible;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0s 0s;
    border: 5px solid var(--primary-color, #087de9);
    border-top: 0px;
    border-bottom: 1px solid var(--primary-color, #087de9);
}

.pms-fab-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap; /* Allows icons to wrap on smaller screens */
    justify-content: center;
    margin: 0px 5px;
}

/* Individual Action Icons */
.pms-fab-action {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background-color: #f0f4f9;
    border-radius: 50%;
    color: #333;
    transition: background-color 0.2s ease, transform 0.2s ease;
    box-shadow: 0px 3px 5px 1px #00000045;
}

.pms-fab-action:hover {
    background-color: #e1e9f2;
    transform: translateY(-3px);
    color: #087de9;
}

.pms-fab-action svg {
    width: 24px;
    height: 24px;
}

/* Tooltip on Hover */
.pms-fab-action[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 10;
}

.pms-fab-action[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transition-delay: 0.3s;
}

/* "Ask AI" Trigger */
.pms-fab-ai-trigger , .pms-fab-ai-trigger2 {
    color: #000;
    font-weight: 600;
    text-decoration: none;
    padding: 0 15px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.pms-fab-ai-trigger-span{
    text-decoration: underline;
    text-underline-offset: 4px;
}

.pms-fab-ai-trigger:hover , .pms-fab-ai-trigger2:hover {
    color: #076cc0;
}


/* --- AI Chat Window Styles --- */
/* resources/css/floating-taskbar.css */

/* (All the .pms-fab-* styles from before remain the same) */


/* --- AI Chat Window Styles (Updated for SimeAI Design) --- */
.pms-chat-window {
    position: fixed;
    bottom: 115px;
    left: 50%;
    width: 90%;
    max-width: 480px; /* A bit wider for the new design */
    height: 600px;
    max-height: 70vh;
    background-color: white;
    border-radius: 15px;
    border: 1px solid #eef2f6;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 1;
    transform: translate(-50%, 20px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease;
    overflow: hidden; /* Important for border-radius */
    pointer-events: none; /* Prevent interference with dragging */
}

.pms-chat-window.active {
    transform: translate(-50%, 0) scale(1);
    opacity: 1;
    visibility: visible;
    pointer-events: auto; /* Re-enable interactions when active */
}

.pms-chat-header {
    flex-shrink: 0;
    padding: 20px 25px;
    border-bottom: 1px solid #eef2f6;
    background-color: white;
}

.pms-chat-title {
    font-weight: 700;
    font-size: 1.25rem;
    color: #1a202c;
    text-decoration: underline;
    text-decoration-color: #087de9;
    text-underline-offset: 4px;
}

.pms-chat-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    cursor: pointer;
    color: #a0aec0;
    padding: 5px;
    transition: color 0.2s;
}
.pms-chat-close:hover {
    color: #2d3748;
}

.pms-chat-body {
    flex-grow: 1;
    padding: 25px;
    overflow-y: auto;
    background-color: #f7fafc;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

@media (max-width: 500px) {    
    .pms-chat-body {
        max-height: 40vh;
    }
}

.pms-chat-message {
    display: flex;
    gap: 15px;
    max-width: 85%;
}

.pms-chat-avatar {
    flex-shrink: 0;
}

.pms-chat-text-wrapper {
    display: flex;
    flex-direction: column;
}

.pms-chat-message-content {
    padding: 12px 18px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
}

.pms-chat-timestamp {
    font-size: 11px;
    color: #a0aec0;
    margin-top: 8px;
}

/* AI Message Styling */
.pms-chat-message-ai {
    align-self: flex-start;
}
.pms-chat-message-ai .pms-chat-message-content {
    background-color: #eef2f6;
    color: #2d3748;
    border-bottom-left-radius: 4px;
}
.pms-chat-message-ai .pms-chat-timestamp {
    padding-left: 5px;
}

/* User Message Styling */
.pms-chat-message-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}
.pms-chat-message-user .pms-chat-message-content {
    background-color: #087de9;
    color: white;
    border-bottom-right-radius: 4px;
}
.pms-chat-message-user .pms-chat-timestamp {
    text-align: right;
    padding-right: 5px;
}


/* Footer and Input Styling */
.pms-chat-footer {
    display: flex;
    padding: 20px 25px;
    background-color: white;
    border-top: 1px solid #eef2f6;
    gap: 15px;
    align-items: center;
}

.pms-chat-input-wrapper {
    flex-grow: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.pms-chat-input {
    width: 100%;
    border: none;
    background: #f7fafc;
    padding: 15px 90px 15px 20px; /* Make space for icons on the right */
    border-radius: 12px;
    font-size: 14px;
    border: 1px solid #eef2f6;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.pms-chat-input:focus {
    outline: none;
    border-color: #087de9;
    box-shadow: 0 0 0 3px rgba(8, 125, 233, 0.1);
}

.pms-chat-icon-btn {
    position: absolute;
    background: none;
    border: none;
    cursor: pointer;
    color: #a0aec0;
    transition: color 0.2s;
}
.pms-chat-icon-btn:hover {
    color: #087de9;
}
.pms-chat-mic {
    right: 50px;
}
.pms-chat-attach {
    right: 15px;
}

.pms-chat-send {
    flex-shrink: 0;
    background: #087de9;
    border: none;
    cursor: pointer;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}
.pms-chat-send:hover {
    background: #076cc0;
}
.pms-chat-send svg {
    margin-left: -2px; /* Center the icon */
}


/* --- Responsive Design --- */
@media (max-width: 768px) {
    /* (The .pms-fab-bar responsive styles remain the same) */
    
    .pms-chat-window {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        bottom: 0;
        left: 0;
        transform: translateY(100%);
    }
     .pms-chat-window.active {
        transform: translateY(0);
    }
}

/* Styles for user message can be added here */
/* .pms-chat-message-user { align-self: flex-end; } etc. */


.pms-chat-footer {
    display: flex;
    padding: 15px 20px;
    border-top: 1px solid #f0f0f0;
    gap: 10px;
    align-items: center;
}

.pms-chat-attach, .pms-chat-send {
    /* background: none; */
    border: none;
    cursor: pointer;
    color: #888;
    flex-shrink: 0;
    padding: 5px;
    transition: color 0.2s;
}
.pms-chat-attach:hover, .pms-chat-send:hover {
    color: #087de9;
}
.pms-chat-send {
    color: #087de9;
}

.pms-chat-input {
    flex-grow: 1;
    border: none;
    background: #f7f9fc;
    padding: 12px 15px;
    border-radius: 20px;
    font-size: 14px;
}

.pms-chat-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(8, 125, 233, 0.2);
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .pms-fab-container {
        bottom: 20px;
        right: 20px;
    }
    
    /* Make the bar take more width on mobile */
    .pms-fab-bar {
        width: 90vw;
        justify-content: space-around;
    }
    
    /* Center chat window properly */
    .pms-chat-window {
        left: 50%;
        transform: translate(-50%, 20px) scale(0.95);
        width: 90vw;
        max-height: 75vh;
        bottom: 95px; /* Adjust for smaller screens */
    }
    .pms-chat-window.active {
        transform: translate(-50%, 0) scale(1);
    }
}

.pms-fab-action img {
    position: absolute;
    height: 35px;
    width: 35px;
}

.ask-ai-icon{
    position: absolute;
    left: 80px;
    top: -10px;
    border-radius: 50%;
    z-index: -1;
    rotate: 10deg;
}