/* Photos and pdfs in chat messages and notes: the paperclip, the chips under a composer, the gallery and the lightbox. */

.tbm-att-picker {
    color: var(--tbm-text-secondary);
}

.tbm-att-picker:hover {
    color: var(--tbm-text);
}

.tbm-att-picker--disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.tbm-chat-composer__emoji {
    display: flex;
    align-items: center;
    gap: 2px;
}

.tbm-note-composer__attach {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tbm-note-composer__attach-label {
    color: var(--tbm-text-secondary);
    font-size: 0.95rem;
}

/* Chips under the input. */
.tbm-att-drafts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 10px;
    padding: 0;
    list-style: none;
}

.tbm-att-draft {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    padding: 4px 4px 4px 6px;
    border: 1px solid var(--tbm-border-strong);
    border-radius: var(--tbm-radius);
    background: var(--tbm-input);
}

.tbm-att-draft--error {
    border-color: var(--tbm-error);
}

.tbm-att-draft__thumb {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    object-fit: cover;
}

.tbm-att-draft__icon {
    width: 22px;
    height: 22px;
    margin: 0 4px;
    color: var(--tbm-text-secondary);
}

.tbm-att-draft__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}

.tbm-att-draft__name {
    max-width: 200px;
    overflow: hidden;
    font-size: 0.95rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tbm-att-draft__status {
    color: var(--tbm-text-secondary);
    font-size: 0.85rem;
}

.tbm-att-draft--error .tbm-att-draft__status {
    color: var(--tbm-error);
}

.tbm-att-draft__spinner {
    margin: 0 6px;
}

/* In a message or note. */
.tbm-att-gallery {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.tbm-chat-bubble > .tbm-att-gallery:first-child {
    margin-top: 0;
}

.tbm-att-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 6px;
    max-width: 360px;
}

.tbm-att-grid--single {
    grid-template-columns: minmax(0, 280px);
}

.tbm-att-thumb {
    display: block;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: var(--tbm-radius);
    background: rgba(var(--tbm-overlay), 0.06);
    cursor: zoom-in;
    aspect-ratio: 1;
}

.tbm-att-grid--single .tbm-att-thumb {
    aspect-ratio: auto;
}

.tbm-att-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 280px;
    object-fit: cover;
}

.tbm-att-file {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 360px;
    padding: 8px 12px;
    border: 1px solid var(--tbm-border-strong);
    border-radius: var(--tbm-radius);
    background: rgba(var(--tbm-overlay), 0.04);
    color: inherit;
    text-decoration: none;
}

.tbm-chat-bubble a.tbm-att-file {
    text-decoration: none;
}

.tbm-att-file:hover {
    background: rgba(var(--tbm-overlay), 0.1);
}

.tbm-chat-msg--own .tbm-att-file {
    border-color: rgba(4, 4, 5, 0.3);
}

.tbm-att-file__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}

.tbm-att-file__name {
    overflow: hidden;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tbm-att-file__size {
    font-size: 0.85rem;
    opacity: 0.75;
}

/* Full size. */
.tbm-att-lightbox {
    position: fixed;
    z-index: 2000;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.88);
}

.tbm-att-lightbox img {
    max-width: 100%;
    max-height: calc(100vh - 96px);
    border-radius: var(--tbm-radius);
    object-fit: contain;
}

.tbm-att-lightbox__bar {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 100%;
    color: #FFFFFF;
}

.tbm-att-lightbox__bar span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tbm-att-lightbox__bar a {
    color: #FFFFFF;
    font-weight: 600;
}

.tbm-att-lightbox__bar .tbm-chat-action {
    color: #FFFFFF;
}
