.attachment-upload-container button.attachment-upload-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem 0.5rem;
    border-radius: var(--radius);
    font-size: 1.125rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    background: none;
    border: 1px solid transparent;
    line-height: 1;
}

.attachment-upload-container button.attachment-upload-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.attachment-upload-container button.attachment-upload-btn.dragover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.attachment-upload-container button.attachment-upload-btn.uploading {
    pointer-events: none;
    opacity: 0.6;
}

.attachment-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex: 0 0 100%;
    width: 100%;
}

.attachment-preview-list:empty,
.attachment-upload-error:empty {
    display: none;
}

.attachment-preview {
    position: relative;
    width: 96px;
    height: 96px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    background: var(--bg-card-hover);
}

.attachment-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.attachment-preview .file-icon {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    color: var(--text-muted);
    padding: 0.25rem;
    text-align: center;
    word-break: break-all;
}

.attachment-preview .file-icon .icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.attachment-preview .file-size {
    font-size: 0.625rem;
    color: var(--text-muted);
    margin-top: 0.125rem;
}

.attachment-preview .attachment-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.attachment-preview:hover .attachment-remove {
    opacity: 1;
}

.attachment-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--bg-primary);
}

.attachment-progress-bar {
    height: 100%;
    background: var(--accent);
    transition: width 0.3s;
}

.attachment-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

.attachment-gallery-item {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
    background: var(--bg-card-hover);
}

.attachment-gallery-item:hover {
    transform: scale(1.05);
}

.attachment-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.attachment-gallery-item .non-image {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    text-align: center;
    text-decoration: none;
    color: var(--text-secondary);
}

.attachment-gallery-item .non-image .icon {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.attachment-gallery-item .non-image .name {
    font-size: 0.6875rem;
    word-break: break-all;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-gallery-item .non-image .size {
    font-size: 0.625rem;
    color: var(--text-muted);
}

.attachment-gallery-item .non-image:hover {
    color: var(--accent);
}

.attachment-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    cursor: pointer;
}

.attachment-lightbox.visible {
    display: flex;
}

.attachment-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius);
}

.attachment-lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.attachment-upload-error {
    font-size: 0.75rem;
    color: var(--danger);
    margin-top: 0.375rem;
}

.attachment-counter {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    text-align: right;
}

.attachment-uploading-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 0.5rem;
}

@media (max-width: 480px) {
    .attachment-gallery-item {
        width: 80px;
        height: 80px;
    }
    .attachment-preview {
        width: 72px;
        height: 72px;
    }
}
