﻿/* Minecraft AI Assistant CSS */

/* Code Block Styles */
.code-block {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 6px;
    font-family: 'Noto Sans Mono', monospace;
    white-space: pre-wrap;
    overflow-x: auto;
    margin: 10px 0;
    border-left: 3px solid var(--minecraft-green);
}

code {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 2px 5px;
    border-radius: 4px;
    font-family: 'Noto Sans Mono', monospace;
    font-size: 0.9em;
}

/* Minecraft-style button animations */
.minecraft-btn {
    position: relative;
    overflow: hidden;
}

.minecraft-btn::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.minecraft-btn:hover::after {
    left: 100%;
}

/* Pixel border animation for chat container */
.chat-container {
    position: relative;
}

.chat-container::before {
    content: "";
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(90deg, var(--minecraft-green), #3aa129, var(--minecraft-green));
    z-index: -1;
    opacity: 0.5;
    border-radius: 10px;
    animation: border-glow 3s infinite linear;
}

@keyframes border-glow {
    0% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.6;
    }
    100% {
        opacity: 0.3;
    }
}

/* Message animations */
.user-message {
    transform-origin: right bottom;
    animation: user-message-appear 0.3s ease-out;
}

.assistant-message {
    transform-origin: left bottom;
    animation: assistant-message-appear 0.3s ease-out;
}

@keyframes user-message-appear {
    from {
        opacity: 0;
        transform: translateX(20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes assistant-message-appear {
    from {
        opacity: 0;
        transform: translateX(-20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* Minecraft-style scrollbar */
.chat-messages::-webkit-scrollbar {
    width: 12px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background-color: var(--minecraft-green);
    border-radius: 6px;
    border: 2px solid rgba(0, 0, 0, 0.2);
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background-color: #3aa129;
}

/* Typing indicator and progress bar */
.typing-indicator {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 15px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 12px 12px 12px 0;
    width: fit-content;
}

.typing-text {
    font-size: 0.85rem;
    color: var(--minecraft-green);
    font-weight: 500;
}

.progress-container {
    width: 180px;
    height: 10px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(68, 189, 50, 0.3);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--minecraft-green), #5d7, var(--minecraft-green));
    background-size: 200% 100%;
    animation: progress-animation 1.5s ease-in-out infinite;
    border-radius: 5px;
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
}

@keyframes progress-animation {
    0% {
        width: 0%;
        background-position: 0% 50%;
    }
    50% {
        width: 70%;
        background-position: 100% 50%;
    }
    100% {
        width: 95%;
        background-position: 0% 50%;
    }
}

/* 禁用状态的发送按钮 */
.send-button:disabled {
    background-color: #888;
    cursor: not-allowed;
    transform: none;
    opacity: 0.7;
}

.send-button:disabled:hover {
    background-color: #888;
    transform: none;
}

/* Pixel art decorations */
.assistant-info-section::before {
    content: "";
    display: block;
    height: 4px;
    background: repeating-linear-gradient(
        to right,
        var(--minecraft-green) 0px,
        var(--minecraft-green) 8px,
        transparent 8px,
        transparent 16px
    );
    margin-bottom: 20px;
    border-radius: 2px;
}

/* Responsive improvements */
@media (max-width: 480px) {
    .assistant-header {
        padding: 10px;
    }
    
    .assistant-avatar {
        width: 40px;
        height: 40px;
    }
    
    .assistant-details h2 {
        font-size: 1rem;
    }
    
    .model-badge {
        font-size: 0.7rem;
        padding: 2px 6px;
    }
    
    .chat-container {
        height: 350px;
    }
    
    .message-avatar {
        width: 30px;
        height: 30px;
    }
    
    .message-bubble {
        padding: 10px;
    }
    
    .message-bubble p {
        font-size: 0.9rem;
    }
    
    .progress-container {
        width: 140px;
    }
}

/* Dark mode enhancements */
@media (prefers-color-scheme: dark) {
    .assistant-container {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    }
    
    .message-bubble {
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    }
    
    .user-message .message-bubble {
        background-color: #3aa129;
    }
    
    .assistant-message .message-bubble {
        background-color: rgba(30, 30, 30, 0.8);
    }
}

/* Minecraft block decoration */
.grass-block-decoration {
    position: absolute;
    width: 32px;
    height: 32px;
    background-color: #44BD32;
    border: 2px solid #000;
    z-index: 1;
    image-rendering: pixelated;
    transform: rotate(15deg);
    opacity: 0.7;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.3);
    display: none; /* Hidden by default, shown on larger screens */
}

.grass-block-decoration::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 30%;
    background-color: #8BC34A;
}

@media (min-width: 992px) {
    .grass-block-decoration {
        display: block;
    }
    
    .grass-block-decoration:nth-child(1) {
        top: -16px;
        right: 50px;
    }
    
    .grass-block-decoration:nth-child(2) {
        bottom: -16px;
        left: 30px;
        transform: rotate(-10deg);
    }
}

/* Related Tools Section */
.related-tools-section {
    background: var(--minecraft-panel);
    padding: 2rem;
    margin: 2rem auto;
    border: 2px solid var(--minecraft-secondary);
    border-radius: 8px;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    max-width: 1400px;
    width: 100%;
}

.related-tools-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAEklEQVQImWNgYGD4z8DAwMAAADgDAKdD8tMAAAAASUVORK5CYII=');
    background-size: 2px 2px;
    opacity: 0.05;
    z-index: 0;
    pointer-events: none;
}

.related-tools-section h2 {
    color: var(--minecraft-green);
    margin-bottom: 0.5rem;
    text-align: center;
    font-size: 1.8rem;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 1;
}

.related-tools-subtitle {
    text-align: center;
    color: #AAAAAA;
    margin-bottom: 2rem;
    font-size: 1rem;
    position: relative;
    z-index: 1;
}

.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

.related-tool-card {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--minecraft-secondary);
    border-radius: 6px;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.related-tool-card:hover {
    transform: translateY(-3px);
    border-color: var(--minecraft-green);
    background: rgba(68, 189, 50, 0.1);
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.4), 0 0 20px rgba(68, 189, 50, 0.3);
}

.related-tool-card .tool-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.related-tool-card:hover .tool-icon {
    transform: scale(1.1);
}

.related-tool-card h3 {
    color: var(--minecraft-green);
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
}

.related-tool-card p {
    color: #E0E0E0;
    line-height: 1.5;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.relation-tag {
    background: linear-gradient(45deg, var(--minecraft-green), var(--minecraft-secondary));
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* 鍝嶅簲寮忚璁?*/
@media (max-width: 768px) {
    .related-tools-section {
        padding: 1.5rem;
        margin: 1.5rem 0;
    }
    
    .related-tools-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .related-tool-card {
        padding: 1.2rem;
    }
    
    .related-tool-card .tool-icon {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .related-tools-grid {
        grid-template-columns: 1fr;
    }
    
    .related-tools-section h2 {
        font-size: 1.5rem;
    }
}/* 响应式设计 */
@media (max-width: 768px) {
    .related-tools-section {
        margin: 2rem auto;
        padding: 1.5rem;
    }
    
    .related-tools-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .related-tool-card {
        padding: 1rem;
    }
}
