/* Logo Chat Styles - Shared between index page and dashboard */

/* Chat Container for Dashboard */
.logo-chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 64px - 48px);
    min-height: 500px;
    background-color: var(--gray-900);
    border-radius: 16px;
    overflow: hidden;
}

/* Chat Header */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-800);
    flex-shrink: 0;
    background: var(--gray-900);
    z-index: 10;
}

.chat-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
}

.chat-header-title svg {
    width: 20px;
    height: 20px;
    color: var(--brand-500);
}

.chat-close {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--gray-400);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chat-close:hover {
    background: var(--gray-800);
    color: #ffffff;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
}

.chat-messages > .chat-message:first-child,
.chat-messages > .chat-images:first-child,
.chat-messages > .chat-images-wrapper:first-child,
.chat-messages > .typing-indicator:first-child {
    margin-top: auto;
}

.chat-message {
    display: flex;
    gap: 12px;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.user {
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--gray-800);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.chat-message.user .chat-avatar {
    background: var(--brand-600);
}

.chat-avatar svg {
    width: 18px;
    height: 18px;
    color: var(--gray-400);
}

.chat-message.user .chat-avatar svg {
    color: #ffffff;
}

.chat-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.chat-message.assistant .chat-bubble {
    background: var(--gray-800);
    color: var(--gray-200);
    border-bottom-left-radius: 4px;
}

.chat-message.user .chat-bubble {
    background: var(--brand-600);
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

/* Chat Input Area */
.chat-input-area {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-800);
    display: flex;
    gap: 12px;
    flex-shrink: 0;
    background: var(--gray-900);
}

.chat-input {
    flex: 1;
    background: var(--gray-800);
    border: 1px solid var(--gray-700);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    color: #ffffff;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: var(--brand-500);
}

.chat-input::placeholder {
    color: var(--gray-500);
}

.chat-send {
    width: 44px;
    height: 44px;
    background: var(--brand-600);
    border: none;
    border-radius: 12px;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chat-send:hover {
    background: var(--brand-500);
}

.chat-send:disabled {
    background: var(--gray-700);
    cursor: not-allowed;
}

.chat-input:disabled {
    background: var(--gray-900);
    color: var(--gray-600);
    cursor: not-allowed;
}

/* Completed State */
.chat-input-area.completed {
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.chat-input-area.completed .chat-input,
.chat-input-area.completed .chat-send {
    display: none;
}

.chat-new-button {
    width: 100%;
    padding: 14px 24px;
    background: var(--brand-600);
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.chat-new-button:hover {
    background: var(--brand-500);
    transform: translateY(-1px);
}

.chat-new-button svg {
    width: 18px;
    height: 18px;
}

/* History Link */
.history-link {
    color: var(--brand-500);
    text-decoration: none;
    font-weight: 500;
}

.history-link:hover {
    text-decoration: underline;
}

/* Generated Images in Chat */
.chat-images-wrapper {
    display: flex;
    gap: 12px;
    animation: fadeInUp 0.3s ease;
}

.chat-images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 16px;
    background: var(--gray-800);
    border-radius: 16px;
    flex: 1;
}

.chat-image-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    background: var(--gray-700);
    cursor: pointer;
    transition: transform 0.2s;
}

.chat-image-item:hover {
    transform: scale(1.02);
}

.chat-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-image-item.loading {
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-image-item.locked {
    cursor: pointer;
}

.chat-image-item.locked img {
    filter: blur(12px);
}

.chat-image-lock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.chat-image-lock-overlay svg {
    width: 32px;
    height: 32px;
    color: #ffffff;
}

.chat-image-lock-overlay span {
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
}

/* Watermark Remove Link */
.watermark-remove-link {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    color: var(--brand-400);
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.watermark-remove-link:hover {
    background: rgba(249, 115, 22, 0.9);
    color: #ffffff;
}

.watermark-remove-link svg {
    flex-shrink: 0;
}

/* Spinner */
.chat-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--gray-600);
    border-top-color: var(--brand-500);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: var(--gray-800);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--gray-500);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

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

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* Suggestions */
.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 20px 16px;
}

.suggestion-chip {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--gray-800);
    border-radius: 100px;
    font-size: 13px;
    color: var(--gray-400);
    cursor: pointer;
    transition: all 0.2s;
}

.suggestion-chip:hover {
    background: rgba(249, 115, 22, 0.1);
    border-color: var(--brand-600);
    color: var(--brand-400);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .logo-chat-container {
        height: calc(100vh - 64px - 32px);
        min-height: 400px;
        border-radius: 12px;
    }

    .chat-messages {
        padding: 16px;
        gap: 12px;
    }

    .chat-images {
        grid-template-columns: repeat(2, 1fr);
        padding: 12px;
        gap: 8px;
    }

    .chat-input-area {
        padding: 12px 16px;
    }

    .chat-header {
        padding: 12px 16px;
    }

    .chat-suggestions {
        padding: 0 16px 12px;
    }
}
