/* Aida Copilot Panel - Windows Copilot Dark Theme */

:root {
    --copilot-bg: rgba(32, 32, 32, 0.85);
    /* Dark Acrylic */
    --copilot-bg-secondary: #2b2b2b;
    --copilot-accent: #60cdff;
    /* Light blue accent */
    --copilot-text: #ffffff;
    --copilot-text-secondary: #d1d1d1;
    --copilot-border: rgba(255, 255, 255, 0.1);
    --copilot-input-bg: #1f1f1f;
    --copilot-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    /* Windows 11 Font Stack */
    --font-stack: 'Segoe UI Variable Text', 'Segoe UI', 'Helvetica Neue', sans-serif;
    --font-display: 'Segoe UI Variable Display', 'Segoe UI', sans-serif;
    --font-size-base: 14px;
}


.aida-copilot-panel {
    position: fixed;
    top: 60px;
    right: 0;
    left: auto;
    bottom: 0;
    width: 400px;
    /* Darker but transparent for contrast */
    background: rgba(18, 32, 50, 0.65);
    /* More transparent + Blue tint */
    backdrop-filter: blur(40px);
    /* Heavy Blur like Mica */
    -webkit-backdrop-filter: blur(40px);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.4);
    z-index: 20000;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.1, 0.9, 0.2, 1);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    /* Subtle border */
    font-family: var(--font-stack);
    font-size: var(--font-size-base);
    color: var(--copilot-text);
    -webkit-font-smoothing: antialiased;
}

.aida-copilot-panel.is-open {
    transform: translateX(0);
}

/* Background Flower Decoration (Optional matches visual) */
.aida-copilot-panel::before {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 40%;
    background: url('https://images.unsplash.com/photo-1490750967868-58cb75062ed0?auto=format&fit=crop&w=600&q=80') no-repeat bottom right;
    background-size: cover;
    opacity: 0.05;
    /* Even more subtle */
    pointer-events: none;
    z-index: -1;
    mask-image: linear-gradient(to top, black, transparent);
    -webkit-mask-image: linear-gradient(to top, black, transparent);
}

/* Header */
.aida-header {
    padding: 24px 24px 12px 24px;
    /* More top padding */
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    z-index: 2;
}

.aida-header-title {
    font-size: 1.1em;
    /* 18px approx */
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--copilot-text);
    font-family: var(--font-display);
    flex: 1;
    min-width: 0;
    /* Allow shrinking */
    margin-right: 8px;
}

.aida-header-icon {
    /* Removed box background, just icon */
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #60cdff;
    flex-shrink: 0;
}

.aida-header-btn {
    background: transparent;
    border: none;
    color: var(--copilot-text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.1s;
}

.aida-header-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.aida-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    /* Prevent buttons from squishing */
}

/* Chat History */
.aida-chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    scroll-behavior: smooth;
    background: transparent;
    /* To allow content to be centered initially */
    justify-content: center;
}

.aida-chat-history::-webkit-scrollbar {
    width: 6px;
}

.aida-chat-history::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.aida-chat-history::-webkit-scrollbar-track {
    background: transparent;
}

/* Greeting State (New) */
.aida-greeting {
    text-align: center;
    padding: 20px;
    animation: fadeIn 0.5s ease-out;
    margin-bottom: 20px;
}

.aida-header-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    min-width: 0;
    /* Enable shrinking */
    flex: 1;
}

.aida-title-main {
    font-size: 1.1em;
    white-space: nowrap;
}

.aida-title-sub {
    font-size: 0.65em;
    font-weight: 300;
    opacity: 0.6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aida-greeting h2 {
    font-size: 28px;
    font-family: var(--font-display);
    font-weight: 600;
    margin-bottom: 12px;
    color: white;
    letter-spacing: -0.5px;
}

.aida-greeting p {
    font-size: 15px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.8);
    font-family: var(--font-stack);
}

.aida-message {
    max-width: 90%;
    padding: 0;
    /* Removing padding from container to use logical text blocks like reference */
    border-radius: 0;
    font-size: 14px;
    line-height: 1.6;
    position: relative;
    animation: slideIn 0.2s ease-out forwards;
    background: transparent;
    border: none;
    color: var(--copilot-text);
}

.aida-message.user {
    align-self: flex-end;
    background: #2D2D2D;
    /* Dark grey bubble */
    padding: 10px 16px;
    border-radius: 18px;
    border-bottom-right-radius: 4px;
    margin-left: 20%;
}

.aida-message.system {
    align-self: flex-start;
    padding: 0;
    /* System messages are often just text in Copilot */
    background: transparent;
    border: none;
    backdrop-filter: none;
}

.aida-message-timestamp {
    font-size: 0.7em;
    margin-top: 4px;
    opacity: 0.5;
    text-align: right;
}

/* Input Area - Recreated from Screenshot */
.aida-input-area {
    padding: 20px;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Initial Center Container (Wraps Input + Suggestions) */
.aida-center-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 96%;
    /* Wider */
    margin: 0 auto;
    position: relative;
    /* Anchor for absolute suggestions */
}

/* Quick Actions Chips */
.aida-quick-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    padding-top: 20px;
    /* Space from input */
    pointer-events: auto;
}

/* In-Chat Choice Chips (Smart Replies) */
.aida-chat-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.aida-choice-chip {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--copilot-text);
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s;
}

