/* AI Assistant Specific Styles */
.ai-header {
    text-align: center;
    margin: 100px 0 40px 0;
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.ai-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.ai-header p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.ai-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
    margin: 40px 0;
    min-height: 600px;
}

/* Sidebar Styles */
.ai-sidebar {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.ai-sidebar h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.model-info {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.model-details p {
    margin: 8px 0;
    font-size: 0.9rem;
    color: #6b7280;
}

.model-details strong {
    color: var(--text-color);
}

.quick-prompts {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.prompt-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.prompt-btn {
    background: #f3f4f6;
    border: none;
    padding: 12px 15px;
    border-radius: 8px;
    text-align: left;
    font-size: 0.9rem;
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
    line-height: 1.4;
}

.prompt-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(5px);
}

.usage-stats .stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: #f8fafc;
    border-radius: 10px;
}

.stat-number {
    display: block;
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.85rem;
    color: #6b7280;
}

/* Chat Styles */
.ai-chat {
    background: var(--card-bg);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: 600px;
}

.chat-messages {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.message {
    display: flex;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.2rem;
}

.message.assistant .message-avatar {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.message.user .message-avatar {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.message-content {
    background: #f8fafc;
    padding: 15px 20px;
    border-radius: 15px;
    max-width: 70%;
    word-wrap: break-word;
    line-height: 1.6;
}

.message.user .message-content {
    background: var(--primary-color);
    color: white;
}

.message.assistant .message-content {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.message-content pre {
    background: #1f2937;
    color: #f9fafb;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
}

.message-content code {
    background: #e5e7eb;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
}

.message.user .message-content code {
    background: rgba(255, 255, 255, 0.2);
    color: inherit;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background: #f8fafc;
    border-radius: 15px;
    max-width: 70%;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9ca3af;
    animation: typing 1.5s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

/* Chat Input */
.chat-input-container {
    padding: 20px 25px;
    border-top: 1px solid #e5e7eb;
    background: #fafafa;
    border-radius: 0 0 15px 15px;
}

.input-group {
    position: relative;
}

#userInput {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 15px 20px;
    font-size: 1rem;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: var(--transition);
    background: white;
}

#userInput:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.char-count {
    font-size: 0.85rem;
    color: #6b7280;
}

.action-btn {
    background: #f3f4f6;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    color: #6b7280;
    cursor: pointer;
    transition: var(--transition);
    margin-right: 10px;
}

.action-btn:hover {
    background: #e5e7eb;
    color: var(--text-color);
}

.send-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.send-btn:hover:not(:disabled) {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.send-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.send-btn.loading {
    background: #9ca3af;
    cursor: not-allowed;
}

.send-btn.loading i {
    animation: spin 1s linear infinite;
}

/* Features Grid */
.ai-features {
    margin: 60px 0;
}

.ai-features h2 {
    text-align: center;
    margin-bottom: 40px;
    color: var(--text-color);
    font-size: 2rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.feature-card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.feature-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.feature-card h3 {
    margin-bottom: 10px;
    color: var(--text-color);
}

.feature-card p {
    color: #6b7280;
    line-height: 1.6;
}

/* AI Highlight Styles for main page */
.ai-highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.ai-highlight::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 25%, transparent 25%), 
                linear-gradient(-45deg, rgba(255,255,255,0.1) 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.1) 75%), 
                linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.1) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    opacity: 0.1;
    animation: float 20s infinite linear;
}

.ai-highlight .tool-content {
    position: relative;
    z-index: 1;
}

.ai-highlight h3 {
    color: white;
}

.ai-highlight p {
    color: rgba(255, 255, 255, 0.9);
}

.ai-highlight .tag {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.ai-highlight .tool-link {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.ai-highlight .tool-link:hover {
    background: white;
    color: var(--primary-color);
    transform: translateY(-3px);
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes float {
    0% {
        background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    }
    100% {
        background-position: 20px 20px, 20px 30px, 30px 10px, 10px 20px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .ai-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .ai-sidebar {
        position: static;
        order: 2;
    }
    
    .ai-chat {
        order: 1;
        height: 500px;
    }
    
    .ai-header h1 {
        font-size: 2rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .message-content {
        max-width: 85%;
    }
}

@media (max-width: 480px) {
    .ai-header {
        margin: 80px 0 20px 0;
        padding: 30px 15px;
    }
    
    .ai-header h1 {
        font-size: 1.8rem;
    }
    
    .ai-sidebar {
        padding: 20px;
    }
    
    .chat-messages {
        padding: 20px;
    }
    
    .chat-input-container {
        padding: 15px 20px;
    }
}
