﻿/* Related Documents Message Bubble */
.related-documents-message .message-bubble {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

/* Related Documents Grid Layout */
.related-documents-grid {
    margin-top: 10px;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.related-grid-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 12px;
    font-size: 13px;
}

    .related-grid-header i {
        font-size: 14px;
        color: #ffffff;
    }

/* Responsive Grid System - Küçük Kartlar */
.related-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 8px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Card Wrapper - Küçük */
.related-card-wrapper {
    display: block;
    width: 100%;
    max-width: 110px;
    margin: 0 auto;
}

/* Card Link */
.related-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    width: 100%;
    height: 100%;
}

    .related-card-link:hover {
        text-decoration: none;
        color: inherit;
    }

/* Card Paper - Küçük Açık Gri Kart */
.related-card-paper {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #f8f9fa;
    padding: 8px;
    min-height: 80px;
    max-height: 100px;
    aspect-ratio: 1/1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
}

    .related-card-paper:hover {
        border-color: #adb5bd;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        transform: translateY(-1px);
        background: #e9ecef;
    }

/* FL Başharfleri (opsiyonel) */
.related-card-initials {
    font-size: 28px;
    font-weight: bold;
    color: #4DB3A4;
    text-align: center;
    margin: 5px 0;
    letter-spacing: 2px;
}

/* Card Title - Küçük */
.related-card-title {
    font-size: 10px;
    font-weight: 600;
    color: #495057;
    margin: 0 0 6px 0;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
    word-break: break-word;
}

.related-card-link:hover .related-card-title {
    color: #343a40;
}

/* Card Footer */
.related-card-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: auto;
}

.related-card-icon {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

    .related-card-icon img {
        width: 12px;
        height: 12px;
        border-radius: 2px;
        object-fit: cover;
    }

.related-card-text {
    color: #6c757d;
    font-size: 8px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60px;
}

/* Message bubble overflow kontrolü */
.message-bubble {
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
}

/* Chatbot genişliğine göre responsive ayarlar */
/* Geniş chatbot (600px+) - 4 kolon küçük kartlar */
.floating-chat .related-cards-grid {
    grid-template-columns: repeat(auto-fit, minmax(90px, 110px));
    justify-content: start;
}

/* Orta chatbot (450-600px) - 3 kolon sığmazsa 2'ye düş */
@media (max-width: 600px) {
    .floating-chat .related-cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        max-width: 100%;
    }
}

/* Dar chatbot için özel durumlar */
.floating-chat[style*="width: 500px"] .related-cards-grid,
.floating-chat[style*="width: 450px"] .related-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.floating-chat[style*="width: 400px"] .related-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.floating-chat[style*="width: 400px"] .related-card-paper {
    padding: 10px;
    min-height: 100px;
}

/* Çok dar chatbot (400px altı) - tek kolon */
.floating-chat[style*="width: 350px"] .related-cards-grid,
.floating-chat[style*="width: 300px"] .related-cards-grid {
    grid-template-columns: 1fr;
    gap: 8px;
}

.floating-chat[style*="width: 350px"] .related-card-paper,
.floating-chat[style*="width: 300px"] .related-card-paper {
    max-width: 200px;
    margin: 0 auto;
}

/* Mobile responsive - genel sayfa için */
@media (max-width: 768px) {
    .related-cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 8px;
    }

    .related-card-paper {
        min-height: 100px;
        padding: 10px;
    }

    .related-card-title {
        font-size: 11px;
    }

    .related-card-initials {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .related-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 320px) {
    .related-cards-grid {
        grid-template-columns: 1fr;
    }

    .related-card-wrapper {
        max-width: 150px;
    }
}

/* Animation for cards */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.related-card-wrapper {
    animation: fadeInUp 0.3s ease-out;
    animation-fill-mode: both;
}

    .related-card-wrapper:nth-child(1) {
        animation-delay: 0.1s;
    }

    .related-card-wrapper:nth-child(2) {
        animation-delay: 0.2s;
    }

    .related-card-wrapper:nth-child(3) {
        animation-delay: 0.3s;
    }


.chat-disclaimer {
    padding: 8px 12px;
    background: rgba(0,0,0,0.05);
    border-top: 1px solid rgba(0,0,0,0.1);
    font-size: 12px;
    color: #666;
    text-align: center;
    border-radius: 0 0 8px 8px;
}

    .chat-disclaimer i {
        margin-right: 5px;
        color: #999;
    }