/* Page-level styles */
.ai-assistant-container {
    min-height: 100vh;
    padding-top: 80px;
    display: flex;
    flex-direction: column;
    position: relative;
    opacity: 0;
    animation: fadeIn 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Chat Container */
.chat-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0.5rem auto;
    width: 95%;
}

.chat-header-info {
    text-align: center;
    padding: 2rem 0;
    margin-bottom: 1rem;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.header-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--text-primary);
    box-shadow: 0 8px 24px rgba(64, 224, 208, 0.3);
}

.header-text {
    flex: 1;
}

.header-text h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(120deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.header-text p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    line-height: 1.6;
}

/* Chat Interface */
.chat-interface {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px);
}

.chat-main {
    flex: 1;
    background: rgba(25, 30, 40, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(64, 224, 208, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
                0 0 0 1px rgba(64, 224, 208, 0.2),
                0 0 20px rgba(64, 224, 208, 0.1);
    animation: scaleIn 0.5s ease-out 0.3s backwards;
}

/* Chat Header */
.chat-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(to right, rgba(64, 224, 208, 0.1), transparent);
}

.chat-status {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.5rem 1rem;
    background: rgba(64, 224, 208, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(64, 224, 208, 0.2);
    transition: all 0.3s ease;
}

.status-dot {
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 10px rgba(64, 224, 208, 0.5);
}

.status-text {
    background: linear-gradient(120deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 500;
}

/* Action Buttons */
.chat-actions {
    display: flex;
    gap: 1rem;
}

.action-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(64, 224, 208, 0.1);
    color: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(64, 224, 208, 0.2);
    cursor: pointer;
}

.action-btn:hover {
    background: var(--accent-secondary);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(64, 224, 208, 0.2);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn i {
    font-size: 1.2rem;
}

/* Messages Container */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Message Styles */
.message {
    display: flex;
    gap: 1rem;
    opacity: 0;
    transform: translateY(20px);
    animation: messageAppear 0.5s ease-out forwards;
    width: fit-content;
    max-width: 70%;
    margin: 1rem 0;
}

@keyframes messageAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* User Message */
.message.user-message {
    flex-direction: row-reverse;
    margin-left: auto;
}

/* AI Message */
.message.ai-message {
    margin-right: auto;
}

.message-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(64, 224, 208, 0.2);
    flex-shrink: 0;
    align-self: flex-start;
}

.message-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 100%;
}

/* Message Bubbles */
.message-bubble {
    padding: 1.2rem 1.5rem;
    border-radius: 20px;
    color: var(--text-primary);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    width: fit-content;
    max-width: 100%;
}

/* AI Message Bubble */
.ai-message .message-bubble {
    border-bottom-left-radius: 6px;
    background: linear-gradient(135deg,
        rgba(64, 224, 208, 0.12),
        rgba(35, 40, 50, 0.98)
    );
    border: 1px solid rgba(64, 224, 208, 0.25);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2),
                inset 0 1px rgba(255, 255, 255, 0.1);
}

/* User Message Bubble */
.user-message .message-bubble {
    border-bottom-right-radius: 6px;
    background: linear-gradient(135deg,
        rgba(64, 224, 208, 0.25),
        rgba(64, 224, 208, 0.1)
    );
    border: 1px solid rgba(64, 224, 208, 0.35);
    margin-left: auto;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15),
                inset 0 1px rgba(255, 255, 255, 0.1);
}

.message-bubble:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}

/* Message Text */
.message-text {
    color: var(--text-primary);
}

.message-text p {
    margin: 0;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Markdown Content */
.markdown-content {
    line-height: 1.6;
}

.markdown-content p {
    margin: 0 0 1rem 0;
}

.markdown-content p:last-child {
    margin-bottom: 0;
}

.markdown-content ul,
.markdown-content ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

/* Code Formatting */
.message-bubble code {
    background: rgba(64, 224, 208, 0.08);
    padding: 0.2em 0.5em;
    border-radius: 4px;
    font-family: 'Fira Code', 'Cascadia Code', 'Source Code Pro', monospace;
    font-size: 0.92em;
    color: var(--accent-secondary);
    border: 1px solid rgba(64, 224, 208, 0.15);
}

.message-bubble pre {
    background: rgba(20, 25, 35, 0.95);
    padding: 1.2rem;
    border-radius: 12px;
    border: 1px solid rgba(64, 224, 208, 0.2);
    margin: 1.2rem 0;
    overflow-x: auto;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.message-bubble pre:first-child {
    margin-top: 0;
}

.message-bubble pre:last-child {
    margin-bottom: 0;
}

.message-bubble pre code {
    background: none;
    color: var(--text-primary);
    padding: 0;
    font-size: 0.9em;
    display: block;
    width: 100%;
    border: none;
    line-height: 1.6;
    tab-size: 4;
}

/* Scrollbar for code blocks */
.message-bubble pre::-webkit-scrollbar {
    height: 6px;
}

.message-bubble pre::-webkit-scrollbar-track {
    background: rgba(30, 35, 45, 0.6);
    border-radius: 3px;
}

.message-bubble pre::-webkit-scrollbar-thumb {
    background: var(--accent-secondary);
    border-radius: 3px;
}

/* Chat Input */
.chat-input {
    padding: 1.5rem;
    background: rgba(30, 35, 45, 0.95);
    border-top: 1px solid rgba(64, 224, 208, 0.2);
    backdrop-filter: blur(10px);
}

.input-form {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.input-wrapper {
position: relative;
flex: 1;
display: flex;
align-items: flex-start;
gap: 0.75rem;
}

.input-form textarea {
width: calc(100% - 65px);
min-height: 54px;
padding: 1rem 1.2rem;
    background: rgba(45, 50, 60, 0.6);
    border: 2px solid rgba(64, 224, 208, 0.25);
    border-radius: 16px;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.5;
    resize: none;
    transition: all 0.3s ease;
    font-family: inherit;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.input-form textarea:focus {
    outline: none;
    border-color: var(--accent-secondary);
    background: rgba(45, 50, 60, 0.75);
    box-shadow: 0 0 0 3px rgba(64, 224, 208, 0.15),
                inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.input-form textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.send-button {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    min-width: 54px;
    height: 54px;
    border-radius: 16px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 1.2rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    flex-shrink: 0;
    position: absolute;
    right: 0;
    bottom: 0;
}

.send-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(64, 224, 208, 0.3);
}

.send-button:active {
    transform: translateY(0) scale(0.95);
}

.send-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(30, 35, 45, 0.6);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--accent-secondary);
    border-radius: 3px;
}

/* Animations */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .chat-container {
        width: 100%;
        padding: 0.5rem;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .header-text h1 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .chat-interface {
        height: calc(100vh - 80px);
    }

    .message {
        max-width: 85%;
    }

    .chat-header-info {
        padding: 1.5rem;
    }

    .header-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }

    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .chat-input {
        padding: 1rem;
    }

    .input-form textarea {
        font-size: 1rem;
        min-height: 48px;
        padding: 0.8rem 1rem;
    }

    .send-button {
        min-width: 48px;
        height: 48px;
    }
}

@media (max-width: 480px) {
    .message {
        max-width: 90%;
    }

    .message-bubble {
        padding: 0.8rem 1rem;
    }

    .chat-header {
        padding: 1rem;
    }

    .chat-status {
        padding: 0.4rem 0.8rem;
    }

    .action-btn {
        width: 36px;
        height: 36px;
    }
}