.aida-choice-chip:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.aida-action-chip {
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(50, 50, 50, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--copilot-text);
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(5px);
}

.aida-action-chip:hover {
    background: rgba(70, 70, 70, 0.8);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Main Input Box Container */
.aida-input-container {
    order: 1;
    /* Above suggestions */
    background: rgba(30, 30, 30, 0.8);
    /* border: 1px solid rgba(255, 255, 255, 0.15); REMOVED per user request */
    border: none;
    border-radius: 32px;
    /* More Round */
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    transition: border-color 0.2s, background 0.2s;
    position: relative;
}

.aida-input-container.drag-over {
    border-color: var(--copilot-accent);
    background: rgba(40, 50, 70, 0.9);
    box-shadow: 0 0 0 2px rgba(96, 205, 255, 0.3);
}

.aida-input-container.drag-over::after {
    content: 'Drop image here for style matching';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(30, 30, 30, 0.8);
    /* Overlay */
    color: white;
    font-weight: 600;
    border-radius: 32px;
    backdrop-filter: blur(4px);
    z-index: 10;
    pointer-events: none;
}

/* Image Preview */
.aida-image-preview {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    overflow-x: auto;
}

.aida-preview-item {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.aida-preview-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    background: #ff4d4d;
    color: white;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}


.aida-input-header {
    font-size: 0.9em;
    color: var(--copilot-text-secondary);
    margin-bottom: 4px;
    padding-left: 4px;
}

.aida-input-field {
    background: transparent;
    border: none;
    color: white;
    font-family: inherit;
    font-size: 1em;
    resize: none;
    outline: none;
    min-height: 24px;
    max-height: 150px;
    padding: 0 4px;
}

.aida-input-field::-webkit-scrollbar {
    width: 6px;
}

.aida-input-field::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.aida-input-field::-webkit-scrollbar-track {
    background: transparent;
}

.aida-input-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    padding-left: 4px;
    padding-right: 4px;
}

.aida-tools-right {
    display: flex;
    gap: 2px;
}

.aida-input-tools {
    display: flex;
    gap: 12px;
}

.aida-tool-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--copilot-text-secondary);
    padding: 6px 8px;
    font-size: 0.85em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.aida-tool-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Specific Style for Design Idea Button */
/* Specific Style for Design Idea Button */
.aida-tool-btn[data-action="smart"] {
    border-radius: 99px;
    /* Pill shape */
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* Only show on hover per request */
    color: white;
    padding: 2px 10px;
    /* even smaller padding */
    font-size: 0.75em;
    /* even smaller font */
    margin-right: 4px;
    /* spacing */
}

.aida-tool-btn[data-action="smart"]:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.aida-send-btn {
    background: var(--copilot-accent);
    color: black;
    border: none;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.aida-send-btn:hover {
    transform: scale(1.05);
}

.aida-send-btn:disabled {
    background: #444;
    color: #888;
    cursor: not-allowed;
}


/* Toggle Button */
.aida-toggle-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    /* Colorful gradient from logo */
    background: conic-gradient(from 180deg at 50% 50%, #D95040 0deg, #F2C437 78deg, #58A55C 180deg, #4687F0 270deg, #D95040 360deg);
    border: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    z-index: 19999;
    padding: 2px;
    /* For border effect */
    transition: transform 0.2s;
    animation: aidaBreath 3s ease-in-out infinite;
}

@keyframes aidaBreath {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    }

    50% {
        transform: scale(1.1);
        box-shadow: 0 8px 24px rgba(96, 205, 255, 0.4);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    }
}

.aida-toggle-btn-inner {
    width: 100%;
    height: 100%;
    background: #222;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.aida-toggle-btn:hover {
    transform: scale(1.1);
}

/* Mobile */
@media (max-width: 480px) {
    .aida-copilot-panel {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
}

/* Loading Animation for Header Icon */
@keyframes aida-blur-pulse {
    0% {
        filter: blur(0px);
        opacity: 1;
    }

    50% {
        filter: blur(2px);
        opacity: 0.5;
    }

    100% {
        filter: blur(0px);
        opacity: 1;
    }
}

.aida-header-icon.aida-loading {
    animation: aida-blur-pulse 1.2s infinite ease-in-out;
}

/* Product Card Styles */
.aida-product-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 8px;
    gap: 12px;
}

.aida-product-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(96, 205, 255, 0.4);
    transform: translateY(-2px);
}

.aida-product-image {
    width: 60px;
    height: 60px;
    background-color: #333;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    flex-shrink: 0;
}

.aida-product-content {
    flex: 1;
    min-width: 0;
    /* Allow text truncate */
}

.aida-product-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--copilot-text);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aida-product-manufacturer {
    font-size: 0.75rem;
    color: var(--copilot-text-dim);
    margin-bottom: 2px;
    opacity: 0.7;
}

.aida-product-price {
    font-size: 0.8rem;
    color: var(--copilot-accent);
}

/* Typing Indicator — Animated Bouncing Dots */
.aida-typing {
    display: flex;
    align-items: center;
    padding: 8px 0;
}

.aida-typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 18px;
}

.aida-dot {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: aidaDotBounce 1.4s ease-in-out infinite;
}

.aida-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.aida-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes aidaDotBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}