/* AI Assistant Page Styles */

.ai-assistant-section {
    padding: 40px 0 80px;
    min-height: calc(100vh - 400px);
}

.ai-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Sidebar Styles */
.ai-sidebar {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.ai-sidebar h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 30px;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    text-align: left;
}

.quick-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.action-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.action-text {
    flex: 1;
    font-weight: 500;
}

.ai-tips {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
}

.ai-tips h4 {
    font-size: 0.95rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.ai-tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ai-tips li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
}

.ai-tips li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

.clear-chat-btn {
    width: 100%;
    padding: 12px;
    background: rgba(255, 59, 48, 0.1);
    border: 1px solid rgba(255, 59, 48, 0.3);
    border-radius: 12px;
    color: #ff3b30;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.clear-chat-btn:hover {
    background: rgba(255, 59, 48, 0.2);
    border-color: rgba(255, 59, 48, 0.5);
}

/* Chat Container Styles */
.ai-chat-container {
    background: var(--card-bg);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    height: 700px;
    overflow: hidden;
}

.chat-header {
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
}

.chat-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #34c759;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.status-text {
    font-weight: 600;
    color: var(--text-primary);
}

.chat-info .info-icon {
    font-size: 1.2rem;
    cursor: help;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.chat-info .info-icon:hover {
    opacity: 1;
}

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

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.message {
    display: flex;
    gap: 15px;
    animation: messageSlide 0.3s ease;
}

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

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

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.user-message .message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.message-content {
    flex: 1;
    max-width: 80%;
}

.message-text {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px 20px;
    border-radius: 16px;
    color: var(--text-primary);
    line-height: 1.6;
}

.user-message .message-text {
    background: var(--gradient);
    color: white;
}

.message-text p {
    margin: 0 0 10px 0;
}

.message-text p:last-child {
    margin-bottom: 0;
}

.message-text ul, .message-text ol {
    margin: 10px 0;
    padding-left: 20px;
}

.message-text li {
    margin: 5px 0;
}

.message-text code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.message-text pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 10px 0;
}

.message-text pre code {
    background: none;
    padding: 0;
}

.message-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 5px;
    opacity: 0.7;
}

.user-message .message-time {
    text-align: right;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 15px 25px;
    align-items: center;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Chat Input */
.chat-input-container {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
}

.chat-input-form {
    display: flex;
    gap: 15px;
    padding: 20px 25px;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    resize: none;
    max-height: 120px;
    transition: all 0.3s ease;
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.08);
}

.chat-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.send-btn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--gradient);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(var(--primary-rgb), 0.4);
}

.send-btn:active {
    transform: scale(0.95);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.send-icon {
    font-size: 1.3rem;
}

.input-hint {
    padding: 0 25px 15px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .ai-container {
        grid-template-columns: 1fr;
    }

    .ai-sidebar {
        position: static;
        order: 2;
    }

    .ai-chat-container {
        order: 1;
    }
}

@media (max-width: 768px) {
    .ai-assistant-section {
        padding: 20px 0 40px;
    }

    .ai-container {
        gap: 20px;
    }

    .ai-sidebar {
        padding: 20px;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .ai-chat-container {
        height: 600px;
    }

    .chat-messages {
        padding: 15px;
    }

    .message-content {
        max-width: 90%;
    }

    .chat-input-form {
        padding: 15px;
    }

    .message-text {
        padding: 12px 15px;
    }
}

@media (max-width: 480px) {
    .ai-chat-container {
        height: 500px;
        border-radius: 15px;
    }

    .chat-header {
        padding: 15px;
    }

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

    .message-avatar {
        width: 35px;
        height: 35px;
        font-size: 1.1rem;
    }

    .message-text {
        font-size: 0.9rem;
        padding: 10px 12px;
    }

    .quick-action-btn {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .action-icon {
        font-size: 1.1rem;
    }
}
