/* Card-specific styling extracted from knowledge-canvas.js */

.card.input-derived-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 12px;
    box-sizing: border-box;
    transform: translateZ(0);
    background-color: var(--kc-card-bg, #ffffff);
}

.card.input-derived-card .card-main-content {
    flex-grow: 1;
    min-height: 0;
    width: 100%;
    box-sizing: border-box;
    padding: 0;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    overflow: hidden;
    cursor: auto; /* Override move cursor to indicate text selection/interaction */
}

.card.input-derived-card a {
    cursor: pointer;
}

.card.input-derived-card.tool-chat-card .card-main-content {
    overflow-y: auto;
    padding-right: 4px; /* keep scrollbar off text */
}

.card.input-derived-card .card-main-content::-webkit-scrollbar {
    width: 6px;
}

.card.input-derived-card .card-main-content::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.4);
    border-radius: 999px;
}

.card.input-derived-card .card-main-content > .chat-bubble {
    margin-right: 0;
}

.chat-input-container {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 0;
    margin: 0;
    pointer-events: auto;
    cursor: auto;
}

.chat-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.chat-input-tool-typing {
    background-color: #f9fafc;
    font-style: italic;
}

.card.input-derived-card .chat-input-row textarea.chat-input {
    width: 100%;
    flex: 1 1 auto;
}

.card.input-derived-card .chat-input {
    border: none;
    border-radius: 12px;
    padding: 12px 40px 12px 16px;
    font-size: 0.95rem;
    line-height: 1.35;
    min-height: 52px;
    background: rgba(248, 250, 252, 0.7);
    color: #334155;
}

.card.input-derived-card .chat-input:focus {
    border: none;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.18);
    background: #fff;
}

.chat-send-icon {
    cursor: pointer;
    color: #888;
    padding: 8px 12px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s ease, color 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.chat-send-icon:hover {
    background: #f3f4f6;
}

.chat-send-icon:active,
.chat-send-icon.touch-active {
    background: #e5e7eb;
}

.card-text-preview {
    font-size: 0.8em;
    color: #666;
    margin: 0;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.card-text-preview ul,
.card-text-preview ol {
    padding-left: 20px;
    margin-bottom: 0.5em;
}

.card-text-preview li {
    margin-bottom: 0.25em;
}

.card-text-preview p {
    margin-bottom: 0.5em;
}

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

.card-text-preview h1,
.card-text-preview h2,
.card-text-preview h3,
.card-text-preview h4 {
    font-size: 1.1em;
    margin: 0.5em 0 0.25em;
    font-weight: 600;
}

.card-text-preview--rich img {
    max-width: 150px;
    max-height: 100px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 4px 0;
}

.card-image-container {
    width: 100%;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.card-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.card-image-placeholder {
    font-size: 0.85em;
    color: #666;
    text-align: center;
}

.card-image-placeholder.error {
    color: #b91c1c;
    font-weight: 500;
}

.card-file-name {
    font-size: 0.9em;
    font-weight: 600;
    color: #222;
    margin-bottom: 6px;
}

.card-file-download-btn {
    display: inline-block;
    font-size: 0.8em;
    padding: 6px 10px;
    background: #1f6feb;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.card-video-thumb {
    width: 100%;
    border-radius: 4px;
    margin-bottom: 8px;
}

.card-video-title {
    font-size: 1rem;
    font-weight: 600;
    color: #222;
    margin: 8px 0 4px;
}

.card-video-channel {
    font-size: 0.75em;
    color: #555;
    margin-bottom: 4px;
}

.card-video-stats {
    font-size: 0.75em;
    color: #555;
}

/* YouTube Channel Cards */
.card-channel-thumb {
    width: 100%;
    border-radius: 50%;
    max-width: 120px;
    margin: 0 auto 12px;
    display: block;
    border: 3px solid #e1e5e9;
}

.card-channel-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #222;
    margin: 8px 0 4px;
    text-align: center;
}

.card-channel-stats {
    font-size: 0.75em;
    color: #555;
    text-align: center;
    margin-bottom: 8px;
}

.card-channel-description {
    font-size: 0.8em;
    color: #666;
    line-height: 1.4;
    margin-top: 8px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
}

.card-playlist-thumb {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.card-playlist-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 10px 0 4px;
    color: #1f1f1f;
}

.card-playlist-meta {
    font-size: 0.75em;
    color: #555;
    margin-bottom: 6px;
}

.card-playlist-description {
    font-size: 0.8em;
    color: #444;
    line-height: 1.4;
    margin-bottom: 8px;
}

.card-playlist-link-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-link-preview {
    font-size: 0.8em;
    text-decoration: underline;
    word-break: break-all;
    display: inline-block;
}

.card-link-preview.card-link--twitter { color: #1da1f2; }
.card-link-preview.card-link--arxiv { color: #b31b1b; }
.card-link-preview.card-link--github { color: #24292e; }
.card-link-preview.card-link--github-user { color: #24292e; }
.card-link-preview.card-link--youtube { color: #ff0000; }
.card-link-preview.card-link--youtube-channel { color: #ff0000; }
.card-link-preview.card-link--youtube-playlist { color: #ff0000; }
.card-link-preview.card-link--default { color: #0066cc; }

.card-link-indicator {
    font-size: 0.7em;
    color: #666;
    margin-top: 4px;
}

/* ArXiv Paper Card Styles */
.arxiv-paper-card {
    background: linear-gradient(135deg, #fff5f5 0%, #ffffff 100%);
    border-left: 4px solid #b31b1b;
    padding: 12px;
    border-radius: 6px;
    margin: 4px 0;
    overflow-y: auto;
    max-height: 100%;
}

.arxiv-header {
    font-size: 0.75em;
    color: #b31b1b;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.arxiv-category-badge {
    background: #b31b1b;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.85em;
    font-weight: 500;
}

.arxiv-title {
    font-size: 1.05em;
    font-weight: 600;
    color: #1a1a1a;
    text-decoration: none;
    display: block;
    margin-bottom: 8px;
    line-height: 1.3;
    transition: color 0.2s ease;
}

.arxiv-title:hover {
    color: #b31b1b;
    text-decoration: underline;
}

.arxiv-authors {
    font-size: 0.8em;
    color: #555;
    margin-bottom: 6px;
    line-height: 1.4;
}

.arxiv-date {
    font-size: 0.75em;
    color: #666;
    margin-bottom: 8px;
}

.arxiv-summary {
    font-size: 0.85em;
    color: #333;
    line-height: 1.5;
    margin-bottom: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 4px;
    font-style: italic;
}

.arxiv-id {
    font-size: 0.7em;
    color: #888;
    font-family: monospace;
    margin-top: 6px;
}
