/* assets/css/ai-stylist-bot.css */

/* Base styles for the floating container */
#ai-stylist-bot-container {
    position: sticky;
    bottom: 20px;
    right: 20px;
    z-index: 1000000;
    width: calc(100% - 40px); /* Full width minus padding on both sides for mobile */
    max-width: 400px; /* Max width for desktop */
    height: 500px;
    overflow: hidden;
    transition: visibility 0.5s, opacity 0.5s ease-in-out;
    flex-direction: column;
    background-color: white; /* Fallback */
    border-radius: 1rem; /* Rounded corners */
    box-shadow: 0 10px 25px rgba(0,0,0,0.2); /* Soft shadow */
    font-family: "Inter", sans-serif; /* Ensure consistent font */
    left: 20px; /* Added to ensure it stays within bounds on small screens */
    margin: auto; /* Center it horizontally when width is less than max-width */
}

/* State when the bot is open */
#ai-stylist-bot-container.open {
    height: calc(100vh - 40px); /* Take up most of the viewport height on mobile */
    max-height: 600px; /* Cap height on larger screens */
    opacity: 1;
}

/* Styles for the toggle button (the bot icon) */
#ai-stylist-bot-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10001;
    background-color: #6366f100; /* Fully opaque Indigo */
    color: white;
    border-radius: 50%;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease-in-out, background-color 0.3s ease-in-out, opacity 0.3s ease-in-out;
    opacity: 1; /* Ensure full opacity */
}


#ai-stylist-bot-toggle-btn:hover {
    transform: scale(1.1);
    background-color: #4f46e5; /* Darker indigo on hover */
}

/* Bot icon specific styling */
#ai-stylist-bot-toggle-btn .bot-icon {
    /* Ensures the SVG itself fits */
    width: 100%; 
    height: 100%;
    padding: 5px; /* Give some padding inside the circle */
}

/* NEW: Keyframe animations for bot behavior */
@keyframes idleBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); } /* Gentle bounce up */
}

@keyframes idleRotate {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(5deg); }
    75% { transform: rotate(-5deg); }
}

@keyframes idleFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* Apply idle animation */
#ai-stylist-bot-toggle-btn.animate-idle {
    animation: idleFloat 2s ease-in-out infinite alternate; /* Gentle floating */
}

/* Styles for the floating suggestion bubble */
.ai-stylist-suggestion-bubble {
    position: fixed;
    bottom: 90px; /* Position above the toggle button */
    right: 20px;
    z-index: 9999; /* Below toggle button, above other content */
    background-color: #fff;
    border: 1px solid #e0e7ff; /* Light indigo border */
    border-radius: 1rem;
    padding: 15px 20px;
    max-width: 300px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    opacity: 0;
    transform: translateY(20px); /* Start slightly below */
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    color: #4338ca; /* Darker indigo text */
    font-family: "Inter", sans-serif;
    position: relative; /* For dismiss button positioning */
}

.ai-stylist-suggestion-bubble.show {
    opacity: 1;
    transform: translateY(0);
}

.dismiss-suggestion-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    font-size: 1.2rem;
    color: #94a3b8; /* Gray color for dismiss button */
    position: absolute;
    top: 8px;
    right: 10px;
    transition: color 0.2s ease;
}

.dismiss-suggestion-btn:hover {
    color: #64748b; /* Darker gray on hover */
}


/* Specific styling for chat bubbles */
.chat-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 1.25rem; /* More rounded */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    line-height: 1.5;
}
.user-bubble {
    background-color: #6366f1; /* Indigo */
    color: white;
    margin-left: auto; /* Align right */
    border-bottom-right-radius: 0.5rem; /* Sharper corner on bottom right */
}
.ai-bubble {
    background-color: #e0e7ff; /* Light indigo */
    color: #4338ca; /* Darker indigo text */
    margin-right: auto; /* Align left */
    border-bottom-left-radius: 0.5rem; /* Sharper corner on bottom left */
}
/* Scrollbar styling */
#chat-messages::-webkit-scrollbar {
    width: 8px;
}
#chat-messages::-webkit-scrollbar-track {
    background: #f1f5f9; /* Light track */
    border-radius: 10px;
}
#chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1; /* Gray thumb */
    border-radius: 10px;
}
#chat-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8; /* Darker gray on hover */
}
/* Loading spinner */
.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #6366f1;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Mobile-specific adjustments (below 640px, Tailwind's 'sm' breakpoint) --- */
@media (max-width: 639px) {
    #ai-stylist-bot-container {
        bottom: 15px; /* Slightly smaller margin from bottom */
        right: 15px; /* Slightly smaller margin from right */
        left: 15px; /* Ensure it's not too wide on very small screens */
        max-width: unset; /* Remove max-width constraint for full mobile width */
        width: calc(100% - 30px); /* Take full width minus 15px padding on each side */
    }

    #ai-stylist-bot-container.open {
        height: calc(100vh - 30px); /* Adjust height for smaller bottom/right margins */
        max-height: unset; /* Allow full height on mobile */
    }

    #ai-stylist-bot-toggle-btn {
        bottom: 15px;
        right: 15px;
        width: 100px; /* Slightly smaller button */
        height: 100px;
        font-size: 1.5rem;
    }

    .ai-stylist-suggestion-bubble {
        bottom: 75px; /* Adjust position relative to smaller button */
        right: 15px;
        left: 15px;
        max-width: calc(100% - 30px); /* Max width for suggestion bubble on mobile */
        padding: 10px 15px; /* Smaller padding */
    }
    
    .ai-stylist-suggestion-bubble p {
        font-size: 0.875rem; /* text-sm for better fit */
    }

    .chat-bubble {
        max-width: 90%; /* Allow bubbles to take more width on mobile */
        padding: 10px 14px; /* Slightly smaller padding */
        border-radius: 1rem; /* Slightly less rounded for tighter fit */
        font-size: 0.9rem; /* Slightly smaller font for mobile readability */
    }
}


/*----------------------------------- himanshi --------------------------*/
#ai-stylist-bot-toggle-btn {
    /* Style the main button */
    background: transparent;
    border: none;
    cursor: pointer;
}

#ai-stylist-bot-toggle-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.secondary-buttons {
    display: flex;
    gap: 10px; /* Space between the buttons */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease; /* Smooth transition */
    animation: idleFloat 2s ease-in-out infinite alternate;
    position: absolute;
    bottom: 7.5rem;
    right: 0;
    transform: translateY(10px);
}

.ai-stylist-bot-wrapper {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}

.ai-stylist-bot-wrapper:hover .secondary-buttons {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.secondary-buttons button {
    /* Style for the 'Talk' and 'Chat' buttons */
    background-color: #ed1979;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap; /* Prevent text from wrapping */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Lock body scroll during modal */
body.modal-open { overflow: hidden; }

/* Overlay visibility helpers */
#talk-overlay.hidden { display: none; }
#talk-overlay { display: flex; }
